-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcore.py
50 lines (30 loc) · 865 Bytes
/
core.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
import pprint
import creator
import decoder
import encoder
import graph
import player
from VarStore import VarStore
from story import Story
def check_graph(story):
print('Cycles:', graph.has_cycles(story))
print('Shortest path:', graph.find_shortest_end_simple(story))
print('Dead-ends: ', graph.find_dead_ends(story))
def check_player(story):
player.cli_player(story)
def check_creator(story):
creator.main()
def playground(story: Story):
encoded = encoder.encode_story(story)
with open('test.json', 'w') as f:
f.write(encoded)
decoded = decoder.decode_story(encoded, story.store())
player.cli_player(decoded)
def main():
story = creator.create_test_story()
# check_creator(story)
# check_graph(story)
# check_player(story)
playground(story)
if __name__ == '__main__':
main()