start tok64 d64-ejxplD 100 REM alphabet shuffle by charles phoenix (01/89) 110 REM 112 GOTO450:REM goto setup 114 REM 115 REM 135 PRINTLEFT$(dn$,23);:REM print prompt and wait for fire 140 PRINT"{white}{space*5}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)"{reverse on}{space*3}{left*3}{down} "RIGHT$(" "+a$,1)" {left*3}{down}{space*3}{reverse off}" 190 RETURN 195 REM 210 m=0:ti$="{0*6}":REM***main loop 215 x=gn:y=gn 220 ox=x:oy=y 225 REM 230 PRINT"{home}{yellow}{space*3}moves = {white}"m 235 PRINT"{home}{yellow}{right*24}time = {white}"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"{white}{clear}{down*7}{right*4}congratulations{.*3}you've done it":GOTO390:REM end prg 385 PRINT"{white}{clear}{down*7}{right*9}giving up{.*6}tsk, tsk" 390 PRINT"{down*3}{space*2}the current game time is{.*4}: "; 395 PRINT"{yellow}"MID$(ti$,3,2)":"RIGHT$(ti$,2) 400 PRINT"{white}{down*2}{space*2}the current # of moves is{.*3}:{yellow}"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 DIMcg$(5,5),pg$(5,5):REM initialize 455 jy=56320:REM for joystick #1 change 56320 to 56321 460 dn$="{home}{down*25}" 465 REM 480 POKE53280,0:POKE53281,0:REM title screen 485 PRINT"{clear}{down*4}{white}{space*10}the alphabet shuffle" 490 PRINT"{yellow}{space*9}{cm y*22}{white} 495 PRINT"{down*2}{space*2}1) {yellow}beginner game{.*8} {white}3 by 3 grid 500 PRINT"{down*2}{space*2}2) {yellow}intermediate game{.*4} {white}4 by 4 grid 505 PRINT"{down*2}{space*2}3) {yellow}expert game{.*10} {white}5 by 5 grid 510 PRINT"{down*3} move joystick (up/down) to select game 515 PRINT"{down}{space*7}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"{black}";:GOSUB610 585 gn=gn+(jd=1)-(jd=2) 590 IFgn<3THENgn=5 595 IFgn>5THENgn=3 600 PRINT"{yellow}"; 605 REM 610 PRINTLEFT$(dn$,5+(gn-2)*3); 615 PRINT" U{sh asterisk*36}I 620 PRINT" {sh -}{right*36}{sh -} 625 PRINT" J{sh asterisk*36}K 630 RETURN 635 REM 650 PRINT"{clear}{down*2}{white}{space*3}instructions for alphabet shuffle":REM instruction screen 655 PRINT"{yellow}{space*2}{cm y*35}{white} 660 PRINT"{down}{space*4}the object of this game is quite 665 PRINT"{down}{space*3}simple. just rearrange the letters 670 PRINT"{down}{space*8}into {yellow}alphabetical order.{white} 675 PRINT"{space*13}{cm t*18} 680 PRINT"{down}{space*4}when the game is completed each 685 PRINT"{down}{space*6}row will be the same color. 690 PRINT"{down*2}{space*5}to quit playing and try again 695 PRINT"{down}{space*9}press the fire button 700 PRINT"{down*2}{yellow}{space*7}please wait{.*5}setting up{home} 705 REM 720 FORi=1TOgn:REM setup winning grid 725 : FORj=1TOgn 730 : cg$(i,j)=CHR$(65+(i-1)*gn+(j-1)) 735 : pg$(i,j)=" " 740 : NEXT 745 NEXT:cg$(gn,gn)=" " 755 REM 770 FORi=65TO63+gn*gn:REM setup playing grid 775 : x=INT(RND(0)*(gn-1)+1.5) 780 : y=INT(RND(0)*(gn-1)+1.5) 785 : IFx*y=gn*gnTHEN775 790 : IFpg$(x,y)<>" "THEN775 795 : pg$(x,y)=CHR$(i) 800 NEXT 820 GOSUB135:REM wait for fire button 825 REM 830 hp=((38-gn*4)/2):vp=((26-gn*4)/2) 840 REM 845 PRINT"{clear}{yellow}"LEFT$(dn$,vp);:REM print finished grid 850 PRINTSPC(hp)"{cm a}"RIGHT$("{sh asterisk*3}{cm r}{sh asterisk*3}{cm r}{sh asterisk*3}{cm r}{sh asterisk*3}{cm r}{sh asterisk*3}{cm s}",4*gn) 855 FORi=1TOgn 860 : FORj=1TO3 865 : PRINTSPC(hp)"{sh -}"RIGHT$("{space*3}{sh -}{space*3}{sh -}{space*3}{sh -}{space*3}{sh -}{space*3}{sh -}",4*gn) 870 : NEXT 875 : PRINTSPC(hp)"{cm q}"RIGHT$("{sh asterisk*3}{sh +}{sh asterisk*3}{sh +}{sh asterisk*3}{sh +}{sh asterisk*3}{sh +}{sh asterisk*3}{cm w}",4*gn) 880 NEXT 885 PRINT"{up}"SPC(hp)"{cm z}"RIGHT$("{sh asterisk*3}{cm e}{sh asterisk*3}{cm e}{sh asterisk*3}{cm e}{sh asterisk*3}{cm e}{sh asterisk*3}{cm x}",4*gn) 890 REM 905 FORtx=1TOgn:REM print grid letters 910 : FORty=1TOgn 915 : a$=pg$(tx,ty) 920 : GOSUB170 925 : NEXT 930 NEXT 935 REM 940 GOTO210:REM goto main loop stop tok64 (bastext 1.0)