REM Shift Solitaire REM by Matthew Hartley 2001 LABEL mainmenu cheat = 0 cheated = 0 scheme = 1 if scheme = 1 then PegR = 60 PegG = 60 PegB = 0 BorR = 20 BorG = 20 BorB = 0 CurR = 255 CurG = 255 CurB = 255 BacR = 80 BacG = 80 BacB = 80 GriR = 255 GriG = 255 GriB = 255 SelR = 120 SelG = 120 SelB = 0 TexR = 0 TexG = 255 TexB = 0 HedR = 0 HedG = 0 HedB = 0 fi up = 16 down = 64 left = 128 right = 32 cross = 16384 tri = 4096 circ = 8192 squ = 32768 open window 640,512 setrgb 0,BorR,BorG,BorB clear window Grid() setrgb 1,BacR,BacG,BacB fill rectangle 0,0 to 0+((640/9)*3)-1,0+((512/9)*3)-1 fill rectangle 0+((640/9)*6)+1,0 to 640,0+((512/9)*3)-1 fill rectangle 0,0+((512/9)*6)+1 to 0+((640/9)*3)-1,512 fill rectangle 0+((640/9)*6)+1,0+((512/9)*6)+1 to 640,512 REM draw pegs setrgb 1,PegR,PegG,PegB for i = 4 to 6 for j = 1 to 3 fill circle (0+((640/9)*(i-1)))+(640/18),(0+((512/9)*(j-1)))+(512/18),20 next j next i for i = 4 to 6 for j = 7 to 9 fill circle (0+((640/9)*(i-1)))+(640/18),(0+((512/9)*(j-1)))+(512/18),20 next j next i for i = 1 to 3 for j = 4 to 6 fill circle (0+((640/9)*(i-1)))+(640/18),(0+((512/9)*(j-1)))+(512/18),20 next j next i for i = 7 to 9 for j = 4 to 6 fill circle (0+((640/9)*(i-1)))+(640/18),(0+((512/9)*(j-1)))+(512/18),20 next j next i setrgb 1,50,0,50 fill rectangle 240,70 to 400,120 fill rectangle 400,170 to 510,175 setrgb 1,255,255,255 rectangle 239,69 to 401,121 rectangle 400,170 to 510,175 wait 0.1 setrgb 1,50,0,50 fill rectangle 220,65 to 420,125 fill rectangle 380,165 to 530,180 setrgb 1,255,255,255 rectangle 219,64 to 421,126 rectangle 380,165 to 530,180 wait 0.1 setrgb 1,50,0,50 fill rectangle 200,55 to 440,135 fill rectangle 350,150 to 560,190 setrgb 1,255,255,255 rectangle 199,56 to 441,136 rectangle 350,150 to 560,190 wait 0.2 setrgb 1,0,255,0 text 242,90,"SHIFT SOLITAIRE" line 242,110 to 400,110 wait 0.2 setrgb 1,0,255,0 text 365,172,"by Matthew Hartley" wait 0.3 setrgb 1,50,0,50 fill rectangle 50,450 to 315,490 fill rectangle 325,450 to 590,490 setrgb 1,255,255,255 rectangle 50,450 to 315,490 rectangle 325,450 to 590,490 setrgb 1,255,255,255 text 60,472, "E A S I E R R U L E S" text 337,472,"N O R M A L R U L E S" setrgb 1,255,255,255 rectangle 45,445 to 320,495 rectangle 44,444 to 321,496 rectangle 43,443 to 322,497 pos =1 setrgb 1,50,0,50 fill rectangle 70,205 to 285,365 setrgb 1,255,255,255 rectangle 70,205 to 285,365 setrgb 1,50,0,50 fill rectangle 310,285 to 590,365 setrgb 1,255,255,255 rectangle 310,285 to 590,365 setrgb 1,255,255,255 text 325,310,"With these easier rules," text 325,327,"it does not matter where" text 325,344,"the final peg ends up." setrgb 1,255,255,255 text 80,220,"THE AIM of the game" text 80,237,"is to eliminate all" text 80,254,"but one peg. A peg" text 80,271,"is eliminated when" text 80,288,"another peg is" text 80,305,"jumped over it. You" text 80,322,"can only jump up," text 80,339,"down, left or right" text 80,356,"into a free space." 781 wait 0.1 e = peek("port1") if pos = 1 and e = right then pos =2 clear rectangle 45,445 to 320,495 clear rectangle 44,444 to 321,496 clear rectangle 43,443 to 322,497 setrgb 1,255,255,255 rectangle 320,445 to 595,495 rectangle 319,444 to 596,496 rectangle 318,443 to 597,497 setrgb 1,50,0,50 fill rectangle 310,285 to 590,365 setrgb 1,255,255,255 rectangle 310,285 to 590,365 setrgb 1,255,255,255 text 320,310,"According to these normal" text 320,327,"rules, the final peg must" text 320,344,"end up in the centre (5,5)" elseif pos = 2 and e = left then pos = 1 clear rectangle 320,445 to 595,495 clear rectangle 319,444 to 596,496 clear rectangle 318,443 to 597,497 setrgb 1,255,255,255 rectangle 45,445 to 320,495 rectangle 44,444 to 321,496 rectangle 43,443 to 322,497 setrgb 1,50,0,50 fill rectangle 310,285 to 590,365 setrgb 1,255,255,255 rectangle 310,285 to 590,365 setrgb 1,255,255,255 text 325,310,"With these easier rules," text 325,327,"it does not matter where" text 325,344,"the final peg ends up." elseif e = cross then setting = pos goto 782 fi goto 781 782 wait 0.1 open window 640,512 setrgb 0,BorR,BorG,BorB clear window Grid() setrgb 1,BacR,BacG,BacB fill rectangle 0,0 to 0+((640/9)*3)-1,0+((512/9)*3)-1 fill rectangle 0+((640/9)*6)+1,0 to 640,0+((512/9)*3)-1 fill rectangle 0,0+((512/9)*6)+1 to 0+((640/9)*3)-1,512 fill rectangle 0+((640/9)*6)+1,0+((512/9)*6)+1 to 640,512 setrgb 1,50,0,50 fill rectangle 30,30 to 0+((640/9)*3)-31,0+((512/9)*3)-31 fill rectangle 0+((640/9)*6)+31,30 to 640-30,0+((512/9)*3)-31 fill rectangle 30,0+((512/9)*6)+31 to 0+((640/9)*3)-31,482 fill rectangle 0+((640/9)*6)+31,0+((512/9)*6)+31 to 610,482 setrgb 1,255,255,255 rectangle 30,30 to 0+((640/9)*3)-31,0+((512/9)*3)-31 rectangle 0+((640/9)*6)+31,30 to 640-30,0+((512/9)*3)-31 rectangle 30,0+((512/9)*6)+31 to 0+((640/9)*3)-31,482 rectangle 0+((640/9)*6)+31,0+((512/9)*6)+31 to 610,482 setrgb 1,255,255,255 fill triangle 105,45 to 95,65 to 115,65 fill triangle 105,125 to 95,105 to 115,105 fill triangle 55,85 to 75,75 to 75,95 fill triangle 155,85 to 135,75 to 135,95 fill circle 530,60,12 fill circle 530,110,12 fill circle 492,85,12 fill circle 568,85,12 text 31,395,"Move the cursor" text 31,412,"around using" text 31,429,"the D-pad." text 31,446,"Press circle" text 31,463,"to exit." text 461,395,"Press X to" text 461,412,"select a peg." text 461,429,"Press square" text 461,446,"to undo your" text 461,463,"last move." Sub Grid() REM ======Draw Grid======================================= setrgb 1,GriR,GriG,GriB REM top + bottom line 0+((640/9)*3),1 to 640-((640/9)*3),1 line 0+((640/9)*3),511 to 640-((640/9)*3),511 REM left + right line 1,0+((512/9)*3) to 1,512-((512/9)*3) line 639,0+((512/9)*3) to 639,512-((512/9)*3) REM complete down line 0+((640/9)*3),1 to 0+((640/9)*3),511 line 640-((640/9)*3),1 to 640-((640/9)*3),511 REM complete across line 0+((640/9)*4),1 to 0+((640/9)*4),511 line 640-((640/9)*4),1 to 640-((640/9)*4),511 REM mid c down line 1,0+((512/9)*3) to 639,0+((512/9)*3) line 1,512-((512/9)*3) to 639,512-((512/9)*3) REM mid c across line 1,0+((512/9)*4) to 639,0+((512/9)*4) line 1,512-((512/9)*4) to 639,512-((512/9)*4) REM top box unc line 0+((640/9)*3),0+((512/9)*1) to 640-((640/9)*3),0+((512/9)*1) line 0+((640/9)*3),0+((512/9)*2) to 640-((640/9)*3),0+((512/9)*2) REM bottom box unc line 0+((640/9)*3),512-((512/9)*1) to 640-((640/9)*3),512-((512/9)*1) line 0+((640/9)*3),512-((512/9)*2) to 640-((640/9)*3),512-((512/9)*2) REM left box unc line 0+((640/9)*1),0+((512/9)*3) to 0+((640/9)*1),512-((512/9)*3) line 0+((640/9)*2),0+((512/9)*3) to 0+((640/9)*2),512-((512/9)*3) REM right box unc line 640-((640/9)*1),0+((512/9)*3) to 640-((640/9)*1),512-((512/9)*3) line 640-((640/9)*2),0+((512/9)*3) to 640-((640/9)*2),512-((512/9)*3) REM ====================================================== End Sub dim sqs(9,9) dim mvs(100,3) curMove = 1 REM set all squares to 1 for i = 1 to 9 for j = 1 to 9 sqs(i,j) = 1 next j next i REM blank out illegal + unoccupied areas for i = 1 to 3 for j = 1 to 3 sqs(i,j) = 0 next j next i for i = 1 to 3 for j = 7 to 9 sqs(i,j) = 0 next j next i for i = 7 to 9 for j = 1 to 3 sqs(i,j) = 0 next j next i for i = 7 to 9 for j = 7 to 9 sqs(i,j) = 0 next j next i for i = 4 to 6 for j = 4 to 6 sqs(i,j) = 0 next j next i REM draw pegs setrgb 1,PegR,PegG,PegB for i = 4 to 6 for j = 1 to 3 fill circle (0+((640/9)*(i-1)))+(640/18),(0+((512/9)*(j-1)))+(512/18),20 next j next i for i = 4 to 6 for j = 7 to 9 fill circle (0+((640/9)*(i-1)))+(640/18),(0+((512/9)*(j-1)))+(512/18),20 next j next i for i = 1 to 3 for j = 4 to 6 fill circle (0+((640/9)*(i-1)))+(640/18),(0+((512/9)*(j-1)))+(512/18),20 next j next i for i = 7 to 9 for j = 4 to 6 fill circle (0+((640/9)*(i-1)))+(640/18),(0+((512/9)*(j-1)))+(512/18),20 next j next i score = 36 REM draw cursor curx = 5 cury = 5 setrgb 1,CurR,CurG,CurB rectangle (0+((640/9)*(curx-1)))+5,(0+((512/9)*(cury-1)))+5 to (0+((640/9)*(curx)))-5,(0+((512/9)*(cury)))-5 REM active 10 wait 0.1 a = peek("port1") if a = up then setrgb 1,0,255,0 fill triangle 105,45 to 95,65 to 115,65 setrgb 1,255,255,255 fill triangle 105,125 to 95,105 to 115,105 fill triangle 55,85 to 75,75 to 75,95 fill triangle 155,85 to 135,75 to 135,95 fill circle 530,60,12 fill circle 530,110,12 fill circle 492,85,12 fill circle 568,85,12 if (cury<>1) then if (curx=1 or curx=2 or curx=3 or curx=7 or curx=8 or curx=9) and (cury=4) then goto 11 fi clear rectangle (0+((640/9)*(curx-1)))+5,(0+((512/9)*(cury-1)))+5 to (0+((640/9)*(curx)))-5,(0+((512/9)*(cury)))-5 cury = cury - 1 rectangle (0+((640/9)*(curx-1)))+5,(0+((512/9)*(cury-1)))+5 to (0+((640/9)*(curx)))-5,(0+((512/9)*(cury)))-5 fi elseif a = down then setrgb 1,0,255,0 fill triangle 105,125 to 95,105 to 115,105 setrgb 1,255,255,255 fill triangle 105,45 to 95,65 to 115,65 fill triangle 55,85 to 75,75 to 75,95 fill triangle 155,85 to 135,75 to 135,95 fill circle 530,60,12 fill circle 530,110,12 fill circle 492,85,12 fill circle 568,85,12 if cury<>9 then if (curx=1 or curx=2 or curx=3 or curx=7 or curx=8 or curx=9) and (cury=6) then goto 11 fi clear rectangle (0+((640/9)*(curx-1)))+5,(0+((512/9)*(cury-1)))+5 to (0+((640/9)*(curx)))-5,(0+((512/9)*(cury)))-5 cury = cury + 1 rectangle (0+((640/9)*(curx-1)))+5,(0+((512/9)*(cury-1)))+5 to (0+((640/9)*(curx)))-5,(0+((512/9)*(cury)))-5 fi elseif a = left then setrgb 1,0,255,0 fill triangle 55,85 to 75,75 to 75,95 setrgb 1,255,255,255 fill triangle 105,45 to 95,65 to 115,65 fill triangle 105,125 to 95,105 to 115,105 fill triangle 155,85 to 135,75 to 135,95 fill circle 530,60,12 fill circle 530,110,12 fill circle 492,85,12 fill circle 568,85,12 if curx<>1 then if (cury=1 or cury=2 or cury=3 or cury=7 or cury=8 or cury=9) and (curx=4) then goto 11 fi clear rectangle (0+((640/9)*(curx-1)))+5,(0+((512/9)*(cury-1)))+5 to (0+((640/9)*(curx)))-5,(0+((512/9)*(cury)))-5 curx = curx - 1 rectangle (0+((640/9)*(curx-1)))+5,(0+((512/9)*(cury-1)))+5 to (0+((640/9)*(curx)))-5,(0+((512/9)*(cury)))-5 fi elseif a = right then setrgb 1,0,255,0 fill triangle 155,85 to 135,75 to 135,95 setrgb 1,255,255,255 fill triangle 105,45 to 95,65 to 115,65 fill triangle 105,125 to 95,105 to 115,105 fill triangle 55,85 to 75,75 to 75,95 fill circle 530,60,12 fill circle 530,110,12 fill circle 492,85,12 fill circle 568,85,12 if curx<>9 then if (cury=1 or cury=2 or cury=3 or cury=7 or cury=8 or cury=9) and (curx=6) then goto 11 fi clear rectangle (0+((640/9)*(curx-1)))+5,(0+((512/9)*(cury-1)))+5 to (0+((640/9)*(curx)))-5,(0+((512/9)*(cury)))-5 curx = curx + 1 rectangle (0+((640/9)*(curx-1)))+5,(0+((512/9)*(cury-1)))+5 to (0+((640/9)*(curx)))-5,(0+((512/9)*(cury)))-5 fi elseif a = circ then setrgb 1,0,255,0 fill circle 568,85,12 setrgb 1,255,255,255 fill triangle 105,45 to 95,65 to 115,65 fill triangle 105,125 to 95,105 to 115,105 fill triangle 55,85 to 75,75 to 75,95 fill triangle 155,85 to 135,75 to 135,95 fill circle 530,60,12 fill circle 530,110,12 fill circle 492,85,12 goto 502 elseif a = 32768 then 987654321 setrgb 1,0,255,0 fill circle 492,85,12 setrgb 1,255,255,255 fill triangle 105,45 to 95,65 to 115,65 fill triangle 105,125 to 95,105 to 115,105 fill triangle 55,85 to 75,75 to 75,95 fill triangle 155,85 to 135,75 to 135,95 fill circle 530,60,12 fill circle 530,110,12 fill circle 568,85,12 if curMove > 1 then curMove = curMove - 1 if mvs(curMove,3) = 1 then setrgb 1,PegR,PegG,PegB fill circle (0+((640/9)*(mvs(curMove,1)-1)))+(640/18),(0+((512/9)*(mvs(curMove,2)-1)))+(512/18),20 fill circle (0+((640/9)*(mvs(curMove,1)-1)))+(640/18),(0+((512/9)*(mvs(curMove,2)-1-1)))+(512/18),20 clear fill circle (0+((640/9)*(mvs(curMove,1)-1)))+(640/18),(0+((512/9)*(mvs(curMove,2)-1-2)))+(512/18),20 sqs(mvs(curMove,1),mvs(curMove,2)) = 1 sqs(mvs(curMove,1),mvs(curMove,2)-1) = 1 sqs(mvs(curMove,1),mvs(curMove,2)-2) = 0 elseif mvs(curMove,3) = 2 then setrgb 1,PegR,PegG,PegB fill circle (0+((640/9)*(mvs(curMove,1)-1)))+(640/18),(0+((512/9)*(mvs(curMove,2)-1)))+(512/18),20 fill circle (0+((640/9)*(mvs(curMove,1)-1)))+(640/18),(0+((512/9)*(mvs(curMove,2)-1+1)))+(512/18),20 clear fill circle (0+((640/9)*(mvs(curMove,1)-1)))+(640/18),(0+((512/9)*(mvs(curMove,2)-1+2)))+(512/18),20 sqs(mvs(curMove,1),mvs(curMove,2)) = 1 sqs(mvs(curMove,1),mvs(curMove,2)+1) = 1 sqs(mvs(curMove,1),mvs(curMove,2)+2) = 0 elseif mvs(curMove,3) = 3 then setrgb 1,PegR,PegG,PegB fill circle (0+((640/9)*(mvs(curMove,1)-1)))+(640/18),(0+((512/9)*(mvs(curMove,2)-1)))+(512/18),20 fill circle (0+((640/9)*(mvs(curMove,1)-1-1)))+(640/18),(0+((512/9)*(mvs(curMove,2)-1)))+(512/18),20 clear fill circle (0+((640/9)*(mvs(curMove,1)-1-2)))+(640/18),(0+((512/9)*(mvs(curMove,2)-1)))+(512/18),20 sqs(mvs(curMove,1),mvs(curMove,2)) = 1 sqs(mvs(curMove,1)-1,mvs(curMove,2)) = 1 sqs(mvs(curMove,1)-2,mvs(curMove,2)) = 0 elseif mvs(curMove,3) = 4 then setrgb 1,PegR,PegG,PegB fill circle (0+((640/9)*(mvs(curMove,1)-1)))+(640/18),(0+((512/9)*(mvs(curMove,2)-1)))+(512/18),20 fill circle (0+((640/9)*(mvs(curMove,1)-1+1)))+(640/18),(0+((512/9)*(mvs(curMove,2)-1)))+(512/18),20 clear fill circle (0+((640/9)*(mvs(curMove,1)-1+2)))+(640/18),(0+((512/9)*(mvs(curMove,2)-1)))+(512/18),20 sqs(mvs(curMove,1),mvs(curMove,2)) = 1 sqs(mvs(curMove,1)+1,mvs(curMove,2)) = 1 sqs(mvs(curMove,1)+2,mvs(curMove,2)) = 0 fi fi elseif a = 1024+2048+512+256+circ+left then cheated = 1 for i = 4 to 6 for j = 1 to 9 clear fill circle (0+((640/9)*(i-1)))+(640/18),(0+((512/9)*(j-1)))+(512/18),20 next j next i for i = 1 to 9 for j = 4 to 6 clear fill circle (0+((640/9)*(i-1)))+(640/18),(0+((512/9)*(j-1)))+(512/18),20 next j next i for i = 1 to 9 for j = 1 to 9 sqs(i,j) = 0 next j next i sqs(3,5) = 1 : sqs(4,5) = 1 setrgb 1,PegR,PegG,PegB fill circle (0+((640/9)*(3-1)))+(640/18),(0+((512/9)*(5-1)))+(512/18),20 fill circle (0+((640/9)*(4-1)))+(640/18),(0+((512/9)*(5-1)))+(512/18),20 elseif a = 512 + tri then if sqs(curx,cury) = 1 then cheat = 1 chx =curx chy =cury setrgb 1,0,255,0 fill circle 492,85,12 fill triangle 105,45 to 95,65 to 115,65 fill triangle 105,125 to 95,105 to 115,105 fill triangle 55,85 to 75,75 to 75,95 fill triangle 155,85 to 135,75 to 135,95 fill circle 530,60,12 fill circle 530,110,12 fill circle 568,85,12 fi elseif a = 2048 + tri and cheat = 1 then if sqs(curx,cury) = 0 then cheat = 0 cheated = 1 sqs(chx,chy) = 0 sqs(curx,cury) = 1 clear fill circle (0+((640/9)*(chx-1)))+(640/18),(0+((512/9)*(chy-1)))+(512/18),20 setrgb 1,PegR,PegG,PegB fill circle (0+((640/9)*(curx-1)))+(640/18),(0+((512/9)*(cury-1)))+(512/18),20 setrgb 1,0,255,0 fill circle 492,85,12 fill triangle 105,45 to 95,65 to 115,65 fill triangle 105,125 to 95,105 to 115,105 fill triangle 55,85 to 75,75 to 75,95 fill triangle 155,85 to 135,75 to 135,95 fill circle 530,60,12 fill circle 530,110,12 fill circle 568,85,12 fi elseif a = cross then if sqs(curx,cury) = 1 then setrgb 1,50,0,50 fill rectangle 30,0+((512/9)*6)+31 to 0+((640/9)*3)-31,482 fill rectangle 0+((640/9)*6)+31,0+((512/9)*6)+31 to 610,482 setrgb 1,255,255,255 rectangle 30,0+((512/9)*6)+31 to 0+((640/9)*3)-31,482 rectangle 0+((640/9)*6)+31,0+((512/9)*6)+31 to 610,482 text 31,397,"Jump over a" text 31,414,"peg by pressing" text 31,431,"the direction" text 31,448,"on the D-pad." text 461,392,"Press triangle" text 461,409,"to deselect" text 461,426,"the peg. You" text 461,443,"must do this" text 461,460,"to carry on or" text 461,477,"exit." fi setrgb 1,0,255,0 fill circle 530,110,12 setrgb 1,255,255,255 fill triangle 105,45 to 95,65 to 115,65 fill triangle 105,125 to 95,105 to 115,105 fill triangle 55,85 to 75,75 to 75,95 fill triangle 155,85 to 135,75 to 135,95 fill circle 530,60,12 fill circle 492,85,12 fill circle 568,85,12 if sqs(curx,cury) = 1 then clear fill circle (0+((640/9)*(curx-1)))+(640/18),(0+((512/9)*(cury-1)))+(512/18),20 setrgb 1,SelR,SelG,SelB fill circle (0+((640/9)*(curx-1)))+(640/18),(0+((512/9)*(cury-1)))+(512/18),20 setrgb 1,CurR,CurG,CurB 12 wait 0.1 b = peek("port1") if b = up then setrgb 1,0,255,0 fill triangle 105,45 to 95,65 to 115,65 setrgb 1,255,255,255 fill triangle 105,125 to 95,105 to 115,105 fill triangle 55,85 to 75,75 to 75,95 fill triangle 155,85 to 135,75 to 135,95 fill circle 530,60,12 fill circle 530,110,12 fill circle 492,85,12 fill circle 568,85,12 if cury=2 or cury=1 or ((curx=1 or curx=2 or curx=3 or curx=7 or curx=8 or curx=9) and (cury=5 or curx=4)) then goto 12 fi if sqs(curx,cury-1) = 1 and sqs(curx,cury-2) = 0 then setrgb 1,SelR,SelG,SelB line (0+((640/9)*(curx-1)))+(640/18),(0+((512/9)*(cury-1)))+(512/18) to (0+((640/9)*(curx-1)))+(640/18),(0+((512/9)*(cury-2-1)))+(512/18) clear fill circle (0+((640/9)*(curx-1)))+(640/18),(0+((512/9)*(cury-1)))+(512/18),20 clear rectangle (0+((640/9)*(curx-1)))+5,(0+((512/9)*(cury-1)))+5 to (0+((640/9)*(curx)))-5,(0+((512/9)*(cury)))-5 wait 0.5 clear line (0+((640/9)*(curx-1)))+(640/18),(0+((512/9)*(cury-1)))+(512/18) to (0+((640/9)*(curx-1)))+(640/18),(0+((512/9)*(cury-2-1)))+(512/18) cury = cury - 2 fill circle (0+((640/9)*(curx-1)))+(640/18),(0+((512/9)*(cury-1)))+(512/18),20 wait 0.5 clear fill circle (0+((640/9)*(curx-1)))+(640/18),(0+((512/9)*(cury-1+1)))+(512/18),20 setrgb 1,CurR,CurG,CurB rectangle (0+((640/9)*(curx-1)))+5,(0+((512/9)*(cury-1)))+5 to (0+((640/9)*(curx)))-5,(0+((512/9)*(cury)))-5 Grid() sqs(curx,cury) = 1 sqs(curx,cury+1) = 0 sqs(curx,cury+2) = 0 mvs(curMove,1) = curx mvs(curMove,2) = cury+2 mvs(curMove,3) = 1 curMove = curMove + 1 score = score - 1 fi elseif b = down then setrgb 1,0,255,0 fill triangle 105,125 to 95,105 to 115,105 setrgb 1,255,255,255 fill triangle 105,45 to 95,65 to 115,65 fill triangle 55,85 to 75,75 to 75,95 fill triangle 155,85 to 135,75 to 135,95 fill circle 530,60,12 fill circle 530,110,12 fill circle 492,85,12 fill circle 568,85,12 if cury=8 or cury=9 or ((curx=1 or curx=2 or curx=3 or curx=7 or curx=8 or curx=9) and (cury=5 or curx=6)) then goto 12 fi if sqs(curx,cury+1) = 1 and sqs(curx,cury+2) = 0 then setrgb 1,SelR,SelG,SelB line (0+((640/9)*(curx-1)))+(640/18),(0+((512/9)*(cury-1)))+(512/18) to (0+((640/9)*(curx-1)))+(640/18),(0+((512/9)*(cury+2-1)))+(512/18) clear fill circle (0+((640/9)*(curx-1)))+(640/18),(0+((512/9)*(cury-1)))+(512/18),20 clear rectangle (0+((640/9)*(curx-1)))+5,(0+((512/9)*(cury-1)))+5 to (0+((640/9)*(curx)))-5,(0+((512/9)*(cury)))-5 wait 0.5 clear line (0+((640/9)*(curx-1)))+(640/18),(0+((512/9)*(cury-1)))+(512/18) to (0+((640/9)*(curx-1)))+(640/18),(0+((512/9)*(cury+2-1)))+(512/18) cury = cury + 2 fill circle (0+((640/9)*(curx-1)))+(640/18),(0+((512/9)*(cury-1)))+(512/18),20 wait 0.5 clear fill circle (0+((640/9)*(curx-1)))+(640/18),(0+((512/9)*(cury-1-1)))+(512/18),20 setrgb 1,CurR,CurG,CurB rectangle (0+((640/9)*(curx-1)))+5,(0+((512/9)*(cury-1)))+5 to (0+((640/9)*(curx)))-5,(0+((512/9)*(cury)))-5 Grid() sqs(curx,cury) = 1 sqs(curx,cury-1) = 0 sqs(curx,cury-2) = 0 mvs(curMove,1) = curx mvs(curMove,2) = cury-2 mvs(curMove,3) = 2 curMove = curMove + 1 score = score - 1 fi elseif b = left then setrgb 1,0,255,0 fill triangle 55,85 to 75,75 to 75,95 setrgb 1,255,255,255 fill triangle 105,45 to 95,65 to 115,65 fill triangle 105,125 to 95,105 to 115,105 fill triangle 155,85 to 135,75 to 135,95 fill circle 530,60,12 fill circle 530,110,12 fill circle 492,85,12 fill circle 568,85,12 if curx=2 or curx=1 or ((cury=1 or cury=2 or cury=3 or cury=7 or cury=8 or curx=9) and (curx=5 or curx=4)) then goto 12 fi if sqs(curx-1,cury) = 1 and sqs(curx-2,cury) = 0 then setrgb 1,SelR,SelG,SelB line (0+((640/9)*(curx-1)))+(640/18),(0+((512/9)*(cury-1)))+(512/18) to (0+((640/9)*(curx-1-2)))+(640/18),(0+((512/9)*(cury-1)))+(512/18) clear fill circle (0+((640/9)*(curx-1)))+(640/18),(0+((512/9)*(cury-1)))+(512/18),20 clear rectangle (0+((640/9)*(curx-1)))+5,(0+((512/9)*(cury-1)))+5 to (0+((640/9)*(curx)))-5,(0+((512/9)*(cury)))-5 wait 0.5 clear line (0+((640/9)*(curx-1)))+(640/18),(0+((512/9)*(cury-1)))+(512/18) to (0+((640/9)*(curx-1-2)))+(640/18),(0+((512/9)*(cury-1)))+(512/18) curx = curx - 2 fill circle (0+((640/9)*(curx-1)))+(640/18),(0+((512/9)*(cury-1)))+(512/18),20 wait 0.5 clear fill circle (0+((640/9)*(curx-1+1)))+(640/18),(0+((512/9)*(cury-1)))+(512/18),20 setrgb 1,CurR,CurG,CurB rectangle (0+((640/9)*(curx-1)))+5,(0+((512/9)*(cury-1)))+5 to (0+((640/9)*(curx)))-5,(0+((512/9)*(cury)))-5 Grid() sqs(curx,cury) = 1 sqs(curx+1,cury) = 0 sqs(curx+2,cury) = 0 mvs(curMove,1) = curx+2 mvs(curMove,2) = cury mvs(curMove,3) = 3 curMove = curMove + 1 score = score - 1 fi elseif b = right then setrgb 1,0,255,0 fill triangle 155,85 to 135,75 to 135,95 setrgb 1,255,255,255 fill triangle 105,45 to 95,65 to 115,65 fill triangle 105,125 to 95,105 to 115,105 fill triangle 55,85 to 75,75 to 75,95 fill circle 530,60,12 fill circle 530,110,12 fill circle 492,85,12 fill circle 568,85,12 if curx=8 or curx=9 or ((cury=1 or cury=2 or cury=3 or cury=7 or cury=8 or curx=9) and (curx=5 or curx=6)) then goto 12 fi if sqs(curx+1,cury) = 1 and sqs(curx+2,cury) = 0 then setrgb 1,SelR,SelG,SelB line (0+((640/9)*(curx-1)))+(640/18),(0+((512/9)*(cury-1)))+(512/18) to (0+((640/9)*(curx-1+2)))+(640/18),(0+((512/9)*(cury-1)))+(512/18) clear fill circle (0+((640/9)*(curx-1)))+(640/18),(0+((512/9)*(cury-1)))+(512/18),20 clear rectangle (0+((640/9)*(curx-1)))+5,(0+((512/9)*(cury-1)))+5 to (0+((640/9)*(curx)))-5,(0+((512/9)*(cury)))-5 wait 0.5 clear line (0+((640/9)*(curx-1)))+(640/18),(0+((512/9)*(cury-1)))+(512/18) to (0+((640/9)*(curx-1+2)))+(640/18),(0+((512/9)*(cury-1)))+(512/18) curx = curx + 2 fill circle (0+((640/9)*(curx-1)))+(640/18),(0+((512/9)*(cury-1)))+(512/18),20 wait 0.5 clear fill circle (0+((640/9)*(curx-1-1)))+(640/18),(0+((512/9)*(cury-1)))+(512/18),20 setrgb 1,CurR,CurG,CurB rectangle (0+((640/9)*(curx-1)))+5,(0+((512/9)*(cury-1)))+5 to (0+((640/9)*(curx)))-5,(0+((512/9)*(cury)))-5 Grid() sqs(curx,cury) = 1 sqs(curx-1,cury) = 0 sqs(curx-2,cury) = 0 mvs(curMove,1) = curx-2 mvs(curMove,2) = cury mvs(curMove,3) = 4 curMove = curMove + 1 score = score - 1 fi elseif b = tri then setrgb 1,50,0,50 fill rectangle 30,0+((512/9)*6)+31 to 0+((640/9)*3)-31,482 fill rectangle 0+((640/9)*6)+31,0+((512/9)*6)+31 to 610,482 setrgb 1,255,255,255 rectangle 30,0+((512/9)*6)+31 to 0+((640/9)*3)-31,482 rectangle 0+((640/9)*6)+31,0+((512/9)*6)+31 to 610,482 text 31,395,"Move the cursor" text 31,412,"around using" text 31,429,"the D-pad." text 31,446,"Press circle" text 31,463,"to exit." text 461,395,"Press X to" text 461,412,"select a peg." text 461,429,"Press square" text 461,446,"to undo your" text 461,463,"last move." setrgb 1,0,255,0 fill circle 530,60,12 setrgb 1,255,255,255 fill triangle 105,45 to 95,65 to 115,65 fill triangle 105,125 to 95,105 to 115,105 fill triangle 55,85 to 75,75 to 75,95 fill triangle 155,85 to 135,75 to 135,95 fill circle 530,110,12 fill circle 492,85,12 fill circle 568,85,12 clear fill circle (0+((640/9)*(curx-1)))+(640/18),(0+((512/9)*(cury-1)))+(512/18),20 setrgb 1,PegR,PegG,PegB fill circle (0+((640/9)*(curx-1)))+(640/18),(0+((512/9)*(cury-1)))+(512/18),20 setrgb 1,CurR,CurG,CurB goto 11 fi goto 12 fi fi 11 score = 0 for i = 1 to 9 for j = 1 to 9 if sqs(i,j) = 1 then score = score + 1 fi next j next i if setting = 1 then if score = 1 then goto 501 fi elseif setting = 2 then if score = 1 and sqs(5,5) = 1 then goto 501 elseif score = 1 and sqs(5,5) = 0 then goto 502 fi fi for i = 1 to 9 for j = 1 to 9 if j=2 or j=1 or ((i=1 or i=2 or i=3 or i=7 or i=8 or i=9) and (j=5 or j=4 or j=3 or j=2 or j=1)) then goto 101 else if sqs(i,j)=1 and sqs(i,j-1)=1 and sqs(i,j-2)=0 then goto 10 else 101 if j=8 or j=9 or ((i=1 or i=2 or i=3 or i=7 or i=8 or i=9) and (j=5 or j=6 or j=7 or j=8 or j=9)) then goto 102 else if sqs(i,j)=1 and sqs(i,j+1)=1 and sqs(i,j+2)=0 then goto 10 else 102 if i=2 or i=1 or ((j=1 or j=2 or j=3 or j=7 or j=8 or j=9) and (i=5 or i=4 or j=3 or j=2 or j=1)) then goto 103 else if sqs(i,j)=1 and sqs(i-1,j)=1 and sqs(i-2,j)=0 then goto 10 else 103 if i=8 or i=9 or ((j=1 or j=2 or j=3 or j=7 or j=8 or j=9) and (i=5 or i=6 or j=7 or j=8 or j=9)) then goto 104 else if sqs(i,j)=1 and sqs(i+1,j)=1 and sqs(i+2,j)=0 then goto 10 else 104 if i = 9 and j = 9 then goto 502 fi fi fi fi fi fi fi fi fi next j next i goto 10 501 setrgb 1,50,0,50 fill rectangle 30,0+((512/9)*6)+31 to 0+((640/9)*3)-31,482 fill rectangle 0+((640/9)*6)+31,0+((512/9)*6)+31 to 610,482 setrgb 1,255,255,255 rectangle 30,0+((512/9)*6)+31 to 0+((640/9)*3)-31,482 rectangle 0+((640/9)*6)+31,0+((512/9)*6)+31 to 610,482 text 31,429," YOU WIN! " text 461,412,"Press any" text 461,429,"button to see" text 461,446,"game summary." 421 wait 0.1 lop = peek("port1") if lop = 0 then goto 421 else goto 601 fi 502 setrgb 1,50,0,50 fill rectangle 30,0+((512/9)*6)+31 to 0+((640/9)*3)-31,482 fill rectangle 0+((640/9)*6)+31,0+((512/9)*6)+31 to 610,482 setrgb 1,255,255,255 rectangle 30,0+((512/9)*6)+31 to 0+((640/9)*3)-31,482 rectangle 0+((640/9)*6)+31,0+((512/9)*6)+31 to 610,482 text 31,429," YOU LOSE! " text 461,412,"Press x to" text 461,429,"undo last move" text 461,446,"Press circle" text 461,463,"to see summary" 4236 wait 0.1 ghj = peek("port1") if ghj = cross then setrgb 1,50,0,50 fill rectangle 30,0+((512/9)*6)+31 to 0+((640/9)*3)-31,482 fill rectangle 0+((640/9)*6)+31,0+((512/9)*6)+31 to 610,482 setrgb 1,255,255,255 rectangle 30,0+((512/9)*6)+31 to 0+((640/9)*3)-31,482 rectangle 0+((640/9)*6)+31,0+((512/9)*6)+31 to 610,482 text 31,395,"Move the cursor" text 31,412,"around using" text 31,429,"the D-pad." text 31,446,"Press circle" text 31,463,"to exit." text 461,395,"Press X to" text 461,412,"select a peg." text 461,429,"Press square" text 461,446,"to undo your" text 461,463,"last move." goto 987654321 elseif ghj = circ then goto 601 else goto 4236 fi 601 wait 0.2 setrgb 1,BacR,BacG,BacB fill rectangle 0,0 to 640,512 setrgb 1,50,0,50 fill rectangle 20,50 to 620,462 setrgb 1,GriR,GriG,GriB rectangle 20,50 to 620,462 setrgb 1,255,255,255 for g = 1 to 5 : text 270,30,"GAME SUMMARY" : next g text 230,480,"Press any button to return to main menu" setrgb 1,255,255,255 yp = 52 xp = 28 for k = 1 to (curMove - 1) if mvs(k,3) = 1 then : d$ = "up" elseif mvs(k,3) = 2 then : d$ = "down" elseif mvs(k,3) = 3 then : d$ = "left" elseif mvs(k,3) = 4 then : d$ = "right" fi yp = yp + 20 for g = 1 to 3-len(str$(k)) kil$ = kil$ + "0" next g t$ = kil$ + str$(k) + " : Moved peg at " + str$(mvs(k,1)) + "," + str$(mvs(k,2)) + " " + d$ kil$ = "" text xp,yp,t$ wait 0.2 if k = 20 then xp = 328 yp = 52 fi next k if cheated = 1 then yp = yp + 20 text xp,yp,"BUT YOU CHEATED, DIDN'T YOU?" fi 602 wait 0.1 d = peek("port1") if d = 0 then goto 602 else goto mainmenu fi