-
Notifications
You must be signed in to change notification settings - Fork 10
/
gen_topic.py
executable file
·68 lines (53 loc) · 1.1 KB
/
gen_topic.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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
donouns = [
"Programmieren" ,
"Hacken" ,
"λaskell" ,
"Python" ,
"Kuchen" ,
"Nudeln" ,
"Pizza" ,
"Computer" ,
"Elektronik" ,
"Bier" ,
"Kaffee" ,
"Löten" ,
"Ruby" ]
philnouns = [
"Linux" ,
"Wind0ze",
"XMPP-Clients unter Android" ,
"Topologisches Sortieren" ,
"Erdbeeren"]
nouns = donouns + philnouns
ortphrase = [
"an der Elbe" ,
"in der sächs.Schweiz" ,
"im HQ",
"im Netzbiotop e.V.",
"bei $h4ck3r",
"in dd" ,
"im CCC" ]
zeitphrase = [
"im späten 18.Jhrd" ,
"in der heutigen Zeit" ,
"heute abend"
]
adverbphrase = ortphrase + zeitphrase + [
"an sich",
"überhaupt" ]
def get_topic():
def ra(x):
return random.choice(x)
whundert = random.randint(0,99)
if (whundert < 40):
return "%s %s"%(ra(nouns) ,ra(adverbphrase))
elif (whundert > 40) :
return "%s %s %s"%(ra(donouns),ra(ortphrase),ra(zeitphrase))
else :
return "Das Leben und der ganze Rest"
if __name__ == "__main__":
for i in range(80):
print get_topic()