home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1986 July / 1986-07.d64 / queens (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  70 lines

  1. 10 sc=1063:cs=55336:si=54272:tr=55296:cc=160:sr=53269:bc=53280
  2. 20 print"[147]"chr$(14)chr$(158):pokebc,0:pokebc+1,1
  3. 30 mt$="[146]     [149]     [146]          [146]          [146]      [160]   "
  4. 40 tm$="     [146]          [146]          [146]          [146]     "
  5. 50 forp=sitosi+24:pokep,0:next:gosub610:gosub550:goto280
  6. 60 forn=r+1to8:ifbd(n,c)thenfl=1:return
  7. 70 next:ifr=1then100
  8. 80 forn=1tor-1:ifbd(n,c)thenfl=1:return
  9. 90 next
  10. 100 forn=c+1to8:ifbd(r,n)thenfl=1:return
  11. 110 next:ifc=1then140
  12. 120 forn=1toc-1:ifbd(r,n)thenfl=1:return
  13. 130 next
  14. 140 j=-1:k=-1:gosub180:ifflthenreturn
  15. 150 j=1:k=1:gosub180:ifflthenreturn
  16. 160 j=-1:k=1:gosub180:ifflthenreturn
  17. 170 j=1:k=-1:gosub180:return
  18. 180 r1=r:c1=c
  19. 190 r1=r1+j:c1=c1+k
  20. 200 ifr1<0orr1>8orc1<0orc1>8thenreturn
  21. 210 ifbd(r1,c1)thenfl=1:return
  22. 220 goto190
  23. 230 fortt=2040to2047:pokett,14:next
  24. 240 ifx>255thenpoke53264,peek(53264)or(2^sp):x=x-255:goto260
  25. 250 poke53264,peek(53264)andnot(2^sp)
  26. 260 poke53248+2*sp,x:poke53249+2*sp,y:pokesr,peek(sr)or(2^sp):return
  27. 270 pokesr,peek(sr)andnot(2^sp):return
  28. 280 printchr$(154):sr$=chr$(19)+chr$(18):forr=1to8
  29. 290 gosub530:poke198,0:ifr=0thenr=1
  30. 300 printsr$"[144][195]olumn in [210]ow"r"*                    ":poke19,1
  31. 310 input"";c2$:ifc2$=""then290
  32. 320 c2$=left$(c2$,1):c2=val(c2$):c3=asc(c2$):poke19,0:ifc3=67thenc=1:goto450
  33. 330 ifc3=69thenpoke198,0:sys198
  34. 340 ifc3=82thenr=r-1:sp=r-1:forn=1to8:bd(r,n)=0:gosub270:next:goto290
  35. 350 ifc2>0andc2<9thenc=c2:fl=0:t2=0:bd(r,c)=1:goto370
  36. 360 goto290
  37. 370 gosub60
  38. 380 iffl=0thensp=r-1:x=c*40-7:y=r*24+33:gosub230:gosub590:ifr=8then420
  39. 390 ifflthengosub530:printsr$"[211]orry! [212]ry again, or [200]it c, r, or e"
  40. 400 ifflthenbd(r,c)=0:gosub570:fortt=1to300:next:goto290
  41. 410 nextr
  42. 420 gosub530:printsr$"[211][207][204][213][212][201][207][206]! [208]ress space bar to play again":gosub550
  43. 430 geta$:ifa$<>" "then430
  44. 440 gosub540:goto280
  45. 450 gosub530:printsr$"[215]orking on a solution..."
  46. 460 gosub60
  47. 470 if(fl=0)and(t2)then t2=0:flag=1:bd(r,c)=0:sp=r-1:gosub270:gosub590
  48. 480 iffl=0thensp=r-1:x=c*40-7:y=r*24+33:gosub230:gosub590:ifr=8then420
  49. 490 iffl=0thenbd(r,c)=1:r=r+1:c=1
  50. 500 ifflthenc=c+1:fl=0:ifc=9thenc=1:r=r-1:t2=1:ifr=0thenr=1:t2=0
  51. 510 geta$:ifa$<>""thengosub540:goto280
  52. 520 goto460
  53. 530 forn=1039to1063:poken,160:next:return
  54. 540 fornn=1to8:forn=1to8:bd(nn,n)=0:next:next:pokesr,0:return
  55. 550 pokesi+1,100:pokesi+5,27:pokesi+15,28:pokesi+24,15:pokesi+6,69
  56. 560 pokesi+4,21:forp=1to700:next:pokesi+4,20:return
  57. 570 pokesi+1,10:pokesi+6,240:pokesi+5,0:forpp=1to30:pokesi+4,17:forp=1to10:next
  58. 580 pokesi+4,16:forp=1to10:next:next:forp=1to1000:next:return
  59. 590 pokesi+1,45:pokesi+5,132:pokesi+6,132:pokesi+15,0
  60. 600 pokesi+4,17:forp=1to200:next:pokesi+4,16:return
  61. 610 fort=0to63:readd:poke 14*64+t,d:next:fort=bc+7tobc+14:poket,5:next
  62. 620 print"[144]                                        [149]";:fori=1to3:forz=1to3
  63. 630 printmt$;:nextz:forq=1to3:printtm$;:nextq,i:fori=1to3:printmt$;:next
  64. 640 fori=1to2:printtm$;:next:printleft$(tm$,43)""
  65. 650 forrt=1to7step2:poke944+120*rt,48+rt:poke1059+5*rt,48+rt:next
  66. 660 forrt=2to8step2:poke1059+5*rt,176+rt:poke944+120*rt,176+rt:next:return
  67. 670 data 0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,56,0,1,57,0,3,255,128,1,251,0
  68. 680 data 0,246,0,0,108,0,0,254,0,0,124,0,1,255,0,0,124,0,0,254,0,1,251,0
  69. 690 data 7,247,192,15,239,224,7,223,192,31,255,240,0
  70.