home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 164 / 164.d81 / b.solve myschess (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1998-01-01  |  11.2 KB  |  299 lines

  1. 5 dv=peek(186):ifdv<8thendv=8
  2. 8 poke53371,0
  3. 10 dimm%(5,5,27)
  4. 20 dime(5),e$(5),f(8),h(5)
  5. 30 dims(88),s1%(120,5),s2%(120,88),t%(120)
  6. 40 dimg%(50,2),g$(50)
  7. 50 k$="[150]  [144]  [150]  [144]  [150]  [144]  [150]  [144]  [146]":l$="[144]  [150]  [144]  [150]  [144]  [150]  [144]  [150]  [144][146]"
  8. 60 m$="[150] [144] [150] [144] [150] [144] [150] [144] [146]":n$="[144] [150] [144] [150] [144] [150] [144] [150] [144][146]"
  9. 70 gosub1510:fori=1to5:readh(i):next
  10. 80 print"-[199]enerating matrix of moves."
  11. 90 fori=1to5:m%(1,i,0)=0
  12. 100 ife(i)-10*int(e(i)/10+.01)<3ore(i)>78then120
  13. 110 m%(1,i,0)=m%(1,i,0)+1:m%(1,i,m%(1,i,0))=e(i)+8
  14. 120 ife(i)-10*int(e(i)/10+.01)=1ore(i)>68then140
  15. 130 m%(1,i,0)=m%(1,i,0)+1:m%(1,i,m%(1,i,0))=e(i)+19
  16. 140 ife(i)-10*int(e(i)/10+.01)=8ore(i)>67then160
  17. 150 m%(1,i,0)=m%(1,i,0)+1:m%(1,i,m%(1,i,0))=e(i)+21
  18. 160 ife(i)-10*int(e(i)/10+.01)>6ore(i)>76then180
  19. 170 m%(1,i,0)=m%(1,i,0)+1:m%(1,i,m%(1,i,0))=e(i)+12
  20. 180 ife(i)-10*int(e(i)/10+.01)>6ore(i)<21then200
  21. 190 m%(1,i,0)=m%(1,i,0)+1:m%(1,i,m%(1,i,0))=e(i)-8
  22. 200 ife(i)-10*int(e(i)/10+.01)=8ore(i)<31then220
  23. 210 m%(1,i,0)=m%(1,i,0)+1:m%(1,i,m%(1,i,0))=e(i)-19
  24. 220 ife(i)-10*int(e(i)/10+.01)=1ore(i)<32then240
  25. 230 m%(1,i,0)=m%(1,i,0)+1:m%(1,i,m%(1,i,0))=e(i)-21
  26. 240 ife(i)-10*int(e(i)/10+.01)<3ore(i)<23then260
  27. 250 m%(1,i,0)=m%(1,i,0)+1:m%(1,i,m%(1,i,0))=e(i)-12
  28. 260 next
  29. 270 fori=1to5:m%(2,i,0)=0
  30. 280 l1=e(i)-10*int(e(i)/10+.01):l2=int(e(i)/10+.01):ifl1=1orl2=8then310
  31. 290 l3=l1-1:if8-l2<l3thenl3=8-l2
  32. 300 forj=1tol3:m%(2,i,0)=m%(2,i,0)+1:m%(2,i,m%(2,i,0))=e(i)+9*j:next
  33. 310 l1=e(i)-10*int(e(i)/10+.01):l2=int(e(i)/10+.01):ifl1=8orl2=8then340
  34. 320 l3=8-l1:if8-l2<l3thenl3=8-l2
  35. 330 forj=1tol3:m%(2,i,0)=m%(2,i,0)+1:m%(2,i,m%(2,i,0))=e(i)+11*j:next
  36. 340 l1=e(i)-10*int(e(i)/10+.01):l2=int(e(i)/10+.01):ifl1=8orl2=1then370
  37. 350 l3=8-l1:ifl2-1<l3thenl3=l2-1
  38. 360 forj=1tol3:m%(2,i,0)=m%(2,i,0)+1:m%(2,i,m%(2,i,0))=e(i)-9*j:next
  39. 370 l1=e(i)-10*int(e(i)/10+.01):l2=int(e(i)/10+.01):ifl1=1orl2=1then400
  40. 380 l3=l1-1:ifl2-1<l3thenl3=l2-1
  41. 390 forj=1tol3:m%(2,i,0)=m%(2,i,0)+1:m%(2,i,m%(2,i,0))=e(i)-11*j:next
  42. 400 next
  43. 410 fori=1to5:m%(3,i,0)=0
  44. 420 l2=int(e(i)/10+.01):ifl2=8then440
  45. 430 forj=1to8-l2:m%(3,i,0)=m%(3,i,0)+1:m%(3,i,m%(3,i,0))=e(i)+10*j:next
  46. 440 l1=e(i)-10*int(e(i)/10+.01):ifl1=8then460
  47. 450 forj=1to8-l1:m%(3,i,0)=m%(3,i,0)+1:m%(3,i,m%(3,i,0))=e(i)+j:next
  48. 460 l2=int(e(i)/10+.01):ifl2=1then480
  49. 470 forj=1tol2-1:m%(3,i,0)=m%(3,i,0)+1:m%(3,i,m%(3,i,0))=e(i)-10*j:next
  50. 480 l1=e(i)-10*int(e(i)/10+.01):ifl1=1then500
  51. 490 forj=1tol1-1:m%(3,i,0)=m%(3,i,0)+1:m%(3,i,m%(3,i,0))=e(i)-j:next
  52. 500 next
  53. 510 fori=1to5:m%(4,i,0)=m%(2,i,0)+m%(3,i,0)
  54. 520 forj=1tom%(2,i,0):m%(4,i,j)=m%(2,i,j):next
  55. 530 forj=1tom%(3,i,0):m%(4,i,m%(2,i,0)+j)=m%(3,i,j):next
  56. 540 next
  57. 550 fori=1to5:m%(5,i,0)=0
  58. 560 l1=e(i)-10*int(e(i)/10+.01):l2=int(e(i)/10+.01):ifl1=1orl2=8then580
  59. 570 m%(5,i,0)=m%(5,i,0)+1:m%(5,i,m%(5,i,0))=e(i)+9
  60. 580 l1=e(i)-10*int(e(i)/10+.01):l2=int(e(i)/10+.01):ifl1=8orl2=8then600
  61. 590 m%(5,i,0)=m%(5,i,0)+1:m%(5,i,m%(5,i,0))=e(i)+11
  62. 600 l1=e(i)-10*int(e(i)/10+.01):l2=int(e(i)/10+.01):ifl1=8orl2=1then620
  63. 610 m%(5,i,0)=m%(5,i,0)+1:m%(5,i,m%(5,i,0))=e(i)-9
  64. 620 l1=e(i)-10*int(e(i)/10+.01):l2=int(e(i)/10+.01):ifl1=1orl2=1then640
  65. 630 m%(5,i,0)=m%(5,i,0)+1:m%(5,i,m%(5,i,0))=e(i)-11
  66. 640 l2=int(e(i)/10+.01):ifl2=8then660
  67. 650 m%(5,i,0)=m%(5,i,0)+1:m%(5,i,m%(5,i,0))=e(i)+10
  68. 660 l1=e(i)-10*int(e(i)/10+.01):ifl1=8then680
  69. 670 m%(5,i,0)=m%(5,i,0)+1:m%(5,i,m%(5,i,0))=e(i)+1
  70. 680 l2=int(e(i)/10+.01):ifl2=1then700
  71. 690 m%(5,i,0)=m%(5,i,0)+1:m%(5,i,m%(5,i,0))=e(i)-10
  72. 700 l1=e(i)-10*int(e(i)/10+.01):ifl1=1then720
  73. 710 m%(5,i,0)=m%(5,i,0)+1:m%(5,i,m%(5,i,0))=e(i)-1
  74. 720 next
  75. 730 print"[145]-[199]enerating matrix of permutations."
  76. 740 s1%(0,0)=0:forl5=1to5
  77. 750 forl4=1to5:ifl4=l5then850
  78. 760 forl3=1to5:ifl3=l4orl3=l5then840
  79. 770 forl2=1to5:ifl2=l3orl2=l4orl2=l5then830
  80. 780 l1=15-l5-l4-l3-l2
  81. 790 s1%(0,0)=s1%(0,0)+1
  82. 800 f(1)=l1:f(2)=l2:f(3)=l3:f(4)=l4:f(5)=l5
  83. 810 fori=1to5:forj=1to5:iff(j)=ithens1%(s1%(0,0),i)=j:j=5
  84. 820 next:next
  85. 830 nextl2
  86. 840 nextl3
  87. 850 nextl4
  88. 860 nextl5
  89. 870 print"[145]-[199]enerating matrix of combined hits."
  90. 880 fori=1to120
  91. 890 forj=1to5
  92. 900 fork=1tom%(j,s1%(i,j),0)
  93. 910 s2%(i,m%(j,s1%(i,j),k))=s2%(i,m%(j,s1%(i,j),k))+1
  94. 920 next:next:next
  95. 930 print"[145]-[199]enerating table of legal boards.  ":f(6)=0:f(7)=0:f(8)=0
  96. 940 ifg%(0,1)=0thent%(0)=120:fori=1to120:t%(i)=i:next:f(6)=120:f(7)=120:goto1010
  97. 950 fori=1tot%(0)
  98. 960 ifs2%(t%(i),g%(g%(0,1),1))<>g%(g%(0,1),2)then980
  99. 970 f(6)=f(6)+1:t%(f(6))=t%(i):f(8)=f(7):f(7)=t%(i)
  100. 980 next:t%(0)=f(6)
  101. 990 ift%(0)=0then2640
  102. 1000 ift%(0)=1then1420
  103. 1010 print"[145]-[199]enerating matrix to compare squares."
  104. 1020 fori=11to88:s(i)=0:next
  105. 1030 fori=11to81step10:forj=0to7:fork=0to5:f(k)=0:next
  106. 1040 fork=1tot%(0):f(s2%(t%(k),i+j))=f(s2%(t%(k),i+j))+1:next
  107. 1050 fork=0to5:s(i+j)=s(i+j)+abs(f(k)-t%(0)/6):next
  108. 1060 nextj,i
  109. 1070 if se=1 then1270
  110. 1080 fori=1to5:s(e(i))=500:next
  111. 1090 if t%(0)>2 then1270
  112. 1100 fl=0:fori=11to81step10:forj=0to7
  113. 1110 if s2%(f(7),i+j)=s2%(f(8),i+j) then1150
  114. 1120 fork=1to5:ife(k)=i+j thenk=9
  115. 1130 next:if k>9 then1150
  116. 1140 fl=1:j=7:i=81
  117. 1150 nextj,i:if fl=1 then1270
  118. 1160 print"[147][199]uessing at complete arrangement:"
  119. 1170 print"[211]quare ?s:";g%(0,1);"      [208]osition ?s: 1":gosub2500
  120. 1180 print" [203]night on ";e$(s1%(f(8),1));","
  121. 1190 print" [194]ishop on ";e$(s1%(f(8),2));","
  122. 1200 print" [210]ook   on ";e$(s1%(f(8),3));","
  123. 1210 print" [209]ueen  on ";e$(s1%(f(8),4));", and"
  124. 1220 print" [203]ing   on ";e$(s1%(f(8),5));".":print
  125. 1230 print"[201]s this right (y/n)? ";:poke198,0
  126. 1240 geta$:if ((a$<>"y") and (a$<>"n")) then goto1240
  127. 1250 if (a$="y") then print"[217]es.":goto1500
  128. 1260 g%(0,1)=g%(0,1)+1:g%(g%(0,1),1)=f(8)+1000:print"[206]o.":goto1420
  129. 1270 print"[145]-[211]electing best scoring square.       "
  130. 1280 if (g%(0,1)<1) then goto1300
  131. 1290 fori=1tog%(0,1):s(g%(i,1))=999:next
  132. 1300 g%(0,1)=g%(0,1)+1:g%(g%(0,1),1)=11
  133. 1310 fori=11to81step10:forj=0to7
  134. 1320 if (s(i+j)<s(g%(g%(0,1),1))) then g%(g%(0,1),1)=i+j
  135. 1330 nextj,i
  136. 1340 print"[147]";t%(0);"permutations are possible.":print
  137. 1350 print"[199]uess";g%(0,1);"is square ";
  138. 1360 a$=str$(g%(g%(0,1),1)):b$=chr$((asc(right$(a$,1)))+16):printb$;
  139. 1370 c$=chr$(asc(right$(left$(a$,2),1))):printc$;".":g$(g%(0,1))=b$+c$
  140. 1380 gosub2420
  141. 1390 print"[200]ow many men attack this square?";:poke198,0
  142. 1400 geta$:if ((a$<"0") or (a$>"5")) then goto1400
  143. 1410 g%(g%(0,1),2)=val(a$):printval(a$):print:goto930
  144. 1420 print"[147][211]olution found after";g%(0,1);"guess";
  145. 1430 ifg%(0,1)<>1thenprint"es";
  146. 1440 print".":gosub2570
  147. 1450 print"[203]night on square ";e$(s1%(f(7),1));","
  148. 1460 print"[194]ishop on square ";e$(s1%(f(7),2));","
  149. 1470 print"[210]ook on square   ";e$(s1%(f(7),3));","
  150. 1480 print"[209]ueen on square  ";e$(s1%(f(7),4));", and"
  151. 1490 print"[203]ing on square   ";e$(s1%(f(7),5));"."
  152. 1500 goto2740
  153. 1510 poke53280,13:poke53281,13:print"[147]";chr$(14);"[144]     [212]o [211]olve [205]ystery [211]quare [195]hess":print
  154. 1520 printtab(7);"[208]rogrammed by [198]loyd [203]irk":print
  155. 1530 print"  [212]his program is to solve the problem"
  156. 1540 print"generated by the [205]ystery [211]quare [195]hess"
  157. 1550 print"program or by a person. [198]ive squares"
  158. 1560 print"are chosen on a chessboard and their"
  159. 1570 print"coordinates given to this program. [212]he"
  160. 1580 print"program will place a [203]night, [194]ishop,"
  161. 1590 print"[210]ook, [209]ueen, and [203]ing on the five"
  162. 1600 print"mystery squares by asking only 2 types"
  163. 1610 print"of questions:"
  164. 1620 print" 1. [215]hen the pieces are properly set up,";
  165. 1630 print"    how many attack [212][200][201][211] square?"
  166. 1640 print" 2. [201]s this the correct position?"
  167. 1650 print"  [193]s the piece names suggest, these have";
  168. 1660 print"the attacking abilities of their chess"
  169. 1670 print"counterparts, except that they can"
  170. 1680 print"attack [212][200][210][207][213][199][200] any other piece. [197]ach"
  171. 1690 print"man attacks as though it is the only"
  172. 1700 print"man on the board."
  173. 1710 printtab(5);"<-[208]ress space-bar for more.->":poke198,0
  174. 1712 fori=217to242:pokei,peek(i)or128:next
  175. 1720 geta$:ifa$=""then1720
  176. 1730 print"[147]   [212]he [193]ttack [208]atterns of the [208]ieces":print
  177. 1740 print"[206] = [203]night  [194] = [194]ishop  [209] = [209]ueen"
  178. 1750 print"[210] = [210]ook  [203] = [203]ing  x = [193]ttacked [211]quare":print
  179. 1760 print" [150]x[144] [150] [144] [150] [144] [150] [144] [146]  [150] [144] [150] [144]x[150] [144] [150] [144] [146] ";
  180. 1770 print" [150] [144] [150] [144]x[150] [144] [150] [144]x[146]  ";m$
  181. 1780 print" [144] [150]x[144] [150] [144] [150] [144] [150]x[146]  [144] [150] [144] [150]x[144] [150] [144] [150] [146][144] ";
  182. 1790 print" [144]x[150] [144] [150]x[144] [150] [144]x[150] [146]  [144] [150] [144] [150]x[144] [150]x[144] [150] [146][144] ";
  183. 1800 print" [150] [144] [150]x[144] [150] [144] [150]x[144] [146]  [150] [144] [150] [144]x[150] [144] [150] [144] [146] ";
  184. 1810 print" [150] [144]x[150] [144]x[150] [144]x[150] [144] [146]  [150] [144] [150]x[144] [150] [144] [150]x[144] [146] ";
  185. 1820 print" [144] [150] [144] [150]x[144] [150]x[144] [150] [146]  [144]x[150]x[144]x[150][210][144]x[150]x[144]x[150]x[146][144] ";
  186. 1830 print" [144] [150] [144]x[150]x[144]x[150] [144] [150] [146]  [144] [150] [144] [150] [144][206][150] [144] [150] [146][144] ";
  187. 1840 print" [150] [144] [150] [144] [150][194][144] [150] [144] [146]  [150] [144] [150] [144]x[150] [144] [150] [144] [146] ";
  188. 1850 print" [150]x[144]x[150]x[144][209][150]x[144]x[150]x[144]x[146]  [150] [144] [150]x[144] [150] [144] [150]x[144] [146] ";
  189. 1860 print" [144] [150] [144] [150]x[144] [150]x[144] [150] [146]  [144] [150] [144] [150]x[144] [150] [144] [150] [146][144] ";
  190. 1870 print" [144] [150] [144]x[150]x[144]x[150] [144] [150] [146]  [144] [150] [144] [150]x[144] [150]x[144] [150] [146][144] ";
  191. 1880 print" [150] [144] [150]x[144] [150] [144] [150]x[144] [146]  [150] [144] [150] [144]x[150] [144] [150] [144] [146] ";
  192. 1890 print" [150] [144]x[150] [144]x[150] [144]x[150] [144] [146]  ";m$
  193. 1900 print" [144] [150]x[144] [150] [144] [150] [144] [150]x[146]  [144] [150] [144] [150]x[144] [150] [144] [150] [146][144] ";
  194. 1910 print" [144]x[150] [144] [150]x[144] [150] [144]x[150] [146]  ";n$:print
  195. 1920 print" ";m$;"  [194] attacks diagonally."
  196. 1930 print" ";n$;"  [210] vertically & horizontally."
  197. 1940 print" [150] [144]x[150]x[144]x[150] [144] [150] [144] [146]  [209] combines [194] and [210] attacks."
  198. 1950 print" [144] [150]x[144][203][150]x[144] [150] [144] [150] [144][146]  [206] 2 over and 1 across."
  199. 1960 print" [150] [144]x[150]x[144]x[150] [144] [150] [144] [146]  [203] attacks nearest squares."
  200. 1970 print" ";n$
  201. 1980 print" ";m$;"  [206]o man attacks its own square";
  202. 1990 print" ";n$;"  [206]o attack crosses board edge."
  203. 2000 printtab(5);"<-[208]ress space-bar for more.->":poke198,0
  204. 2002 fori=217to242:pokei,peek(i)or128:next
  205. 2010 geta$:ifa$=""then2010
  206. 2020 print"[147]";tab(5);"[197]ntering the [205]ystery [211]quares":print
  207. 2030 print"  [212]ype the [204][197][212][212][197][210] of the column and then";
  208. 2040 print"type the [206][213][205][194][197][210] of the row containing"
  209. 2050 print"the mystery square. [210]epeat for all five."
  210. 2060 printtab(14);"8 ";m$:printtab(14);"7 ";n$:printtab(14);"6 ";m$:printtab(14);"5 ";n$
  211. 2070 printtab(14);"4 ";m$:printtab(14);"3 ";n$:printtab(14);"2 ";m$:printtab(14);"1 ";n$
  212. 2080 printtab(16);"abcdefgh":print
  213. 2090 fori=1to7:print"                          ":next:print"[145][145][145][145][145][145][145]";
  214. 2100 fori=1to5
  215. 2110 print"[205]ystery square";i;"is on:   [157][157]";:poke198,0
  216. 2112 forz=217to242:pokez,peek(z)or128:next
  217. 2120 geta$:ifa$=""then2120
  218. 2130 ifa$<"a"ora$>"h"then2120
  219. 2140 printa$;:e$(i)=a$:e(i)=asc(a$)-64
  220. 2150 geta$:ifa$=""then2150
  221. 2160 ifa$<"1"ora$>"8"then2150
  222. 2170 printa$:e$(i)=e$(i)+a$:e(i)=e(i)+val(a$)*10:
  223. 2180 ifi=1then2210
  224. 2190 fl=0:forj=1toi-1:ife(j)=e(i)thenfl=1:j=i
  225. 2200 next:iffl=1thenprint"[145]";:goto2110
  226. 2210 poke1599-val(a$)*40+asc(left$(e$(i),1))-64,170:next
  227. 2220 print:print"[201]s this correct (y/n)? ";:poke198,0
  228. 2230 geta$:ifa$<>"y"anda$<>"n"then2230
  229. 2240 ifa$="n"ora$="[206]"thenprint"[206]o.":goto2020
  230. 2250 ifa$<>"y"anda$<>"[217]"then2230
  231. 2260 print"[217]es."
  232. 2270 print"[147]";"    [193]sking about the [205]ystery [211]quares":print
  233. 2280 print"  [212]he original version of this game did"
  234. 2290 print"not allow a person to ask how many times";
  235. 2300 print"the mystery squares themselves were"
  236. 2310 print"attacked. [201] found that allowing such"
  237. 2320 print"questions led to an elegant solution."
  238. 2330 print"[217]ou may choose which version the"
  239. 2340 print"computer is to play.":print
  240. 2350 print"[211]elect one: ([208]ress 1 or 2)"
  241. 2360 print"1. [195][193][206] ask # attacks on mystery squares.";
  242. 2370 print"2. [195]an [206][207][212] query mystery squares.":print:poke198,0
  243. 2372 fori=217to242:pokei,peek(i)or128:next
  244. 2380 geta$:if ((a$<>"1") and (a$<>"2")) then goto2380
  245. 2390 se=val(a$):print"[195]omputer [195][193][206] ";:if (se=1) then2410
  246. 2400 print"[206][207][212] ";
  247. 2410 print"query mystery squares.":print:return
  248. 2420 print:printtab(10);"8 ";k$:printtab(12);k$:printtab(10);"7 ";l$:printtab(12);l$
  249. 2430 printtab(10);"6 ";k$:printtab(12);k$:printtab(10);"5 ";l$:printtab(12);l$
  250. 2440 printtab(10);"4 ";k$:printtab(12);k$:printtab(10);"3 ";l$:printtab(12);l$
  251. 2450 printtab(10);"2 ";k$:printtab(12);k$:printtab(10);"1 ";l$:printtab(12);l$
  252. 2460 printtab(12);"a b c d e f g h":print
  253. 2470 fori=1to5:poke1834-val(right$(e$(i),1))*80+(asc(left$(e$(i),1))-64)*2,170:next
  254. 2480 poke1875-val(c$)*80+(asc(b$)-64)*2,191
  255. 2490 return
  256. 2500 print:printtab(14);"8 ";m$:printtab(14);"7 ";n$:printtab(14);"6 ";m$:printtab(14);"5 ";n$
  257. 2510 printtab(14);"4 ";m$:printtab(14);"3 ";n$:printtab(14);"2 ";m$:printtab(14);"1 ";n$
  258. 2520 printtab(16);"abcdefgh":print
  259. 2530 fori=1to5
  260. 2540 poke1479-val(right$(e$(s1%(f(8),i)),1))*40+asc(left$(e$(s1%(f(8),i)),1))-64,h(i)
  261. 2550 next
  262. 2560 return
  263. 2570 print:printtab(14);"8 ";m$:printtab(14);"7 ";n$:printtab(14);"6 ";m$:printtab(14);"5 ";n$
  264. 2580 printtab(14);"4 ";m$:printtab(14);"3 ";n$:printtab(14);"2 ";m$:printtab(14);"1 ";n$
  265. 2590 printtab(16);"abcdefgh":print
  266. 2600 fori=1to5
  267. 2610 poke1439-val(right$(e$(s1%(f(7),i)),1))*40+asc(left$(e$(s1%(f(7),i)),1))-64,h(i)
  268. 2620 next
  269. 2630 return
  270. 2640 print"[147][206]o solution found; please check answers."
  271. 2650 printtab(10);"8 ";k$:printtab(12);k$:printtab(10);"7 ";l$:printtab(12);l$
  272. 2660 printtab(10);"6 ";k$:printtab(12);k$:printtab(10);"5 ";l$:printtab(12);l$
  273. 2670 printtab(10);"4 ";k$:printtab(12);k$:printtab(10);"3 ";l$:printtab(12);l$
  274. 2680 printtab(10);"2 ";k$:printtab(12);k$:printtab(10);"1 ";l$:printtab(12);l$
  275. 2690 printtab(12);"a b c d e f g h":print
  276. 2700 fori=1to5:poke1754-val(right$(e$(i),1))*80+(asc(left$(e$(i),1))-64)*2,170:next
  277. 2710 fori=1tog%(0,1)
  278. 2720 poke1795-val(right$(g$(i),1))*80+(asc(left$(g$(i),1))-64)*2,g%(i,2)+176
  279. 2730 next
  280. 2740 goto3000
  281. 2750 data206,194,210,209,203
  282. 3000 print"   [144]([193][144])nother puzzle
  283. 3010 [153]"   ((NULL)stop)(NULL)atnstr$(NULL)(NULL)atn(NULL)
  284. 3030 poke198,0
  285. 3040 geta$:ifa$<>"a"anda$<>"l"then3040
  286. 3050 ifa$="l"then40000
  287. 3070 run
  288. 10000 d=peek(186):n$="b.solve myschess":open15,d,15,"s0:"+n$:close15:saven$,d:end
  289. 40000 fori=8to29:poke820+i,i:next:ifdv>8anddv<30thenpoke828,dv:poke820+dv,8
  290. 40010 a$="presenter":gosub40030:a$="hello connect":gosub40030
  291. 40020 print"[147]":poke53272,23:poke186,8:poke2048,0:poke44,8:poke43,1:end
  292. 40030 forj=8to29:i=peek(820+j):ifi=14thennext
  293. 40040 close2:open2,i,2:close2:ifstthen40060
  294. 40050 close15:open15,i,15,"r0:"+a$+"="+a$:input#15,er:close15:ifer=63then40070
  295. 40060 next:return
  296. 40070 a$="hello connect":q$=chr$(34):poke646,peek(53281):print"[147]":poke53272,23
  297. 40080 print"[147]p[207]2048,0:p[207]44,8:p[207]43,1:p[207]56,160:p[207]55,0:clr:l[207]"q$a$q$","i
  298. 40090 print"run:":poke631,13:poke632,13:poke198,2:end
  299.