home *** CD-ROM | disk | FTP | other *** search
- 1 REM FIFTEEN PUZZLE BY W.L.COLSHER
- 30 POKE53281,13:POKE53280,2:PRINT"ôÉ FIFTEEN PUZZLE."
- 40 PRINT" ╕╕╕╕╕╕╕╕╕╕╕╕╕╕╕"
- 50 PRINT" **DO YOU NEED INSTRUCTIONS?"
- 60 PRINT" PRESS 'Y', OR ANY OTHER KEY FOR NO."
- 70 GETA$:IFA$=""THEN70
- 80 IFA$="Y"THENGOSUB1310
- 100 DIMA(20):M=0:S=54272:PRINT"ô"
- 110 A$=" ╒├├├├▓├├├├▓├├├├▓├├├├╔"
- 130 B$=" ½└└└└█└└└└█└└└└█└└└└│"
- 150 C$=" ┬ ááá▌áááá▌áááá▌áááá┬"
- 170 D$=" ╩├├├├▒├├├├▒├├├├▒├├├├╦"
- 190 PRINTA$:FORI=1TO3
- 200 PRINTC$:PRINTC$:PRINTB$:NEXTI
- 210 PRINTC$:PRINTC$:PRINTD$:IFQ=1THENRETURN
- 220 PRINT"**WAIT PLEASE"
- 230 FORX=1TO16:A(X)=0:NEXT
- 240 FORI=1TO16
- 250 X=INT(16*RND(RND(0)))+1:IFA(X)THEN250
- 260 A(X)=I:NEXT
- 270 GOSUB510:TI$="000000":IFF=0THEN230
- 280 PRINT:GOSUB610:PRINT:PRINT" "
- 290 PRINT"æ *YOUR MOVE";:X$="":X1$=""
- 300 GETX$:IFX$=""THEN300
- 310 IFX$="_"THENX=1:GOTO350
- 320 IFX$<>"1"GOTO340
- 330 GETX1$:IFX1$=""GOTO330
- 340 X$=X$+X1$:X=VAL(X$)
- 350 PRINTX:GOSUB410:GOSUB710:IFF THEN370
- 360 PRINT" *ILLEGAL MOVE,RE-ENTER":GOTO280
- 370 A(X+F)=A(X):A(X)=16:GOTO910
- 380 M=M+1:GOTO280
- 390 REM
- 400 REM
- 410 FORI=1TO16:IFA(I)=XTHEN430
- 420 NEXT
- 430 X=I:RETURN
- 440 :
- 510 F=0:SU=0:FORI=1TO15:FORJ=I+1TO16
- 520 IFA(I)>A(J)THENSU=SU+1
- 530 NEXTJ:NEXTI:RESTORE
- 540 FORI=1TO8:READX:IFA(X)=16THENSU=SU+1
- 550 NEXTI
- 560 A=INT(SU/2):IFA*2=SUTHENF=1
- 570 RETURN
- 580 DATA2,4,5,7,10,12,13,16
- 590 REM
- 600 REM GAME BOARD
- 610 PRINT"":PRINT:FORI=1TO4:PRINT
- 2412
- 630 IFN<10THENPRINT" ";
- 640 IFN=16THENN$=" "
- 650 PRINTN$;SPC(1);
- 660 NEXTJ:PRINT:PRINT
- 670 NEXTI
- 680 PRINT:RETURN
- 710 F=0:IFX>16THENRETURN
- 720 IF(X=4ORX=8ORX=12)ANDA(X+1)=16THENRETURN
- 730 IF(X=5ORX=9ORX=13)ANDA(X-1)=16THENRETURN
- 740 IFX+1>16THEN760
- 750 IFA(X+1)=16THENF=1
- 760 IFX-1<=0THEN780
- 770 IFA(X-1)=16THENF=-1
- 780 IFX+4>16THEN800
- 790 IFA(X+4)=16THENF=4
- 800 IFX-4<0THEN820
- 810 IFA(X-4)=16THENF=-4
- 820 IFF THEN PRINT" "
- 830 RETURN
- 910 FORI=1TO16
- 920 IFA(I)<>ITHEN380
- 930 NEXT
- 940 GOSUB610:T$=TI$
- 950 GOSUB1110:PRINT"ô *CONGRATULATIONS!!!"
- 960 PRINT" YOU DID IT IN ONLY"M"MOVES!!"
-