-
Notifications
You must be signed in to change notification settings - Fork 0
/
generator.py
61 lines (53 loc) · 1.58 KB
/
generator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import sys,time,random,string
numrows = string.atoi(sys.argv[1])
opponent = [
'FC Booyah',
'Real Real',
'Boondocks United',
'Sticks FC',
'Gorilla Futbal'
'Nine Random Guys'
]
weather = [
"Clear",
"Hot",
"Snowing",
"Hot and humid",
"Hailing",
"Lightning and blustery",
"Tornado",
"Severe flooding",
"Cats and dogs living together",
]
gametype = [
'Friendly',
'Tournament',
'League',
'Grudge match'
]
field = [
'Grass -- good condition',
'Grass -- poor condition',
'Grass -- ATVs are scared',
'Turf -- good condition',
'Turf -- poor condition',
'I thought they said turf!!??',
'We couldn\' find the field',
'Field exists only in someone\'s troubled mind',
'Dirt',
'Mud',
]
rdm_s = lambda data: data[random.randint(0,len(data)-1)]
rdm_n = lambda floor,ceiling: random.randint(floor,ceiling)
def date_gen():
# return a random date between now the next three years
res = time.localtime(time.time() + (random.randint(1,365*3)*86400))
lookup = ['OneBasedIdx','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
return '%d-%s-%d' % (res[2],lookup[res[1]],res[0])
while numrows != 0:
numrows = numrows - 1
print "%s,%s,%s,%s,%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d" % (rdm_s(opponent),date_gen(),rdm_s(weather), \
rdm_s(gametype),rdm_s(field),rdm_n(0,5),rdm_n(0,5),rdm_n(0,5),rdm_n(0,5), \
rdm_n(0,20),rdm_n(0,20),rdm_n(0,20),rdm_n(0,20), \
rdm_n(0,6),rdm_n(0,6),rdm_n(0,6),rdm_n(0,6), \
rdm_n(0,20),rdm_n(0,20),rdm_n(0,20),rdm_n(0,20))