home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
genie-commodore-file-library
/
C64Software
/
SORTANOES
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2019-04-13
|
7KB
|
201 lines
0 REM ORIGINAL PROGRAM BY T. HARTNELL WRITTEN AROUND 1978
1 REM GRAPHICS, SOUND, COLOR, TITLE, ETC BY JIM GREEN 1986
5 REM PUBLIC DOMAIN DISK # MB2CG
20 POKE53265,11: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][151]"
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" SORTA' LIKE DOMINOS BUT NOT QUITE!
98 [153]" INSTRUCTIONS- [Y]EP OR [N]OPE":[151]53265,27
100 [161]G$:[139]G$[179][177]"Y"[175]G$[179][177]"N"[167]100
102 [139]G$[178]"N"[167]204
110 [129]T[178]1[164]36:[153]:[130]:[153]"LOAD";
115 [153]" DEFORSTOP:(null):WAIT :(null):WAIT :(null):WAIT OPEN:(null):WAIT CLR:(null):WAIT :(null):WAIT :(null):WAIT FOR:(null):WAIT CONT:(null):WAITDEF^"
116 [153]"DEF (null) - (null) O R T A N O S - DEF(null)
117 PRINT" [150][173][144]:[221]:[146] :[221]:[146] :[221]:[146] [159]:[221]:[146] [156]:[221]:[146] :[221]:[146] :[221]:[146] [129]:[221]:[146] [154]:[221]:[146][150][189]"
118 FORD=1TO1E3:NEXT
120 PRINT"[145][145][179]";:GOSUB1500;:PRINT"[157][157][176]";:GOSUB1500:PRINT"[157][221]";:GOSUB1500
122 PRINT"[157][221]";:GOSUB1500:PRINT"[157][173]";:FORT=1TO10:PRINT"[192]";:GOSUB1500:NEXT
124 :PRINT"> [201]NSTRUCTIONS"
130 PRINT"[151][212]HIS GAME IS PLAYED WITH THE COMPUTER.
132 [153]"VALACH '(null)ORTANOS' IS A PAIR OF NUMBERS
134 PRINT"SUCH AS, 63 OR 30. [212]HEY ARE READ AS IF
136 [153]"THEY WERE DOMINO TILES 'SIX/THREE' AND
138 PRINT"'THREE/BLANK'. [217]OU AND THE COMPUTER ARE
140 [153]"DEALT SEVEN TILES EACH. (null)HE REST GO TO
142 PRINT"THE 'BONEYARD'. [193]FTER THE FIRST TILE IS
144 [153]"PLAYED YOU MUST RESPOND BY PLACING YOUR
146 PRINT"[211][207][210][212][193][206][207][211] NEXT TO IT WITH A NUMBER WHICH
148 [153]"CORRESPONDS TO ONE OF THE NUMBERS OF THE";
150 [153]"TILE ALREADY IN PLACE. ASCOR EXAMPLE, IF
152 PRINT"THE COMPUTER HAD PLAYED 63 YOU COULD
154 [153]"PLAY 46 OR 34 (OR ANY COMBINATION)
156 PRINT"WHICH INCLUDED A 6) TO THE LEFT OF THE
158 [153]"COMPUTER'S PIECE, OR A PIECE WHICH
160 PRINT"INCLUDED A 3 (SUCH AS 38 OR 03) TO THE
162 [153]"RIGHT OF THE COMPUTER'S PIECE.
164 PRINT" [208]RESS <[211][208][193][195][197]>[160]FOR MORE
166 [161]G$:[139]G$[179][177]" "[167]166
168 [151]53265,11:[153]"LOAD(null)OTICE THAT THE PROGRAM AUTOMATICALLY
170 PRINT"'FLIPS' YOUR PIECE AROUND SO THAT THE
172 [153]"SAME TWO NUMBERS ARE TOGETHER. VALXAMPLE -";
174 [153]" 37:43:62:04WAIT. (null)OU WILL NEED A TILE WITH
176 PRINT"A 3 OR 4 IN IT - 32[146] OR 74[146] WILL WORK.
178 [153]"RIGHT$F YOU PUT 32WAIT AT THE START, THE TILES
180 PRINT"WOULD LOOK LIKE THIS 23:37:43:62:04[146]
182 [153]"RIGHT$F YOU PUT THE 74WAIT AT THE END IT WOULD
184 PRINT"REVERSE AND BECOME 47[146].
186 [153]"CHR$AME ENDS WHEN ONE OF THE PLAYERS GETS
187 PRINT"RID OF ALL HIS TILES, OR WHEN NEITHER
188 [153]"PLAYER CAN MOVE - NOTE THAT YOU MUST
189 PRINT"ENTER '0' WHEN YOU CANNOT MOVE AND MUST
190 [153]"GO TO THE 'BONEYARD' FOR A TILE.
191 PRINT"[212]HE VALUE OF EACH NUMBER ON THE TILES
192 [153]"YOU HAVE AT THE END OF THE GAME IS
193 PRINT"TOTALED (NOTE THAT 35[146] COUNTS AS 3+5 NOT
194 [153]"35). (null)HE LOWEST SCORE WINS. (null)HERE ARE 5
195 PRINT"GAMES IN EACH ROUND AND THE WINNER IS
196 [153]"THE ONE WHO WINS MOST OF THE GAMES.
197 PRINT" [208]RESS <[211][208][193][195][197]> TO PLAY":POKE53265,27
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 [201]'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]""[167][153][166]17)G"- "H$(G):[137]860
850 [139]H$(G)[179][177]""[167][153][166]27)G"- "H$(G)
860 [130]:[158]P,17,0:[153]L$
870 [158]P,19,1:[153]"VALNTER THE NUMBER OF THE PIECE YOU WANT
880 INPUT" TO PLAY OR '0' TO GO TO BONEYARD";M
890 IFM<0ORM>14THEN870
900 IFM=0THENGOSUB1410:GOTO1050: REM PASS
910 IFH$(M)=""THEN 870
920 GOSUB1380:PRINT"[158] [193]T THE START [151]([211]) [158]OR END [151]([197]) [211]/[197]
930 [161]A$:[139]A$[179][177]"S"[175]A$[179][177]"E"[167] 930
940 [153]"ON (null)UT "H$(M)" AT THE ";
950 [139]A$[178]"S"[167][153]"START "
960 [139]A$[178]"E"[167][153]"END "
970 [139]A$[178]"E"[167]1010
980 [139][201](H$(M),1)[178][200](P$,1)[167]P$[178]H$(M)[170]":"[170]P$:[137]1040
990 [139][200](H$(M),1)[179][177][200](P$,1)[167]1360
1000 P$[178][201](H$(M),1)[170][200](H$(M),1)[170]":"[170]P$:[137]1040
1010 [139][200](H$(M),1)[178][201](P$,1)[167]P$[178]P$[170]":"[170]H$(M):[137]1040
1020 [139][201](H$(M),1)[179][177][201](P$,1)[167]1360
1030 P$[178]P$[170]":"[170][201](H$(M),1)[170][200](H$(M),1)
1040 H$(M)[178]"":[142]
1050 X[178]0
1060 X[178]X[170]1:[139]H$(X)[178]""[167]1080
1070 [139]X[179]14[167]1060
1080 Y[178]14
1090 Y[178]Y[170]1:[139]D$(Y)[179][177]""[167]1120
1100 [139]Y[179]28[167]1090
1110 [153]" (null)O TILES LEFT IN BONEYARD":NT[178]NT[170]1:[142]
1120 H$(X)[178]D$(Y):D$(Y)[178]""
1130 [153]"CLR (null)OU HAVE DRAWN :"H$(X)":":[141]1260:[142]
1140 CL[178]0:[129]J[178]1[164]14:[139]C$(J)[178]""[167]CL[178]CL[170]1
1150 [130]:[142]
1160 HL[178]0:[129]J[178]1[164]14:[139]H$(J)[178]""[167]HL[178]HL[170]1
1170 [130]:[142]
1180 [153]"":[139]MF[178]9[167]1210
1190 [153]"":[139]MF[178]1[167][153]" ATNFTER MY MOVE, THIS IS THE BOARD:":[137]1220
1200 [153]" ATNFTER YOUR MOVE, THIS IS THE BOARD:":[137]1220
1210 [153]" (null)HIS IS THE BOARD: "
1220 [141]1380:[153]L$:[139][195](P$)[178][177]39[167]1240
1230 [158]P,3,1:[129]T[178]1[164][195](P$):[153]"AND";:[130]
1240 [158]P,4,1
1250 [153]""[202](P$,1,38):[153]" "[202](P$,40,38):[153]" SYS"[202](P$,79,38)"POKE"
1260 [129]Q[178]1[164]3E3:[130]:[142]
1270 X[178][187]([171]TI):[134]D$(28),H$(14),C$(14):[153]"LOADPOKE (null)TAND BY TO PLAY!
1280 X=0:FORJ=0TO6:FORK=0TOJ:X=X+1:D$(X)=RIGHT$(STR$(J),1)+RIGHT$(STR$(K),1)
1290 NEXT:NEXT:PRINT:PRINT:FORJ=28TO1STEP-1:T=INT(RND(1)*J)+1
1300 H$=D$(T):D$(T)=D$(J):D$(J)=H$:NEXT:FORJ=1TO7:H$(J)=D$(J):D$(J)=""
1310 C$(J)=D$(J+7):D$(J+7)="":NEXT
1320 P$="":HG=0:CG=0:RETURN
1330 FORD=1TO1E3:NEXT:RETURN
1340 FORT=PUTO24:IFT=17THENNEXT
1350 POKE781,T:SYS59903:NEXT:RETURN
1360 FORD=1TO1E3:NEXT:PRINT"[145] [217]OU [195][193][206]'[212] DO THAT!! "
1370 GOSUB1410:GOSUB1410:GOTO 870
1380 S=54272:POKES+24,15:POKES+5,1:POKES+6,248:POKES+1,30:POKES,244:POKES+4,17
1390 FORT=1TO200:NEXT:POKE54276,16
1400 FORT=STOS+23:POKET,0:NEXT:RETURN
1410 S=54272:POKES+24,9:POKES+4,8:POKES+5,1:POKES+6,248:FORNO=48TO6STEP-5
1420 POKES+1,NO:POKES,47:POKES+4,33
1430 FORT=1TO15:NEXTT:NEXTNO
1440 FORT=1TO100:NEXT:POKES+4,32:RETURN
1500 FORD=1TO100:NEXT:RETURN