scottkit 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. data/.gitignore +4 -0
  2. data/GPL-2 +339 -0
  3. data/Makefile +5 -0
  4. data/README +75 -0
  5. data/Rakefile +58 -0
  6. data/VERSION +1 -0
  7. data/bin/scottkit +96 -0
  8. data/bin/scottkit.rb +96 -0
  9. data/data/.gitignore +1 -0
  10. data/data/adams/.gitignore +2 -0
  11. data/data/adams/AdamsGames.zip +0 -0
  12. data/data/adams/Makefile +18 -0
  13. data/data/crystal/crystal.map +112 -0
  14. data/data/crystal/crystal.sck +598 -0
  15. data/data/crystal/crystal.solution +82 -0
  16. data/data/dan-and-matt.sck +180 -0
  17. data/data/dan-and-matt.solution +32 -0
  18. data/data/howarth/.gitignore +2 -0
  19. data/data/howarth/Makefile +14 -0
  20. data/data/howarth/mysterious.tar.gz +0 -0
  21. data/data/test/Makefile +18 -0
  22. data/data/test/adams/Makefile +13 -0
  23. data/data/test/adams/adv01.solution +186 -0
  24. data/data/test/adams/adv01.transcript +869 -0
  25. data/data/test/adams/adv01.transcript.md5 +1 -0
  26. data/data/test/adams/adv02.solution +225 -0
  27. data/data/test/adams/adv02.transcript +970 -0
  28. data/data/test/adams/adv02.transcript.md5 +1 -0
  29. data/data/test/adams/adv04.solution +187 -0
  30. data/data/test/adams/adv04.transcript +876 -0
  31. data/data/test/adams/adv04.transcript.md5 +1 -0
  32. data/data/test/crystal.decompile +628 -0
  33. data/data/test/crystal.sao +373 -0
  34. data/data/test/crystal.save-file +62 -0
  35. data/data/test/crystal.save-script +41 -0
  36. data/data/test/crystal.sck +598 -0
  37. data/data/test/crystal.solution +82 -0
  38. data/data/test/crystal.transcript +413 -0
  39. data/data/test/t6.pretty-print +225 -0
  40. data/data/test/t7.sao +110 -0
  41. data/data/test/t7.solution +28 -0
  42. data/data/test/t7.transcript +147 -0
  43. data/data/tutorial/t1.sck +5 -0
  44. data/data/tutorial/t2.sck +14 -0
  45. data/data/tutorial/t3.sck +38 -0
  46. data/data/tutorial/t4.sck +62 -0
  47. data/data/tutorial/t5.sck +87 -0
  48. data/data/tutorial/t6.sck +119 -0
  49. data/data/tutorial/t7.sck +135 -0
  50. data/lib/scottkit/compile.rb +661 -0
  51. data/lib/scottkit/decompile.rb +175 -0
  52. data/lib/scottkit/game.rb +409 -0
  53. data/lib/scottkit/play.rb +474 -0
  54. data/notes/Definition +147 -0
  55. data/notes/Definition.saved-game +9 -0
  56. data/notes/Definition.scottfree-1.14 +142 -0
  57. data/notes/adventureland-maze +20 -0
  58. data/notes/continue-action +51 -0
  59. data/test/test_canonicalise.rb +94 -0
  60. data/test/test_compile.rb +54 -0
  61. data/test/test_decompile.rb +13 -0
  62. data/test/test_play.rb +20 -0
  63. data/test/test_playadams.rb +36 -0
  64. data/test/test_save.rb +31 -0
  65. data/test/withio.rb +15 -0
  66. data/test/withio_test.rb +31 -0
  67. metadata +118 -0
@@ -0,0 +1,180 @@
1
+ # Map
2
+ #
3
+ # Chamber---------Dungeon----||---Disneyland
4
+ # |
5
+ # |
6
+ # |
7
+ # Lair
8
+ # |
9
+ # =
10
+ # |
11
+ # Legoland
12
+
13
+ # flag 1: cheeseburger has been eaten
14
+ # flag 2: potion has been drunk
15
+ # flag 3: initialisation done
16
+ # flag 4: first entry to Disneyland
17
+
18
+ occur when !flag 3
19
+ set_counter 3
20
+ set_flag 3
21
+ print "Welcome to Dan and Matt's game"
22
+
23
+ room chamber "square chamber. Leave treasure here to score points."
24
+ exit east dungeon
25
+
26
+ item box box
27
+
28
+ action examine box when here box and !exists pistol
29
+ print "You notice it contains a pistol, which you take out."
30
+ drop pistol
31
+
32
+ action open box when here box and !exists pistol
33
+ print "It contains a pistol, which you take out."
34
+ drop pistol
35
+
36
+ action examine box when here box
37
+ print "It's empty now."
38
+
39
+ item pistol "pistol" called pistol
40
+ nowhere
41
+
42
+ noungroup pistol gun
43
+
44
+ room dungeon "gloomy dungeon"
45
+ exit west chamber
46
+ exit south lair
47
+
48
+ item bullets "bullets" called bullets
49
+
50
+ action examine bullets when present bullets
51
+ print "There are"
52
+ print_counter
53
+ print "bullets left"
54
+
55
+ item xyz "pink cheeseburger" called cheeseburger
56
+
57
+ action examine cheeseburger when here xyz
58
+ print "This pink cheeseburger looks as if it has been eaten before."
59
+
60
+ action eat cheeseburger when present xyz
61
+ destroy xyz
62
+ print "Om nom nom."
63
+ set_flag 1
64
+
65
+ item fireplace fireplace
66
+
67
+ action eat fireplace when here fireplace and !flag 2
68
+ print "Your mouth is now on fire."
69
+ game_over
70
+
71
+ action eat fireplace when here fireplace and flag 2
72
+ print "Your mouth is invulnerable and the fire is tasty!"
73
+ print "You find something"
74
+ swap lollipop fireplace
75
+ look
76
+
77
+ item lollipop "*golden lollipop*" called lollipop
78
+ nowhere
79
+
80
+ action eat lollipop when present lollipop
81
+ print "I'd better not."
82
+
83
+ item door "heavy stone door"
84
+
85
+ action open door when here door and !flag 1
86
+ print "You're too weak to move it."
87
+
88
+ action open door when here door and flag 1
89
+ print "Energised by the cheeseburger, you manage to shift it"
90
+ destroy door
91
+ drop opendoor
92
+
93
+ item opendoor "wide open stone door"
94
+ nowhere
95
+
96
+ room dis "*I'm in Disneyland"
97
+ exit west dungeon
98
+
99
+ action go door when here opendoor
100
+ goto dis
101
+ look
102
+
103
+ item bloke "funny-looking bloke with toothbrush moustache"
104
+
105
+ item deadbloke "funny-looking dead bloke" nowhere called bloke
106
+
107
+ # Because there are so many conditions on this action, most of the
108
+ # condition slots that would hold instruction parameters are already
109
+ # filled, and so the argument to the swap instruction won't fit, so we
110
+ # need to move them in to the next action (which we of course code as
111
+ # "occur 0%") and use a continue instruction.
112
+ #
113
+ action shoot bloke when "carried" pistol and "carried" bullets and counter_gt 0
114
+ print "He curls up and dies, dropping a potion."
115
+ drop potion
116
+ dec_counter
117
+ continue
118
+
119
+ occur 0%
120
+ swap bloke deadbloke
121
+
122
+ occur when "at" dis and !flag 4
123
+ print "Bloke says: 'Welcome to Disneyland!'"
124
+ set_flag 4
125
+
126
+ item potion "potion of invulnerability" called potion
127
+ nowhere
128
+
129
+ action drink potion when present potion
130
+ print "Yum, that tasted of boiled fish-heads."
131
+ swap potion bottle
132
+ set_flag 2
133
+
134
+ item bottle "empty potion bottle" nowhere
135
+
136
+ room lair "dragon's lair"
137
+ exit north dungeon
138
+
139
+ item passage "passage leads south"
140
+
141
+ item dragon "huge golden dragon"
142
+
143
+ occur when "carried" pistol and "carried" bullets and counter_gt 0
144
+ and here dragon
145
+ print "The dragon doesn't like the look of my weapon: he eats me!"
146
+ game_over
147
+
148
+ action go passage when here dragon
149
+ print "I can't get past the dragon!"
150
+
151
+ action shoot dragon when "carried" pistol and "carried" bullets and counter_gt 0
152
+ print "The dragon is very slightly irritated ... just enough to eat me."
153
+ game_over
154
+
155
+ action give bloke when present deadbloke and present dragon
156
+ destroy deadbloke
157
+ print "The dragon eats the dead bloke and falls asleep."
158
+ swap dragon sleepingdragon
159
+
160
+ item sleepingdragon "peacefully snoring dragon" nowhere
161
+
162
+ item sign "sign stuck in the ground"
163
+ at dungeon
164
+
165
+ action examine sign when here sign
166
+ print "'Do not take weapons south!'"
167
+
168
+ action go passage when here passage and !here dragon
169
+ goto legoland
170
+ look
171
+
172
+ room legoland "*I'm in Legoland!"
173
+ exit north lair
174
+
175
+ item brick "*golden brick*" called brick
176
+
177
+ action score: score
178
+ action look: look
179
+ action inventory: inventory
180
+ action save game: save_game
@@ -0,0 +1,32 @@
1
+ examine box
2
+ get gun
3
+ examine box
4
+ east
5
+ examine sign
6
+ get bullets
7
+ examine bullets
8
+ open door
9
+ eat cheeseburger
10
+ open door
11
+ shoot bloke
12
+ drink potion
13
+ eat fire
14
+ get lollipop
15
+ west
16
+ drop lollipop
17
+ score
18
+ east
19
+ go door
20
+ get bloke
21
+ west
22
+ drop gun
23
+ south
24
+ go passage
25
+ give bloke
26
+ go passage
27
+ get brick
28
+ north
29
+ north
30
+ west
31
+ drop brick
32
+ score
@@ -0,0 +1,2 @@
1
+ ReadMe.txt
2
+ *.dat
@@ -0,0 +1,14 @@
1
+ # See comments for ../adams/Makefile
2
+
3
+ 1_baton.dat: mysterious.tar.gz
4
+ tar xzf mysterious.tar.gz
5
+
6
+ mysterious.tar.gz:
7
+ wget -nv http://ifmirror.russotto.net/if-archive/scott-adams/games/scottfree/mysterious.tar.gz
8
+
9
+ clean:
10
+ rm -f ReadMe.txt *.dat
11
+
12
+ realclean: clean
13
+ rm -f mysterious.tar.gz
14
+
Binary file
@@ -0,0 +1,18 @@
1
+ # This rebuilds the files used for regression testing
2
+ # Do this ONLY WHEN SURE that the software is correct
3
+
4
+ RUN = ruby1.9 -I ../../lib ../../bin/scottkit
5
+
6
+ **default**:
7
+ @echo "Use 'make rebuild' if you are SURE that the software is correct"
8
+
9
+ rebuild: rebuild-decompile rebuild-play
10
+
11
+ rebuild-decompile:
12
+ $(RUN) -d ../adams/adv01.dat > adv01.decompile
13
+
14
+ rebuild-play:
15
+ ### Rebuild crystal, etc.
16
+
17
+ .PHONY: rebuild rebuild-decompile rebuild-play
18
+
@@ -0,0 +1,13 @@
1
+ # This rebuilds the files used for regression testing
2
+ # Do this ONLY WHEN SURE that the software is correct
3
+
4
+ RUN = ruby1.9 -I ../../../lib ../../../bin/scottkit
5
+
6
+ **default**:
7
+ @echo "Use 'make rebuild' if you are SURE that the software is correct"
8
+
9
+ rebuild:
10
+ for i in 01 02 04; do \
11
+ $(RUN) -e -s 12368 -W ../../adams/adv$$i.dat < adv$$i.solution > adv$$i.transcript; \
12
+ md5sum adv$$i.transcript | sed 's/ .*//' > adv$$i.transcript.md5; \
13
+ done
@@ -0,0 +1,186 @@
1
+ xyz
2
+ jump
3
+ help
4
+ climb tree
5
+ climb tree
6
+ down
7
+ go
8
+ get
9
+ drop
10
+ get xyz
11
+ get dragon
12
+ e
13
+ get dragon
14
+ east
15
+ get axe
16
+ go south
17
+ go hole
18
+ get flint
19
+ up
20
+ w
21
+ climb tree
22
+ read web
23
+ get key
24
+ d
25
+ chop tree
26
+ go stump
27
+ score
28
+ Tell me what to do ?
29
+ rub lamp
30
+ rub lamp
31
+ score
32
+ get bottle
33
+ u
34
+ get mud
35
+ go stump
36
+ drop axe
37
+ d
38
+ go hole
39
+ open door
40
+ go hall
41
+ up
42
+ up
43
+ get rubies
44
+ up
45
+ drop rubies
46
+ score
47
+ get lamp
48
+ down
49
+ go hole
50
+ go hall
51
+ light lamp
52
+ down
53
+ west
54
+ east
55
+ n
56
+ n
57
+ get honey
58
+ drink water
59
+ get bees
60
+ make hole
61
+ s
62
+ s
63
+ u
64
+ u
65
+ unlight lamp
66
+ u
67
+ u
68
+ drop honey
69
+ drop key
70
+ u
71
+ drop mud
72
+ n
73
+ drop bees
74
+ drop bees
75
+ get eggs
76
+ e
77
+ get water
78
+ s
79
+ w
80
+ w
81
+ get fruit
82
+ e
83
+ go stump
84
+ drop eggs
85
+ drop fruit
86
+ score
87
+ d
88
+ go hall
89
+ light lamp
90
+ go hole
91
+ d
92
+ go hall
93
+ d
94
+ s
95
+ get bladder
96
+ n
97
+ u
98
+ u
99
+ unlight lamp
100
+ u
101
+ u
102
+ u
103
+ get gas
104
+ go stump
105
+ d
106
+ go hole
107
+ light lamp
108
+ go hall
109
+ d
110
+ s
111
+ u
112
+ drop bladder
113
+ light gas
114
+ go hole
115
+ jump
116
+ scream
117
+ go throne
118
+ get crown
119
+ w
120
+ get mirror
121
+ jump
122
+ w
123
+ get bricks
124
+ d
125
+ n
126
+ u
127
+ u
128
+ unlight lamp
129
+ u
130
+ u
131
+ drop crown
132
+ score
133
+ down
134
+ go hol
135
+ light lamp
136
+ drop flint
137
+ go hal
138
+ d
139
+ d
140
+ d
141
+ w
142
+ d
143
+ get rug
144
+ d
145
+ get net
146
+ build dam
147
+ drop bricks
148
+ pour water
149
+ get firestone
150
+ say away
151
+ say away
152
+ unlight lamp
153
+ s
154
+ go stump
155
+ drop rug
156
+ drop mirror
157
+ drop firestone
158
+ u
159
+ e
160
+ n
161
+ get water
162
+ catch fish
163
+ s
164
+ w
165
+ take mud
166
+ drop mud
167
+ go stump
168
+ drop fish
169
+ drop net
170
+ get axe
171
+ drop bottle
172
+ drop lamp
173
+ u
174
+ n
175
+ e
176
+ n
177
+ say bunyon
178
+ swim
179
+ s
180
+ w
181
+ w
182
+ get ox
183
+ e
184
+ go stump
185
+ drop ox
186
+ score