home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun: Strategy Games 2
/
rerun-strategygamesII.d64
/
duo
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
10KB
|
281 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] 92
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,"duo by robert cook
22 print#d,"run it right: c-64; joystick optional
24 [152]d,"
26 print#d,"the object of duo, adapted from the
28 [152]d,"popular game uno, is to score 100
30 print#d,"points. the playing deck has 100 cards;
32 [152]d,"eight each of 0 to 9 worth face value,
34 print#d,"skip a turn and draw 2 cards for 20
36 [152]d,"points each, plus four wild cards (50
38 print#d,"points) all but the wildcards are
40 [152]d,"colored.
42 print#d,"initially, each player gets six cards,
44 [152]d,"with one in the discard pile. to draw,
46 print#d,"move the pointer using the joystick or
48 [152]d,"the arrow keys. you must discard each
50 print#d,"turn. enter every play with the fire
52 [152]d,"button or the return key.":[139] d[178]4 [167] 64
54 [152]d,"
56 print"press a key to continue"
58 get dd$:if dd$="" then 58
60 print#d,"
62 [152]d,"
64 print#d,"
66 [152]d,"a discard must match the top card on
68 print#d,"the pile in color, number or action.
70 [152]d,"pick a color for a wildcard with any
72 print#d,"cursor key or joystick direction.
74 [152]d,"
76 print#d,"if you empty your hand, you score the
78 [152]d,"total of the computer's hand. if the
80 print#d,"computer accumulates 18 cards, you
82 [152]d,"score the difference between the values
84 print#d,"of the hands, yours being smaller. the
86 [152]d,"winner gets ten extra points. if the
88 print#d,"deck runs out, the hand ends with no
90 [152]d,"winner.":[160]d
92 [153]"press any key to begin the program..."
94 [161] e$:[139] e$[178]"" [167] 94
96 [156]
98 [143] * * duo 64 * * * v 1.0 * * * * * robert b. cook * * *
100 [151]53280,11:[151]53281,1:[151]53265,11
102 [141]456:[141]544:[151]53265,27
104 [141]328
106 [151]646,4[171](pu[178]2)[172]4:[153]el$:[145]pu[141]116,210:[151]sp,0
108 [139]yc[178]0[176]mc[178]0[176]yc[177]17[176]mc[177]17[167][141]370:[137]104
110 [139]dp[178]100[167][141]300:[137]104
112 pu[178]3[171]pu:[137]106
114 :: you ::
116 [151]sx,30:[151]sy,218:[151]sp,1:mv[178]1:sk[178]0:[151]sb,0
118 [153][200](cr$,7)"clr(NULL)lay a card or str$raw the from deckwait":[141]310
120 [161]g$:js[178][194](56320)[175]31:[139]g$[178]""[175]js[178]31[167]120
122 [139]g$[178]"^"[176]js[178]30[167][151]sx,150:[151]sy,170:[151]sb,0:[137]120
124 [139]g$[178]""[176]js[178]23[167]mv[178]mv[170]1:[139]mv[177]yc[167]mv[178]1
126 [139]g$[178]""[176]js[178]27[167]mv[178]mv[171]1:[139]mv[179]1[167]mv[178]yc
128 [129]l[178]1[164]50:[130]:t[178]14[170]mv[172]16:t1[178]0:[139]t[177]255[167]t[178]t[171]255:t1[178]1
130 [139]g$[179][177][199](13)[175]js[179][177]15[167][151]sx,t:[151]sy,218:[151]sb,t1:[137]120
132 [153]el$
134 [139][194](sy)[178]170[167]yc[178]yc[170]1:yc(yc)[178]dk(dp):dp[178]dp[170]1:[141]164:[142]
136 [139]cv(yc(mv))[179][177]12[175]cv(yc(mv))[179][177]cv(uc)[175]cc$(yc(mv))[179][177]cc$(uc)[167]156
138 [153][200](cr$,15)[163]21)""[170]cd$(yc(mv))
140 [153][200](cr$,15)[163]21)cc$(yc(mv))[170]cd$(yc(mv))
142 uc[178]yc(mv):yc[178]yc[171]1:[139]yc[167][141]162:[137]146
144 [153][200](cr$,25)ec$;
146 [139]cv(uc)[178]12[175]yc[167][141]182
148 [139]cv(uc)[178]11[167][141]196
150 [139]cv(uc)[178]10[175]yc[167][141]202
152 [139]sk[178]1[175]yc[177]0[175]mc[179]18[175]dp[179]100[167]116
154 [142]
156 [153][200](cr$,7),"clrlenhoose another cardwait":[141]322
158 [129]l[178]0[164]999:[130]:[137]116
160 :: card ::
162 [129]l[178]mv[164]yc[170]1:yc(l)[178]yc(l[170]1):[130]:[137]170
164 [129]l[178]1[164]yc[171]1:[129]k[178]l[170]1[164]yc
166 [139]cv(yc(l))[179]cv(yc(k))[167]t[178]yc(l):yc(l)[178]yc(k):yc(k)[178]t
168 [130]:[130]
170 t[178]0:[129]l[178]1[164]yc
172 [139]l[179]19[167][153][200](cr$,21)[163](l[171]1)[172]2)cl$(t)[170]cc$(yc(l))[170]cd$(yc(l));
174 t[178]1:[130]:[139]yc[179]18[167][153]ee$;
176 [139]yc[178]19[167][153][200](cr$,15)[163]34)cc$(yc(19))[170]cd$(yc(19));
178 [142]
180 :: wild ::
182 [151]sp,0:t[178]0:[153][200](cr$,7)[163]13)"clrlenhoose a colorwait":[141]310
184 [161]g$:js[178][194](56320)[175]31:[139]g$[178]""[175]js[178]31[167]184
186 [139](g$[178][199](13)[176]js[178]15)[175]t[177]0[167][153]"clr"el$:[137]192
188 t[178]t[170]1[170](t[178]4)[172]4:t$[178][202]("defcontsys",t,1):wc$[178]t$:[153][200](cr$,15)[163]21)t$cd$(uc)
190 cc$(uc)[178]t$:[141]310:[137]184
192 [146]56320,16:[146]197,64:[142]
194 :: draw2 ::
196 [153][200](cr$,7)[163]12)"clrright$ take two cardswait":[141]310:[129]s[178]0[164]999:[130]
198 [129]j[178]1[164]2:[139]dp[179]100[167]mc[178]mc[170]1:mc(mc)[178]dk(dp):dp[178]dp[170]1:[141]262:[130]
200 [143]:: skip ::
202 [139]yc[178]0[176]mc[177]17[176]dp[177]99[167]206
204 [153][200](cr$,7),"clr(NULL)ou get another turnwait":[141]310:[129]s[178]0[164]999:[130]
206 sk[178][171](dp[179]100):[142]
208 :: computer ::
210 [153][200](cr$,7)[163]14)"forright$t's my turnwait":[141]316:[129]s[178]0[164]999:[130]
212 sk[178]0:mv[178]1:t[178]1
214 [129]l[178]1[164]mc:[139]cv(mc(l))[179]10[167]224
216 [139]cv(mc(l))[179][177]cv(uc)[175]cc$(mc(l))[179][177]cc$(uc)[176]cv(mc(l))[178]12[167]222
218 [129]k[178]l[170]1[164]mc:[139]cc$(mc(k))[178]cc$(mc(l))[176]cv(mc(k))[178]cv(mc(l))[167]mv[178]l:[137]236
220 [130]
222 t[178]l[170]1:[130]:[139]yc[179]3[167]t[178]1
224 [129]l[178]t[164]mc:[139]cv(mc(l))[178]cv(uc)[175]cv(mc(l))[179][177]12[175]mc(l)[167]mv[178]l:[137]236
226 [139]cc$(mc(l))[178]cc$(uc)[167]mv[178]l:[137]236
228 [130]:[139]t[179][177]1[167]t[178]1:[137]224
230 [139]cv(mc(1))[178]12[167]mv[178]1:[137]236
232 [153][200](cr$,7)[163]11)"for right$'ll draw a card wait":[141]316:[129]s[178]0[164]999:[130]
234 mc[178]mc[170]1:mc(mc)[178]dk(dp):dp[178]dp[170]1:[141]262:[142]
236 [153][200](cr$,7)[163]11)"for right$'ll play a card wait":[141]316:[129]s[178]0[164]999:[130]
238 [139]yc[178]1[175]cv(mc(1))[178]12[167]mv[178]1
240 [153][200](cr$,15)[163]21)""[170]cd$(mc(mv));
242 [153][200](cr$,15)[163]21)cc$(mc(mv))[170]cd$(mc(mv));
244 uc[178]mc(mv):mc[178]mc[171]1:[139]mc[167][141]260:[137]248
246 [153][200](cr$,13)ec$
248 [139]cv(uc)[178]12[175]mc[167][141]274
250 [139]cv(uc)[178]11[167][141]286
252 [139]cv(uc)[178]10[175]yc[167][141]292
254 [139]sk[178]1[175]mc[177]0[175]yc[179]18[175]dp[179]100[167]212
256 [142]
258 :: card ::
260 [129]l[178]mv[164]mc[170]1:mc(l)[178]mc(l[170]1):[130]:[137]268
262 [129]l[178]1[164]mc[171]1:[129]k[178]l[170]1[164]mc
264 [139]cv(mc(l))[179]cv(mc(k))[167]t[178]mc(l):mc(l)[178]mc(k):mc(k)[178]t
266 [130]:[130]
268 [139]mc[179]19[167][153][200](cr$,9)[163](mc[171]1)[172]2)bk$;:[139]mc[179]18[167][153]ee$;
270 [142]
272 :: wild ::
274 t1[178]0:t$[178]"":[129]l[178]1[164]4:t[178]0:[129]k[178]1[164]mc
276 [139]cc$(mc(k))[178][202]("defcontsys",l,1)[167]t[178]t[170]1
278 [130]:[139]t[177]t1[167]t1[178]t:t$[178][202]("defcontsys",l,1)
280 [130]:[139]t$[178]""[167]t$[178][202]("defcontsys",[181]([187](1)[172]4[170]1),1)
282 [153][200](cr$,15)[163]21)t$[170]cd$(uc):cc$(uc)[178]t$:[142]
284 :: draw2 ::
286 [153][200](cr$,7)[163]11)"for(NULL)ou take two cardswait":[141]316:[129]s[178]0[164]999:[130]
288 [129]j[178]1[164]2:[139]dp[179]100[167]yc[178]yc[170]1:yc(yc)[178]dk(dp):dp[178]dp[170]1:[141]164:[130]
290 [143]:: skip ::
292 [139]mc[178]0[176]yc[177]17[176]dp[177]99[167]296
294 [153][200](cr$,7)[163]11)"forright$ get another turnwait":[141]316:[129]s[178]0[164]999:[130]
296 sk[178][171](dp[179]100):[142]
298 :: [128] deck ::
300 [153][200](cr$,19)[163]14)ec$:[153][200](cr$,7)"open"el$
302 [153][200](cr$,7)[163]7)"(NULL)o more cards, hand dumped"
304 [129]l[178]1[164]6:[141]316:[141]310:[130]
306 [141]416:[142]
308 :: beep ::
310 [151]sr,240:[151]wv,17:[151]hf,50:[151]lf,35:[151]at,0
312 [129]s[178]1[164]99:[130]:[151]wv,16:[151]sr,0:[142]
314 :: boop ::
316 [151]vl,15:[151]at,0:[151]sr,225:[151]wv,17:[151]hf,33:[151]lf,33
318 [129]s[178]1[164]99:[130]:[151]wv,16:[142]
320 :: buzz ::
322 [151]hf,5:[151]at,0:[151]sr,240:[151]wv,33
324 [129]s[178]1[164]500:[130]:[151]wv,32:[142]
326 ::