home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Brotikasten
/
BROTCD01.iso
/
c128
/
c137.d64
/
alphabet
(
.txt
)
next >
Wrap
Commodore BASIC
|
1995-08-09
|
4KB
|
134 lines
100 REM ALPHABET SHUFFLE
105 REM BY CHARLES PHOENIX (01/89)
110 REM
112 GOTO450:REM GOTO SETUP
114 REM
135 PRINTLEFT$(DN$,23);:REM PRINT PROMPT AND WAIT FOR FIRE
140 PRINT" PRESS FIRE BUTTON TO CONTINUE."
145 IF(PEEK(JY)AND16)/16THEN145
150 RETURN
155 REM
170 PRINTLEFT$(DN$,VP+TX*4-4):REM PRINT LETTER AT (X,Y)
175 IFA$=""ORA$=" "THENPOKE646,0:GOTO185
180 POKE646,2+(ASC(A$)-65)/GN
185 PRINTSPC(HP+TY*4-3);" [157][157][157] ";RIGHT$(" "+A$,1);" [157][157][157] [146]"
190 RETURN
195 REM
210 M=0:TI$="000000":REM *** MAIN LOOP
215 X=GN:Y=GN
220 OX=X:OY=Y
225 REM
230 PRINT"[158] MOVES = ";M
235 PRINT"[158]TIME = ";MID$(TI$,3,2);":";RIGHT$(TI$,2)
240 REM
245 IF(PEEK(JY)AND16)/16=0THEN385
250 REM
255 JD=NOTPEEK(JY)AND15
260 IFJD=1ORJD=2THENX=X-(JD=1)+(JD=2):IFX>0ANDX<=GNTHEN280
265 IFJD=4ORJD=8THENY=Y-(JD=4)+(JD=8):IFY>0ANDY<=GNTHEN280
270 X=OX:Y=OY:GOTO230
275 REM
280 M=M+1:REM INCREASE # OF MOVES
285 REM
300 TX=X:TY=Y:A$=" ":GOSUB170:REM SWAP NEW SQUARE WITH OLD SQUARE
305 TX=OX:TY=OY:A$=PG$(X,Y):GOSUB170
310 PG$(OX,OY)=PG$(X,Y):PG$(X,Y)=" "
315 REM
330 C=GN*GN:REM CHECK FOR WINNER
335 FORI=1TOGN
340 : FORJ=1TOGN
345 : IFPG$(I,J)=CG$(I,J)THENC=C-1
350 : NEXT
355 NEXT:IFCTHEN220
365 REM
380 PRINT"[147]CONGRATULATIONS....YOU'VE DONE IT":GOTO390:REM END PRG
385 PRINT"[147]GIVING UP......TSK, TSK"
390 PRINT" THE CURRENT GAME TIME IS....: ";
395 PRINT"[158]";MID$(TI$,3,2);":";RIGHT$(TI$,2)
400 PRINT" THE CURRENT # OF MOVES IS...:[158]";M
405 REM
410 FORI=1TO500:NEXT:REM SMALL DELAY
415 GOSUB135:REM WAIT FOR FIRE BUTTON
420 GOTO480:REM GOTO SETUP
425 REM
445 REM
450 DIM CG$(5,5),PG$(5,5):REM INITIALIZE
455 JY=56320:REM FOR JOYSTICK #1 CHANGE 56320 TO 56321
460 DN$=""
465 REM
480 POKE53280,0:POKE53281,0:REM TITLE SCREEN
485 PRINT"[147] THE ALPHABET SHUFFLE"
490 PRINT"[158] [183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183]
495 [153]" 1) SYSBEGINNER GAME........ 3 BY 3 GRID
500 PRINT" 2) [158]INTERMEDIATE GAME.... 4 BY 4 GRID
505 [153]" 3) SYSEXPERT GAME.......... 5 BY 5 GRID
510 PRINT" MOVE JOYSTICK (UP/DOWN) TO SELECT GAME
515 [153]" PRESS FIRE BUTTON TO ENTER
520 GN=3:GOSUB600:REM SELECT GAME W/JOYSTICK
525 REM
540 IF(PEEK(JY)AND16)/16=0THEN650
545 JD=NOTPEEK(JY)AND15
550 IFJD<>1ANDJD<>2THEN540
555 GOSUB580:GOTO540
575 REM
580 PRINT"[144]";:GOSUB610
585 GN=GN+(JD=1)-(JD=2)
590 IFGN<3THENGN=5
595 IFGN>5THENGN=3
600 PRINT"[158]";
605 REM
610 PRINTLEFT$(DN$,5+(GN-2)*3);
615 PRINT" [213][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][201]
620 [153]" (null)(null)
625 PRINT" [202][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][203]
630 [142]
635 [143]
650 [153]"LOAD INSTRUCTIONS FOR ALPHABET SHUFFLE":[143] INSTRUCTION SCREEN
655 [153]"SYS USRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSR
660 PRINT" THE OBJECT OF THIS GAME IS QUITE
665 [153]" SIMPLE. JUST REARRANGE THE LETTERS
670 PRINT" INTO [158]ALPHABETICAL ORDER.
675 [153]" TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(
680 PRINT" WHEN THE GAME IS COMPLETED EACH
685 [153]" ROW WILL BE THE SAME COLOR.
690 PRINT" TO QUIT PLAYING AND TRY AGAIN
695 [153]" PRESS THE FIRE BUTTON
700 PRINT"[158] PLEASE WAIT.....SETTING UP
705 [143]
720 [129]I[178]1[164]GN:[143] SETUP WINNING GRID
725 : [129]J[178]1[164]GN
730 : CG$(I,J)[178][199](65[170](I[171]1)[172]GN[170](J[171]1))
735 : PG$(I,J)[178]" "
740 : [130]
745 [130]:CG$(GN,GN)[178]" "
755 [143]
770 [129]I[178]65[164]63[170]GN[172]GN:[143] SETUP PLAYING GRID
775 : X[178][181]([187](1)[172](GN[171]1)[170]1.5)
780 : Y[178][181]([187](1)[172](GN[171]1)[170]1.5)
785 : [139]X[172]Y[178]GN[172]GN[167]775
790 : [139]PG$(X,Y)[179][177]" "[167]775
795 : PG$(X,Y)[178][199](I)
800 [130]
820 [141]135:[143] WAIT FOR FIRE BUTTON
825 [143]
830 HP[178]((38[171]GN[172]4)[173]2):VP[178]((26[171]GN[172]4)[173]2)
840 [143]
845 [153]"LOADSYS";[200](DN$,VP);:[143] PRINT FINISHED GRID
850 [153][166]HP);"OR";[201]("TANTANTAN=TANTANTAN=TANTANTAN=TANTANTAN=TANTANTAN^",4[172]GN)
855 [129]I[178]1[164]GN
860 : [129]J[178]1[164]3
865 : [153][166]HP);"(null)";[201](" (null) (null) (null) (null) (null)",4[172]GN)
870 : [130]
875 : [153][166]HP);"-";[201]("TANTANTAN(null)TANTANTAN(null)TANTANTAN(null)TANTANTAN(null)TANTANTAN<",4[172]GN)
880 [130]
885 [153]"ON";[166]HP);"/";[201]("TANTANTAN>TANTANTAN>TANTANTAN>TANTANTAN>TANTANTANEXP",4[172]GN)
890 [143]
905 [129]TX[178]1[164]GN:[143] PRINT GRID LETTERS
910 : [129]TY[178]1[164]GN
915 : A$[178]PG$(TX,TY)
920 : [141]170
925 : [130]
930 [130]
935 [143]
940 [137]210:[143] GOTO MAIN LOOP