update20131016
This commit is contained in:
30
createteTestRun.php
Executable file
30
createteTestRun.php
Executable file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
$joins = $_GET["joins"];
|
||||
$joinRate = $_GET["joinrate"];
|
||||
|
||||
$commands = array();
|
||||
$nextLeaveNumber = 2;
|
||||
$joinCount = 0;
|
||||
|
||||
while($joinCount < $joins) {
|
||||
if (rand(0, 100) < $joinRate * 100) {
|
||||
array_push($commands, "J");
|
||||
$joinCount++;
|
||||
} else if ($nextLeaveNumber < $joinCount){
|
||||
array_push($commands, "L".$nextLeaveNumber++);
|
||||
}
|
||||
}
|
||||
echo "commands.txt\n";
|
||||
|
||||
foreach ($commands as $value) {
|
||||
echo $value."\n";
|
||||
}
|
||||
|
||||
echo "commands.js\n{";
|
||||
foreach ($commands as $value) {
|
||||
echo "\"".$value."\",";
|
||||
}
|
||||
echo "}\n";
|
||||
print_r($commands);
|
||||
?>
|
||||
Reference in New Issue
Block a user