-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathmassRun.py
More file actions
70 lines (67 loc) · 2.23 KB
/
massRun.py
File metadata and controls
70 lines (67 loc) · 2.23 KB
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
import os
import textplayer.textPlayer as tp
'''
# For running commands on multiple games
game_num = 1
for game in os.listdir(os.getcwd() + '/textplayer/games'):
print '--------------------------------------------------'
print game_num, game
t = tp.TextPlayer(game)
start_info = t.run()
print start_info
command_output = t.execute_command('go west')
print command_output
command_output = t.execute_command('go east')
print command_output
command_output = t.execute_command('go east')
print command_output
command_output = t.execute_command('go east')
print command_output
command_output = t.execute_command('look')
print command_output
game_num += 1
'''
# For running commands on a single game
t = tp.TextPlayer('zork1.z5')
start_info = t.run()
print start_info
command_output = t.execute_command('open mailbox')
print command_output
command_output = t.execute_command('read leaflet')
print command_output
command_output = t.execute_command('go south')
print command_output
command_output = t.execute_command('go east')
print command_output
command_output = t.execute_command('open window')
print command_output
command_output = t.execute_command('enter window')
print command_output
command_output = t.execute_command('take bottle')
print command_output
command_output = t.execute_command('open bottle')
print command_output
command_output = t.execute_command('drink water')
print command_output
command_output = t.execute_command('take sack')
print command_output
command_output = t.execute_command('open sack')
print command_output
command_output = t.execute_command('eat lunch')
print command_output
command_output = t.execute_command('eat garlic')
print command_output
command_output = t.execute_command('go west')
print command_output
command_output = t.execute_command('take lantern')
print command_output
command_output = t.execute_command('take sword')
print command_output
command_output = t.execute_command('go east')
print command_output
command_output = t.execute_command('go east')
print command_output
command_output = t.execute_command('look')
print command_output
command_output = t.execute_command('inventory')
print command_output