-
Notifications
You must be signed in to change notification settings - Fork 2
/
tasks.py
353 lines (322 loc) · 8.38 KB
/
tasks.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
noun = {
"cheese[| and tomato] toasty": 1,
"dog": 0.2,
"circular thing": 1,
"kitchen appliance": 1,
"[|instant ]coffee": 0.5,
"pinger": 1,
"potato lum": 1,
"[Magna|V8]": 1,
"stringer": 1,
"[pen|wowstick]": 1,
"koofka": 1,
"[danga|weeb]": 0.5,
"cheezel": 1,
"pickle": 1,
"beer": 1,
"fast food wrapper": 1,
"piece of paper": 1,
"[|RGB ]keyboard": 1,
"fidget spinner": 1,
"Nickleback album": 1,
"pizza": 1,
"[coles|weed] cookie": 1,
"croissant": 1,
"flute": 1,
"guitar": 1,
"dirty dish": 1,
"kale soup": 1,
"pair of headphones": 1,
}
nouns = {
"cheese[| and tomato] toasties": 1,
"dogs": 1,
"circular things": 1,
"kitchen appliances": 1,
"[|instant ]coffees": 0.5,
"[|monster rehab ]pingers": 1,
"potato lums": 1,
"[Magnas|V8's]": 1,
"stringers": 1,
"[pens|wowsticks]": 1,
"koofka fries": 1,
"[dangas|weebs]": 1,
"cheezels": 1,
"pickles": 1,
"beers": 1,
"fast food wrappers": 1,
"pieces of paper": 1,
"[|RGB ]keyboards": 1,
"fidget spinners": 1,
"socks that belong to [Perky|{person}]": 1,
"Nickleback albums": 1,
"slices of pizza": 1,
"[coles|weed] cookies": 1,
"croissants": 1,
"flutes": 1,
"dirty dishes": 1,
"pairs of headphones": 1,
}
concept = {
"[|dank] memes": 1,
"mystery skin": 1,
"discord": 1,
"[|bad |discord |beats|quoth]bot": 1,
"Give Priv": 1,
"[spotify|netflix] debt": 1,
"[nut-2-butt|butt-2-nut]": 1,
"reeeeeeeeee": 1,
"green dot": 1,
"pikagirl": 1,
"chicken dinner": 1,
"un-epic may-mays": 1,
"CentreLink": 1,
"food vids": 1,
"{subreddit}": 1,
"[Destiny|Density][| debate]": 1,
"Mr 100k": 1,
"homework": 1,
"sammasambuddhassa namo tasso bhagavato arahato": 1,
"a bit of basil": 1,
"supa gentleman's concrete caliphate": 1,
"[report of the week|food review]": 1,
"alt [left|right]": 1,
"reddit": 1,
}
verb = {
"[find|locate]": 1,
"touch": 1,
"diddle": 0.2,
"hide": 1,
"make a sculpture of": 1,
"[make|create]": 1,
}
adj = {
"nearby": 1,
"weird": 1,
"salty": 0.2,
"funny looking": 1,
"old": 1,
"upside down": 1,
"strange": 1,
"tiny": 1,
}
time = {
"one week": 1,
"one day": 1,
"one hour": 1,
"ten minutes": 1,
"one minute": 1,
"thirty seconds": 1,
}
event = {
"you next breathe out": 1,
"the clock strikes midnight": 1,
"Hexix next joins the chat": 1,
"Logan next loses a game": 1,
"Nano next talks about V8's": 1,
"James H-Bean next drinks a beer": 1,
"Jarrad next spills a drink on his keyboard": 1,
"Jarrad next plays the flute": 1,
"Kyle next eats koofka": 1,
"Beans next takes a life": 1,
"Pouria next green dots the chat": 1,
"Prakash next dogs the bois": 0.01,
"Beatsbot next breaks down": 1,
"Jarrad turns 100": 1,
}
extreme = {
"biggest": 1,
"smallest": 1,
"coolest": 1,
"best": 3,
"worst": 1,
"most unexpected": 1,
"weirdest looking": 2,
"nearest": 1,
"most circular": 1,
"saltiest": 1,
"nearest": 1,
"most flamboyant": 1,
"heaviest": 1,
"first": 2,
"most impressive": 3,
}
person = {
"Perky": 1,
"Jarrad": 1,
"Travis": 1,
"Keal": 1,
"Logan": 1,
"Nano": 1,
"Chris": 1,
"Beans": 0.5,
"James H-Bean": 1,
"Kyle": 1,
"a stranger": 0.5,
"not one of the boiss": 0.5,
"the person who called the bot": 0.2,
"the last person to touch a {noun}": 0.2,
}
place = {
"Adelaide CBD": 1,
"Flinders Uni": 1,
"2 Cheviot Avenue": 3,
"{person}'s bedroom": 2,
"Denman park": 1,
"Woolies": 1,
"somewhere with [grass|water]": 1,
"the {extreme} place[| you know]": 1,
"Christies [Downs|Downies]": 1,
"Mt Barker": 1,
}
number = {
"2": 3,
"3": 5,
"5": 4,
"10": 2,
"20": 1,
}
money = {
"no money": 2,
"$[1|{number}][|.50|.69]": 5,
"$4.20": 0.1,
}
game = {
"Minecraft": 1,
"PUBG": 1,
"[League of Legends|Legal Lettuce]": 1,
"Apex Legends": 1,
"Mount Your Friends": 1,
"Age of Empires": 1,
"Words with Friends": 1,
"StarCraft": 1,
"Rocket League": 1,
"Dota 2": 1,
"Fortnite": 1,
"World of Warcraft": 1,
"Dungeons and Dragons": 1,
"Warhammer": 1,
"Overwatch": 1,
"table tennis": 1,
"Don Bradman cricket": 1,
"Runescape": 2,
"Osu": 1,
"Smite": 1,
"soccer": 1,
}
subreddit = {
"r/cringe": 1,
"r/hexixwhiza": 1,
"r/watchpeopledie": 1,
"r/thedonald": 1,
"r/videos": 1,
"r/destiny": 1,
"r/pics": 1,
"r/funny": 1,
"r/me_irl": 1,
"r/atheism": 1,
"r/headphones": 1,
"r/mechanicalkeyboards": 1,
"r/gaming": 1,
"r/askreddit": 1,
"r/iama": 1,
"r/creepy": 1,
"r/memes": 1,
}
a_noun = {
"[a|a {adj}|the {extreme}] {noun}": 1,
"the closest object on your [left|right]": 0.1,
"something": 0.2,
}
n_nouns = {
"[|{number} ][|{adj} ]{nouns}": 1,
}
start = {
"form two teams, then ": 1,
"camouflage yourself, then ": 0.1,
"starting at {place}[| you know| you can find], ": 1,
"tie up {person}. Before he/she get free, ": 1,
"holding your hands behind your back at all times, ": 1,
"everyone on Discord[| right now], ": 1,
"[your task is to|you must] ": 2,
"This task is for {person}. without anyone else knowing, ": 1,
"to win, ": 1,
"{person} is the judge this round. Everyone else, ": 2,
}
middle = {
"{verb} [{a_noun}|{n_nouns}|a {noun}-related item]": 3,
"get [{a_noun}|{n_nouns}] to [{person}|{place}]": 2,
"get {a_noun} across a[n| makeshift] obstacle course": 0.5,
"[buy|obtain] [{a_noun}|{a_noun} for {person}|the {extreme} gift for {person}] with {money}": 1,
"[play|live stream|win|lose] a game of {game}[| with {person}| against {person}]": 1,
"[say|write down|post in discord] as many types of {noun} as possible": 1,
"balance [{a_noun}|at least {number} {nouns}|as many {nouns} as possible] on [a {noun}|your head]": 2,
"draw[|, using MS paint,|, using only condiments,] [a picture of {a_noun}|a portrait of {person}|what '{concept}' means to you]": 2,
"make a Discord chat for all things '[{noun}|{concept}]' related": 1,
"collect the lowest unique number of {nouns}": 1,
"hold a {noun} and a {noun} in the same hand without the two touching": 1,
"secretly steal [a {noun}|{money}] from {person}[| then give it back]": 1,
"get {person}'s attention using [his/her middle name|a {noun}]": 1,
"describe a trailer for '{concept}: the movie[| 2| 2 - revenge of the {nouns}]'": 0.2,
" hide yourself. {person} must try to find you": 1,
}
end = {
" without speaking any English": 1,
" as fast as possible": 1,
". You have {time}[|. Your time starts when {event}]": 2,
" before {event}": 1,
" while blindfolded": 1,
". (Bonus points for creativity)": 1,
". {person} cannot refuse this challenge": 1,
", taking as few steps as possible": 1,
" in an unexpected way": 1,
" to the best of your ability": 0.5,
" without touching the [floor|ground]": 1,
}
task = {
"[|{start}]{middle}[|{end}].": 1,
}
################################################################
from random import choice, choices
from re import search
def get(key):
return choices(*zip(*globals()[key].items()))[0]
def parse(string):
# evaluate forks
while True:
match = search('\[(.*?)\]', string)
if match:
i, j = match.start(), match.end()
key = string[i+1:j-1].split('|')
string = string[:i] + choice(key) + string[j:]
else:
break
# evaluate tokens
while True:
match = search('\{(.*?)\}', string)
if match:
i, j = match.start(), match.end()
key = string[i+1:j-1]
string = string[:i] + parse(get(key)) + string[j:]
else:
break
return string
def caps(string):
result, stop = '', True
for char in string:
if char == ' ':
result += char
elif char == '.':
stop = True
result += char
elif stop:
stop = False
result += char.upper()
else:
result += char
return result
def get_task():
return caps(parse(get('task')))
if __name__ == '__main__':
print(get_task())