-
Notifications
You must be signed in to change notification settings - Fork 4
/
woof_kao.py
71 lines (53 loc) · 1.8 KB
/
woof_kao.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
import os
import random
import pouchy
from home import your_puzzle
def personal_task():
with open("graffiti_wall.txt", "w") as f:
message = "Anything you want to say about PyCon TW."
f.write(message)
with open("graffiti_wall.txt", "r") as f:
photo = f.read()
with open("social_media.txt", "w") as f:
f.write(photo)
f.write("@pycon.tw")
if os.path.isfile("social_media.txt"):
return True
else:
return False
def team_task(your_puzzle):
members = ["PY", "TH", "ON"]
your_teammates = [m for m in members if m != your_puzzle]
photo_content = {}
if len([your_puzzle] + your_teammates) == 3:
photo_content["puzzle_image"] = "".join(members)
photo_content["people"] = len(members)
photo_content["background"] = "graffiti_wall"
for _, value in photo_content.items():
if value is None:
return False
return True
def booth_task():
sponsor_booths = ["PSF", "E.SUN Bank", "REUVEN LERNER", "Tenlong bookstore"]
community_booths = ["OCF", "COSCUP", "MOPCON", "Good Ideas Studio"]
unfinished_booths = sponsor_booths + community_booths
while len(unfinished_booths) > 0:
booth = random.choice(unfinished_booths)
if pouchy.visit(booth):
unfinished_booths.remove(booth)
if len(unfinished_booths) == 0:
return True
else:
return False
def task():
passed_count = 0
if personal_task():
passed_count += 1
if team_task(your_puzzle):
passed_count += 1
if booth_task():
passed_count += 1
if passed_count == 3:
return "Congratulations, you’ve qualified for the Grand Prize raffle!"
if __name__ == "__main__":
task()