-
Notifications
You must be signed in to change notification settings - Fork 1
/
driver.py
32 lines (26 loc) · 893 Bytes
/
driver.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
import json
import secrets
f = open('db.json',)
data = json.load(f)
flow = [
["_greeting", "_education", "_finances", "_exit"],
["_greeting", "_finances", "_exit"],
["_greeting", "_aboutNEU", "_finances","_exit"],
["_greeting", "_finances", "_grill", "_exit"],
["_greeting", "_education", "_finances", "_grill", "_exit"],
["_greeting", "_aboutNEU", "_education", "_exit"],
["_greeting", "_aboutNEU", "_education", "_finances", "_exit"],
]
while (True):
print("----------START----------")
chosen_flow = secrets.choice(flow)
for item in chosen_flow:
state = data[item]
while(state):
keys = list(state.keys())
chosen_key = secrets.choice(keys)
print("VO: "+chosen_key, end="")
input("")
state = state[chosen_key]
print("-----------END-----------", end="")
input("")