home *** CD-ROM | disk | FTP | other *** search
Wrap
100 poke53280,.:poke53281,. 180 print chr$(142)"[147]";tab(11);"[158]*** conundrum [146] ***" 190 print "";tab(19);"by" 200 print "";tab(12);"richard f. daley" 210 print tab(18);"and" 220 print tab(13);"sally j. daley" 230 gn$=" [146][157][157][157][157][157] [146][157][157][157][157][157] [157][157][157][157][157] [146][157][157][157][157][157] [146][145][145][145][145]" 240 rd$=" [146][157][157][157][157][157] [146][157][157][157][157][157] [157][157][157][157][157] [146][157][157][157][157][157] [146][145][145][145][145]" 250 rt$="": dn$="" 260 print " press return[146] to begin" 270 get kb$: if kb$<>chr$(13) then 270 280 dim sq(9),rv(9) 290 print "[147]": poke 53280,0: poke 53281,0 300 gosub 920: for ct=1 to 9: sq(ct)=0: if rnd(ti)>.65 then sq(ct)=1 310 next ct 320 rem 330 rem *** main loop *** 340 rem 350 gosub 1020: print 360 wn=0: gosub 580: if wn<>0 then 650 370 print "[159]which one to reverse? [157][157][157][157][157]";: gosub 790 375 ifkb$="q"orkb$="[209]"then740 380 if val(kb$)<1 or val(kb$)>9 then print "[145][145]": goto 370 390 if sq(val(kb$))=1 then sq(val(kb$))=0: goto 410 400 sq(val(kb$))=1 410 on val(kb$) goto 430,440,450,460,470,480,490,500,510 420 goto 350 430 t=3: rv(1)=2: rv(2)=4: rv(3)=5: goto 520: rem square 1 440 t=2: rv(1)=1: rv(2)=3: goto 520: rem square 2 450 t=3: rv(1)=2: rv(2)=5: rv(3)=6: goto 520: rem square 3 460 t=2: rv(1)=1: rv(2)=7: goto 520: rem square 4 470 t=4: rv(1)=2: rv(2)=4: rv(3)=6: rv(4)=8: goto 520: rem square 5 480 t=2: rv(1)=3: rv(2)=9: goto 520: rem square 6 490 t=3: rv(1)=4: rv(2)=5: rv(3)=8: goto 520: rem square 7 500 t=2: rv(1)=7: rv(2)=9: goto 520: rem square 8 510 t=3: rv(1)=8: rv(2)=5: rv(3)=6: rem square 9 520 for ct=1 to t: if sq(rv(ct))=1 then sq(rv(ct))=0: goto 540 530 sq(rv(ct))=1 540 next ct: goto 350 550 rem 560 rem *** check for win *** 570 rem 580 for ct=1 to 9: if sq(ct)=1 then wn=wn+1 590 next ct: if wn=8 and sq(5)=0 then wn=1: return 600 if wn=0 then wn=-1: return 610 wn=0: return 620 rem 630 rem *** game over - display winner and exit *** 640 rem 650 j=0: if wn=-1 then 750 660 print "[153][147][205] [206][157][157][157][205][206][157][157][157] [167] [157][157][157] [167] [145][145][145][206][163][205][157][157][157][165] [167] [157][157][157][157][165] [167] [157][157][157][157]"; 670 print "[205][164][206][145][145][145][165] [167] [157][157][157][157][165] [167] [157][157][157][157][165] [167] [157][157][157][157][205][164][206][145][145][145]"; 680 print "[165] [167][157][157][157][157][165] [167][157][157][157][157][165] [167][157][157][157][157]"; 690 print "[205][206][205][206][145][145][145][206][163][205][157][157][157][165] [167][157][157][157][165] [167][157][157][157][205][164][206][145][145][145][167][205] [165][157][157][157][157][157][157]"; 700 print "[167] [205] [165][157][157][157][157][157][157][167] [205] [165][157][157][157][157][157][157][167] [205][165][145][145][145][221][157][221][157][221][157][215]" 710 print "";dn$;dn$;dn$;dn$;"do you wish to play again? "; 715 gosub790 720 if left$(kb$,1)="y" then 290 726 if left$(kb$,1)<>"n" then 715 730 print "[147][154]thanks for the game" 740 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15 745 print"[147]";:ifer<>63thenend 746 load"hello connect",8 750 print "[156]";dn$;dn$;dn$;dn$;"how clumsy of you! you lose!": goto 710 760 rem 770 rem *** keyboard input subroutine *** 780 rem 790 print "[166][146][157]"; 800 get kb$ 810 if kb$<>"" then if asc(kb$)<>13 then print " ": return 820 for ct=1 to 40 830 get kb$ 840 if kb$<>"" then if asc(kb$)<>13 then print " ": return 850 next ct: print "[166][157]";: for ct=1 to 40 860 get kb$ 870 if kb$<>"" then if asc(kb$)<>13 then print " ": return 880 next ct: goto 790 890 rem 900 rem *** subroutine to print the grid on the screen *** 910 rem 920 print dn$;rt$;"[145][145][145][176][192][195][192][192][192][178][192][195][192][192][192][178][192][195][192][192][192][174]": gosub 980: for j=1 to 2 930 print rt$;"[171][192][195][192][192][192][219][192][195][192][192][192][219][192][195][192][192][192][179]": gosub 980 940 next:print rt$;"[173][192][195][192][192][192][177][195][192][192][192][192][177][192][195][192][192][192][189]" 942 print" press 'q' to quit" 945 print "[158]"dn$rt$""; 950 for ct=1 to 9: print "";ct;""; 960 if ct/3=int(ct/3) and ct<>9 then print: print "";rt$; 970 next ct: return 980 for ct=1 to 5: print rt$;"[221] [221] [221] [221]": next ct: return 990 rem 1000 rem *** subroutine to display current status of squares *** 1010 rem 1020 print "";dn$;rt$;"[145][145]";: for ct=1 to 9 1030 if sq(ct)=1 then print gn$;: goto 1050 1040 print rd$; 1050 if ct/3=int(ct/3) then print: print "";rt$;""; 1060 next ct: return