home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1994 October
/
1994-10b.d64
/
sortanos
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
7KB
|
199 lines
10 rem public domain disk # cc2bg
20 p=828:forj=828to843:readx:pokej,x:next
30 data 32,155,183,138,72,32,155,183,104,170,164,101,24,76,240,255
40 l$="[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][146][152]"
50 poke53280,7:poke53281, 7:print"[147][142]";
60 print"[176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]";
62 forj=1to3:print"[221]";:fort=1to8:poke646,cd:print":[221]:[146] ";
63 cd=cd+1:ifcd=7thencd=8
64 ifcd=9thencd=0
65 next:print"[157][157][221]";:print"[221]"spc(38)"[221]";:next:goto80
80 print"[221] [150][209] [146][208] [146][208] [146][208] [207] [146][208] [146][208] [146][208] [146][208] [146][208] [150][209] [221]";
82 print"[221] [215] [150][223] [223][146] [146][167] [150] [146][186] [150] [146] [146][186] [150] [146][167] [150] [146][167] [150][223] [223][146] [215] [221]";
84 print"[221] [150][209] [204] [146] [146][186] [146][205] [146] [146][167] [146][167] [146][186] [204] [146] [150][209] [221]";
88 forj=1to3:print"[221]"spc(38)"[221]";
90 print"[221]";:fort=1to8:poke646,cd:print":[221]:[146] ";
91 cd=cd+1:ifcd=7thencd=8
92 ifcd=9thencd=0
93 next: print"[157][157][221]";:next
94 print"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
96 print"[150] sorta' like dominos but not quite!
98 [153]" instructions- [y]ep or [n]ope
100 getg$:ifg$<>"y"andg$<>"n"then100
102 ifg$="n"then204
110 fort=1to36:print:next:print"[147]";
115 print" [150][176][144]:[221]:[146] :[221]:[146] :[221]:[146] [159]:[221]:[146] [156]:[221]:[146] :[221]:[146] :[221]:[146] [129]:[221]:[146] [154]:[221]:[146][150][174]"
116 print"[150] [221] - [211] o r t a n o s - [150][221]
117 [153]" def/stop:(NULL):wait :(NULL):wait :(NULL):wait open:(NULL):wait clr:(NULL):wait :(NULL):wait :(NULL):wait for:(NULL):wait cont:(NULL):waitdefexp"
118 [129]d[178]1[164]1e3:[130]
120 [153]"onon<";:[141]1500;:[153]"cmdcmdor";:[141]1500:[153]"cmd(NULL)";:[141]1500
122 [153]"cmd(NULL)";:[141]1500:[153]"cmd/";:[129]t[178]1[164]10:[153]"tan";:[141]1500:[130]
124 :[153]"> right$nstructions"
130 [153]"poke(NULL)his game is played with the computer.
132 print"[197]ach '[211]ortanos' is a pair of numbers
134 [153]"such as, 63 or 30. (NULL)hey are read as if
136 print"they were domino tiles 'six/three' and
138 [153]"'three/blank'. (NULL)ou and the computer are
140 print"dealt seven tiles each. [212]he rest go to
142 [153]"the 'boneyard'. atnfter the first tile is
144 print"played you must respond by placing your
146 [153]"(NULL)(NULL)(NULL)(NULL)atn(NULL)(NULL)(NULL) next to it with a number which
148 print"corresponds to one of the numbers of the";
150 print"tile already in place. [198]or example, if
152 [153]"the computer had played 63 you could
154 print"play 46 or 34 (or any combination)
156 [153]"which included a 6) to the left of the
158 print"computer's piece, or a piece which
160 [153]"included a 3 (such as 38 or 03) to the
162 print"right of the computer's piece.
164 [153]" (NULL)ress <(NULL)(NULL)atnlenval>closefor more
166 getg$:ifg$<>" "then166
168 print"[147][206]otice that the program automatically
170 [153]"'flips' your piece around so that the
172 print"same two numbers are together. [197]xample -";
174 print" 37:43:62:04[146]. [217]ou will need a tile with
176 [153]"a 3 or 4 in it - 32wait or 74wait will work.
178 print"[201]f you put 32[146] at the start, the tiles
180 [153]"would look like this 23:37:43:62:04wait
182 print"[201]f you put the 74[146] at the end it would
184 [153]"reverse and become 47wait.
186 print"[199]ame ends when one of the players gets
187 [153]"rid of all his tiles, or when neither
188 print"player can move - note that you must
189 [153]"enter '0' when you cannot move and must
190 print"go to the 'boneyard' for a tile.
191 [153]"(NULL)he value of each number on the tiles
192 print"you have at the end of the game is
193 [153]"totaled (note that 35wait counts a 3+5 not
194 print"35). [212]he lowest score wins. [212]here are 5
195 [153]"games in each round and the winner is
196 print"the one who wins most of the games.
197 [153]" (NULL)ress <(NULL)(NULL)atnlenval> to play
202 getg$:ifg$<>" "then202
204 poke53280,5:poke53281,15:gosub1270
210 nt=0:tf=0:gosub1140:ifcl=14thengosub1340:goto300
220 gosub530:ifnt=1then260
230 iftf=0then270
240 sysp,8,3:print"[201]'ll take a tile from the boneyard":gosub1410
250 ford=1to2e3:next:gosub1340
260 mf=9
270 gosub1180:gosub1160:ifhl=14then300
280 gosub780:gosub1180:ifnt=2then300: rem end
290 goto210
300 pu=7:gosub1340:sysp,8,13:print"[197]nd of [199]ame ":print:gosub1260:gosub1340
310 mf=9:gosub1180:cs=0:hs=0:print" [205]y tiles: ":print"";
320 forj=1to14:printc$(j)":";:next
330 print:print" [217]our tiles:":print"";
340 forj=1to14:printh$(j)":";:next:print:print:forj=1to14
350 ifc$(j)<>""thencs=cs+val(right$(c$(j),1))+val(left$(c$(j),1))
360 ifh$(j)<>""thenhs=hs+val(right$(h$(j),1))+val(left$(h$(j),1))
370 h$(j)="":c$(j)=""
380 next:print" [193]t the end of that game, your score
390 [153]" is"hs"and mine is"cs:[153]""[163]8);
400 [139]cs[178]hs[167][153]" right$t's a draw
410 ifcs<hsthenprint" [211]o i'm the winner":cg=cg+1
420 ifhs<csthenprint"[211]o you're the winner":hg=hg+1
430 print"[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]";
440 print" "cg"games to me,"hg"games to you":ifcg+hg<5then490
450 print" [212]hat's five games we've played
460 [139]cg[177]hg[167][153][163]7)"and i'm the overall winner"
470 [139]cg[179]hg[167][153][163]5)"and you're the overall winner"
480 [137]520
490 [153]" valnter '(NULL)' for a new game, '(NULL)' to end"
500 [161]a$:[139]a$[179][177]"y"[175]a$[179][177]"n"[167]500
510 [139]a$[178]"y"[167][153]"load":[141]1280:[137]210
520 [153]" (NULL)(NULL), thanks for the games":[128]
530 mf[178]1:[139]p$[178]""[167]680:[143] 1st move
540 [158]p,8,2:[153]"peekefore this move right$ have"14[171]cl"tiles...":[141]1380:[141]1260
550 x[178]0:fl[178]0
560 pu[178]10:[141]1340:x[178]x[170]1:[139][200](c$(x),1)[178][200](p$,1)[167]fl[178]1:[141]730:[142]
570 [139][201](c$(x),1)[178][200](p$,1)[167]fl[178]2:[141]730:[142]
580 [139][200](c$(x),1)[178][201](p$,1)[167]fl[178]3:[141]730:[142]
590 [139][201](c$(x),1)[178][201](p$,1)[167]fl[178]4:[141]730:[142]
600 [139]x[179]14[167]560
610 [158]p,8,2:[153]" right$ cannot move... ":[141]1410:[141]1260
620 x[178]x[170]1:[139]d$(x)[178]""[167]660
630 y[178]0
640 y[178]y[170]1:[139]c$(y)[178]""[167]c$(y)[178]d$(x):d$(x)[178]"":tf[178]1:[142]
650 [139]y[179]14[167]640
660 [139]x[179]28[167]620
670 [158]p,8,2:[153]"(NULL)here are no tiles left in boneyard":[141]1260:nt[178]nt[170]1:[142]
680 x[178]0
690 x[178]x[170]1:[139][200](c$(x),1)[178][201](c$(x),1)[167]720: [143] double found
700 [139]x[179]7[167]690
710 x[178][181]([187](1)[172]7)[170]1
720 p$[178]c$(x):c$(x)[178]"":[142]
730 [139]fl[178]1[167]p$[178][201](c$(x),1)[170][200](c$(x),1)[170]":"[170]p$
740 [139]fl[178]2[167]p$[178]c$(x)[170]":"[170]p$
750 [139]fl[178]3[167]p$[178]p$[170]":"[170]c$(x)
760 [139]fl[178]4[167]p$[178]p$[170]":"[170][201](c$(x),1)[170][200](c$(x),1)
770 c$(x)[178]"":[142]
780 mf[178]2:[158]p,8,2:[153]"left$ere is your hand - ":[153]l$:[141]1380
790 [129]g[178]1[164]14:[139]g[178]6[167][158]p,11,0
800 [139]g[177]5[175]g[179]11[167]840
810 [139]g[178]11[167][158]p,11,0
820 [139]g[177]10[167]850
830 [139]h$(g)[179][177]""[167][153][166]7)g"- "h$(g):[137]860
840 [139]h$(g)[179][177]""[1