home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun: Strategy Games 2
/
rerun-strategygamesII.d64
/
yatzy
(
.txt
)
< prev
Wrap
Commodore BASIC
|
2022-09-20
|
9KB
|
296 lines
2 printchr$(147)"would you like instructions (y/n)?
4 [161] a$: [139] a$[179][177] "y" [175] a$[179][177]"n" [167] 4
6 [139] a$[178]"n" [167] 88
8 [153]"instructions on screen or printer (s/p)?
10 get b$: if b$<> "s" and b$<>"p" then 10
12 if b$="s"then d=3
14 if b$="p" then d=4
16 open d,d
18 print#d,"
20 [152]d,"yatzy by robert cook
22 print#d,"run it right: c-64; joystick
24 [152]d,"
26 print#d,"in this 4 player game, you get three
28 [152]d,"rolls of the dice to make a hand.
30 print#d,"using a joystick in port 2, point the
32 [152]d,"hand at each die you want to reroll
34 print#d,"then fire. when you're ready, point
36 [152]d,"at "[199](34)"roll"[199](34)" and press fire again.
38 print#d,"cancel your selections with "chr$(34)"undo"chr$(34)". if
40 [152]d,"you like the first or second roll, just
42 print#d,"roll again.
44 [152]d,"
46 print#d,"the upper score area lists the numbers
48 [152]d,"on a die. the lower lists poker hands.
50 print#d,"above, a score is the number listed
52 [152]d,"times its frequency in the roll, and
54 print#d,"there's a bonus for totals of 63 or
56 [152]d,"more. below, a full house, small and
58 print#d,"large straights, and yatzy earn fixed
60 [152]d,"scores. three and four of a kind and
62 print#d,"chance (a catch-all) total all five
64 [152]d,"dice.":[139] d[178]4 [167] 74
66 [153]"press any key to continue"
68 [161] dd$:[139] dd$[178]"" [167] 68
70 [152]d,"
72 print#d,"
74 [152]d,"
76 print#d,"each turn, choose the unused category
78 [152]d,"that will score the most. if you use
80 print#d,"an inappropriate category, you score
82 [152]d,"zero. play ends when everyone has used
84 print#d,"all categories.
86 [152]d,"":[160]d
88 [153]"press any key to begin the program..."
90 [161] e$:[139] e$[178]"" [167] 90
92 [156]
94 [143] yatzy - robert b. cook
96 [141]376:[141]408:[141]322
98 [141]110:[141]170
100 [141]198:[141]282
102 c1[178]c1[170]1:[139]c1[178]np[172]13[167]310
104 pl[178]pl[170]1:[139]pl[177]np[167]pl[178]1
106 [137]98
108 [178] start [178]
110 [153]"waitstop"[163]58)[200]("sgnstop#1 sgnstop#2 sgnstop#3 sgnstop#4 int",np[172]6[170]2)
112 [153]""[163]54[170]pl[172]4)" #"[202]([196](pl),2)" waitsgn"
114 rl[178]1:[153]dn$[163]36)"on"rn$(1)
116 [129]l1[178]1[164]5:[151]2040[170]l1,200:di(l1)[178]0:[130]:[151]sp[170]21,62
118 [141]126:[139]rl[178]4[167][142]
120 [141]150:[139]rd[177]0[167]118
122 [142]
124 [178] roll dice [178]
126 [129]l1[178]1[164]5
128 [139]di(l1)[178]0[167]dn(l1)[178][181]([187](1)[172]6[170]1)
130 [130]
132 [129]l1[178]1[164]5:[139]di(l1)[178]1[167]142
134 t1[178][181]([187](1)[172]6[170]1)
136 [151]wv,129:[151]lf,85:[151]hf,36
138 [151]2040[170]l1,192[170]t1:[129]l2[178]1[164]25:[130]:[151]wv,128
140 di(l1)[178]1:[139]t1[179][177]dn(l1)[167]134
142 [130]
144 rl[178]rl[170]1:[139]rl[179]4[167][153]dn$[163]36)"on"rn$(rl)
146 [142]
148 [178] choose dice [178]
150 [151]sp[170]1,92:[151]sp[170]21,63:rd[178]0:t1[178]1
152 js[178][194](56320)[175]31:[139]js[178]31[167]152
154 [139]js[178]15[175]t1[178]0[167][129]l1[178]1[164]5:[151]2040[170]l1,192[170]dn(l1):di(l1)[178]1:[130]:rd[178]0
156 [139]js[178]15[175]t1[178]6[167]166
158 [139]js[178]15[175]t1[177]0[167][151]2040[170]t1,200:rd[178]rd[170]1:di(t1)[178]0
160 [139]js[178]29[167]t1[178]t1[170]1:[139]t1[177]6[167]t1[178]6
162 [139]js[178]30[167]t1[178]t1[171]1:[139]t1[179]0[167]t1[178]0
164 [151]sp[170]1,68[170]24[172]t1:[129]l1[178]1[164]99:[130]:[137]152
166 [146]56320,16,15:[142]
168 [178] choose line [178]
170 [151]sp[170]21,254
172 ln[178]1:[151]sp[170]15,86
174 js[178][194](56320)[175]31:[139]js[178]31[167]174
176 [139]js[178]15[175]mx(pl,ln)[178]0[167][142]
178 [139]js[178]15[167][141]304
180 [129]l1[178]1[164]99:[130]:[139]js[178]30[167]190
182 [139]js[179][177]29[167]174
184 ln[178]ln[170]1:[139]ln[178]7[167]ln[178]11
186 [139]ln[177]17[167]ln[178]1
188 [137]194
190 ln[178]ln[171]1:[139]ln[178]10[167]ln[178]6
192 [139]ln[179]1[167]ln[178]17
194 [151]sp[170]15,78[170]ln[172]8:[137]174
196 [178] calculate [178]
198 sc[178]0:mx(pl,ln)[178]1
200 [145][171](ln[179]7)[137]204:[137]218
202 [178] upper [178]
204 [129]l1[178]1[164]5
206 [139]dn(l1)[178]ln[167]sc[178]sc[170]ln
208 [130]
210 sc(pl,1)[178]sc(pl,1)[170]sc:[139]sc(pl,1)[177]62[167]sc(pl,2)[178]35
212 sc(pl,3)[178]sc(pl,1)[170]sc(pl,2):sc(pl,5)[178]sc(pl,3)[170]sc(pl,4)
214 [142]
216 [178] lower [178]
218 t1[178]0:t2[178]0:sc[178]0
220 [129]l1[178]1[164]6:ct(l1)[178]0:[130]
222 [129]l1[178]1[164]5:t2[178]t2[170]dn(l1):[129]l2[178]1[164]6
224 [139]dn(l1)[178]l2[167]ct(l2)[178]ct(l2)[170]1
226 [130]:[130]
228 [145]ln[171]10[141]236,236,246,258,258,270,278
230 sc(pl,4)[178]sc(pl,4)[170]sc:sc(pl,5)[178]sc(pl,3)[170]sc(pl,4)
232 [142]
234 [172] 3 [176] 4 of a kind [172]
236 [129]l1[178]1[164]6
238 [139]ln[178]11[175]ct(l1)[177]2[167]sc[178]t2
240 [139]ln[178]12[175]ct(l1)[177]3[167]sc[178]t2
242 [130]:[142]
244 [172] full house [172]
246 [129]l1[178]1[164]6
248 [139]ct(l1)[178]2[167]t1[178]t1[170]2
250 [139]ct(l1)[178]3[167]t1[178]t1[170]3
252 [139]t1[178]5[167]sc[178]25
254 [130]:[142]
256 [172] small straight [176] large straight [172]
258 [129]l1[178]1[164]6
260 t1[178]t1[170]1:[139]ct(l1)[178]0[167]t1[178]0
262 [139]ln[178]14[175]t1[178]4[167]sc[178]30
264 [139]ln[178]15[175]t1[178]5[167]sc[178]40
266 [130]:[142]
268 [172] yatzy [172]
270 [129]l1[178]1[164]6
272 [139]ct(l1)[178]5[167]sc[178]50
274 [130]:[142]
276 [172] chance [172]
278 sc[178]t2:[142]
280 [178] [153] [178]
282 [151]646,0:[139]ln[178]16[167][151]646,4
284 [153][200](dn$,ln[170]4)[163]19[170](4[172](pl[171]1)))[201](" "[170][196](sc),3)
286 [141]298
288 [129]l[178]1[164]5:t[178][197]([202]("01112132224",l[172]2,2))
290 [151]646,1:[139]l[178]2[167][151]646,2
292 [153][200](dn$,t)[163]19[170](4[172](pl[171]1)))[201](" "[170][196](sc(pl,l)),3)
294 [130]:[151]sp[170]21,62:[142]
296 [178] blip [178]
298 [151]sr,240:[151]wv,17:[151]hf,50:[151]lf,35
300 [129]l1[178]1[164]99:[130]:[151]wv,16:[151]sr,0:[142]
302 [178] buzz [178]
304 [151]sr,240:[151]wv,33:[151]hf,5
306 [129]l1[178]1[164]150:[130]:[151]wv,32:[142]
308 [178] [128] game [178]
310 [151]sp[170]21,0:[151]829,234
312 [153]" press fire "
314 [129]l1[178]1[164]np:hs[178]sc(l1,5):[139]hs[179][178][194](829[170]l1[172]2)[172]256[170][194](830[170]l1[172]2)[167]318
316 [151]829[170]l1[172]2,hs[173]256:[151]830[170]l1[172]2,(hs[173]256[171][181](hs[173]256))[172]256
318 [130]:[146]56320,16,16:[146]56320,16,15:[138]
320 [178] screen [178]
322 [153]"loadabs ortan^ortan^ortan^ortan^ortan^ wait(NULL)usrusrusr(NULL)usrusrusr(NULL)usrusrusr(NULL)usrusrusrintsys "
324 [153]"abs (NULL)y(NULL)(NULL)a(NULL)(NULL)t(NULL)(NULL)z(NULL)(NULL)y(NULL) waitsgn sgn sgn sgn intsys "
326 [153]"abs /tanexp/tanexp/tanexp/tanexp/tanexp wait(NULL)andandand(NULL)andandand(NULL)andandand(NULL)andandandintsysundo"
328 [153]"abscont high score waitfn fn fn fn intsysusrusrusrusr
330 print"[182][144]aces........[165][144]add [165] [165] [165] [165] [181]
332 [153]"absstopdeuces......fnstopadd fn fn fn fn int
334 print"[182][144]threes......[165][144]add [165] [165] [165] [165] [181]
336 [153]"absstopfours.......fnstopadd fn fn fn fn int
338 print"[182][144]fives.......[165][144]add [165] [165] [165] [165] [181]
340 [153]"absstopsixes.......fnstopadd fn fn fn fn int
342 print"[182] sub total [146][165] [165] [165] [165] [181]
344 [153]"abs bonus (63) waitfn=35 fn fn fn fn int
346 print"[182] total upper [146][165] [165] [165] [165] [181]
348 [153]"absusrusrusrusrusrusrusrusrusrusrusrusr(NULL)usrusrusrusr(NULL)usrusrusr(NULL)usrusrusr(NULL)usrusrusr(NULL)usrusrusrint
350 print"[182][144]3 of a kind.[165][144]add [165] [165] [165] [165] [181]
352 [153]"absstop4 of a kind.fnstopadd fn fn fn fn int
354 print"[182][144]full house..[165][144]=25 [165] [165] [165] [165] [181]
356 [153]"absstopsm straight.fnstop=30 fn fn fn fnclose int
358 print"[182][144]lg straight.[165][144]=40 [165] [165] [165] [165] [181]
360 [153]"absclryatzy waitfnclr=50 fn fn fn fn intforandanda