update20140630

This commit is contained in:
stubbfel
2014-06-30 13:58:10 +02:00
parent 565970632e
commit 1e6cf42df3
877 changed files with 1146249 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
import random
import sys
def createCommand(joins, joinRate):
nextLeaveNumber = 2
joinCount = 0
commands = []
while joinCount < joins:
if random.random() < joinRate:
commands.append("J")
joinCount += 1
elif nextLeaveNumber < joinCount:
commands.append("L" + repr(nextLeaveNumber))
nextLeaveNumber += 1
resultStr = ""
resultStr += "###\n"
jsString = "{"
index = 0
for command in commands:
jsString += "\"" + repr(index) + "\":\"" + command + "\","
index += 1
resultStr += command + "\n"
jsString = jsString[:-1] + "}"
resultStr += "###" + "\n"
resultStr += jsString + "\n"
return resultStr
if __name__ == "__main__":
createCommand(int(sys.argv[1]), float(sys.argv[2]))