home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 114 / 114.d81 / logic (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  6KB  |  217 lines

  1. 10 poke52,56:poke51,0:clr
  2. 20 dv=peek(186):ifdv<8thendv=8
  3. 30 poke53281,15:poke53280,15:print"[147]"
  4. 40 sc=1024:z=40:co=54272
  5. 50 sys57812"logic font",dv,0:poke780,0:poke781,0:poke782,56:sys65493
  6. 60 poke53272,31
  7. 70 goto280
  8. 80 poke214,y:print:poke646,c
  9. 90 forii=0to4:printtab(x)"[[[[[":next
  10. 100 return
  11. 110 poke214,yb:print:poke646,c
  12. 120 printtab(xb)"[176]"left$(h$,xx)"[174]"
  13. 130 forii=1toyy:printtab(xb)"[221]"left$(sp$,xx)"[221]":next
  14. 140 printtab(xb)"[173]"left$(h$,xx)"[189]"
  15. 150 return
  16. 160 pd=sc+co+x+y*z:pq=peek(pd)and15
  17. 162 forj=0to10:pokepd,1
  18. 164 pokesc+x+y*z,29
  19. 166 pokepd,pq:fort=0to20:next
  20. 168 next:gosub230:return
  21. 170 pd=peek(sc+co+x+w*z)and15:forj=0to3
  22. 180 fori=0to4:pq=sc+x+z*i+w*z:pokepq+co,1
  23. 184 pokepq,29:pokepq+co,pd:fort=0to20:next:next
  24. 190 fori=0to4:pq=sc+v+i+y*z:pokepq+co,1
  25. 194 pokepq,29:pokepq+co,pd:fort=0to20:next
  26. 200 pokesc+x+y*z,28
  27. 210 next:next
  28. 220 gosub230:return
  29. 222 forj=0to8
  30. 224 print"";:poke214,y:print:printtab(x)b$
  31. 226 print"[144]";:poke214,y:print:printtab(x)b$:fort=0to20:next
  32. 228 next:gosub230:return
  33. 230 s=54272:pokes+1,130:pokes+5,9:pokes+15,30:pokes+24,15:pokes+4,21
  34. 240 fort=0to400:next:pokes+4,20
  35. 250 poke198,0:zz=0
  36. 252 pd=peek(214)-1:pq=peek(646):poke214,21:print:print" [208]ress a key"
  37. 260 zz=zz+1:geta$:ifa$=""andzz<800then260
  38. 262 poke214,21:print:print"            "
  39. 264 poke214,pd:print:poke646,pq
  40. 266 ifa$="q"then40000
  41. 270 return
  42. 280 forj=0to2:x=3+j*5:fori=0to2-j:y=2+5*i
  43. 290 c=11*((i+j)and1):gosub80:next:next
  44. 300 print"[144][208][209][210][211][212][203][204][205][206][207][198][199][200][201][202]"
  45. 310 print"":fori=1to15:printtab(1)chr$(192+i):next
  46. 320 goto380
  47. 330 fori=0to5:readx,y:pokesc+x+z*y,29:next
  48. 340 data3,5,14,6,7,7,12,7,11,12,4,15
  49. 350 fori=3to7:pokesc+10+z*i,29:next
  50. 360 fori=0to4:pokesc+8+i+6*z,29:next
  51. 370 pokesc+10+240,28
  52. 380 h$="[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]"
  53. 390 sp$="                               "
  54. 400 print""tab(22)"[193]-[197] [198]-[202] [203]-[207] [208]-[212]"
  55. 410 printtab(21)"[176][192][192][192][178][192][192][192][178][192][192][192][178][192][192][192][174]"
  56. 420 fori=0to3
  57. 430 printtab(21)"[221]   [221]   [221]   [221]   [221]"
  58. 440 printtab(21)"[171][192][192][192][219][192][192][192][219][192][192][192][219][192][192][192][179]"
  59. 450 next
  60. 460 printtab(21)"[221]   [221]   [221]   [221]   [221]"
  61. 470 printtab(21)"[173][192][192][192][177][192][192][192][177][192][192][192][177][192][192][192][189]"
  62. 480 print"":fori=0to4:printtab(23)chr$(193+i):print:next
  63. 490 xb=14:yb=11:xx=23:yy=10:c=6:gosub110
  64. 500 poke214,12:print:printtab(16)"[212]he first clue says
  65. 510 [153][163]16)"len is not (NULL). (NULL)o put an
  66. 520 printtab(16)"[216] where [195] crosses [208].
  67. 530 x[178]3:y[178]5:[141]160
  68. 540 [153][163]16)"(NULL)ikewise, chr$ is not (NULL).
  69. 550 x=8:y=9:gosub160
  70. 560 printtab(16)"[203] is not [210] or [212].
  71. 570 x[178]5:y[178]13:[141]160:x[178]7:y[178]13:[141]160
  72. 580 [153][163]16)"peek is not chr$.
  73. 590 x=14:y=4:gosub160
  74. 600 printtab(16)"[193]nd [201] is not [196].
  75. 610 x[178]16:y[178]6:[141]160
  76. 620 [141]110:[151]214,12:[153]
  77. 630 [153][163]16)"(NULL)he next clue says (NULL)
  78. 640 printtab(16)"is [195]. [208]ut a dot where
  79. 650 [153][163]16)"(NULL) crosses len and fill
  80. 660 printtab(16)"the rest of that row
  81. 670 [153][163]16)"and column with (NULL)s.
  82. 680 x=8:y=5:w=3:v=8:gosub170
  83. 690 printtab(16)"[215]henever you place a
  84. 700 [153][163]16)"dot, update the atn(NULL)(NULL)(NULL)val(NULL)
  85. 710 printtab(16)"[199][210][201][196].
  86. 720 x[178]31:y[178]5:b$[178]"(NULL)":[141]222
  87. 740 [141]110:[151]214,12:[153]
  88. 750 [153][163]16)"atnlso, when you place
  89. 760 printtab(16)"a dot, you can assume
  90. 770 [153][163]16)"that the rest of the
  91. 780 printtab(16)"information for both
  92. 790 [153][163]16)"letters matches.
  93. 810 printtab(16)"[211]o, [195]'s boxes should
  94. 820 [153][163]16)"look like (NULL)'s; an (NULL)
  95. 830 printtab(16)"for one is matched by
  96. 840 [153][163]16)"an (NULL) in the other.
  97. 850 gosub230
  98. 860 gosub110:poke214,12:print
  99. 870 printtab(16)"[195]'s boxes get two [216]s.
  100. 880 x[178]5:y[178]5:[141]160
  101. 890 x[178]7:y[178]5:[141]160
  102. 900 [153][163]16)"atnnd (NULL)'s boxes get
  103. 910 printtab(16)"one.
  104. 920 x[178]3:y[178]13:[141]160
  105. 930 [153][163]16)"atnnd finally, len-chr$
  106. 940 printtab(16)"gets an [216] to match
  107. 950 [153][163]16)"the (NULL) at chr$-(NULL).
  108. 960 x=14:y=5:gosub160
  109. 970 gosub110:poke214,12:print
  110. 980 printtab(16)"[207]kay, the next clue
  111. 990 [153][163]16)"says that right$ is (NULL). (NULL)o
  112. 1000 printtab(16)"place the dot and its
  113. 1010 [153][163]16)"(NULL)s.
  114. 1020 x=8:y=11:w=8:v=8:gosub170
  115. 1030 printtab(16)"[196]on't forget to add
  116. 1040 [153][163]16)"to the atn(NULL)(NULL)(NULL)val(NULL) chr$(NULL)right$str$.
  117. 1050 x=27:y=5:b$="[201]":gosub222
  118. 1070 gosub110:poke214,12:print
  119. 1080 printtab(16)"[215]henever you have two
  120. 1090 [153][163]16)"dots in the same row
  121. 1100 printtab(16)"or column, there is
  122. 1110 [153][163]16)"another dot to place.
  123. 1120 printtab(16)"[201]n this case, [195]-[201]
  124. 1130 [153][163]16)"gets a dot.
  125. 1140 x=16:y=5:w=3:v=13:gosub170
  126. 1150 printtab(16)"[205]ake [201]'s boxes the
  127. 1160 [153][163]16)"same as len's.
  128. 1170 x=3:y=11:gosub160
  129. 1180 x=5:y=11:gosub160
  130. 1190 x=7:y=11:gosub160
  131. 1200 gosub110:poke214,12:print
  132. 1210 printtab(16)"[206]ow let's say that [194]
  133. 1220 [153][163]16)"is (NULL), according to
  134. 1230 printtab(16)"the next clue. [208]ut a
  135. 1240 [153][163]16)"dot at peek-(NULL).
  136. 1250 x=6:y=4:w=3:v=3:gosub170
  137. 1260 printtab(16)"[205]ake [194]'s boxes and
  138. 1270 [153][163]16)"(NULL)'s the same and
  139. 1280 printtab(16)"update the [193][206][211][215][197][210]
  140. 1290 [153][163]16)"chr$(NULL)right$str$.
  141. 1300 x=6:y=9:gosub160
  142. 1310 x=6:y=11:gosub160
  143. 1312 x=6:y=13:gosub160
  144. 1320 x=35:y=3:b$="[211]":gosub222
  145. 1330 gosub110:poke214,12:print
  146. 1340 printtab(16)"[206]otice that there are
  147. 1350 [153][163]16)"three rows that have
  148. 1360 printtab(16)"four [216]s in them. [212]he
  149. 1370 [153][163]16)"empty boxes (NULL)(NULL)(NULL)(NULL) have
  150. 1380 printtab(16)"dots in them. [208]lace
  151. 1390 [153][163]16)"dots at len-(NULL), right$-(NULL) and
  152. 1392 printtab(16)"[203]-[209].
  153. 1400 x[178]4:y[178]5:w[178]3:v[178]3:[141]170
  154. 1410 x[178]4:y[178]11:w[178]8:v[178]3:[141]170
  155. 1412 x[178]4:y[178]13:w[178]13:v[178]3:[141]170
  156. 1414 [141]110:[151]214,13:[153]
  157. 1420 [153][163]16)"(NULL)pdate the atn(NULL)(NULL)(NULL)val(NULL)
  158. 1430 printtab(16)"[199][210][201][196] and continue
  159. 1432 [153][163]16)"with the rest of
  160. 1434 printtab(16)"the clues.
  161. 1440 x[178]35:y[178]5:b$[178]"(NULL)":[141]222
  162. 1510 [141]110:[151]214,13:[153]
  163. 1520 [153][163]16)"(NULL)hings to remember:
  164. 1521 printtab(16)"(1) [215]henever you
  165. 1522 [153][163]16)"(NULL)(NULL)(NULL)(NULL) a fact, place a
  166. 1523 printtab(16)"dot and fill the row
  167. 1524 [153][163]16)"and column (in that
  168. 1525 printtab(16)"section) with [216]s.
  169. 1526 [141]230
  170. 1528 [141]110:[151]214,13:[153]
  171. 1530 [153][163]16)"(2) (NULL)hen there's
  172. 1540 printtab(16)"only one box that's
  173. 1550 [153][163]16)"not an (NULL), then that
  174. 1560 printtab(16)"box gets a dot.
  175. 1570 [141]230
  176. 1580 [141]110:[151]214,13:[153]
  177. 1590 [153][163]16)"(3) (NULL)henever a dot
  178. 1600 printtab(16)"is placed, the two
  179. 1610 [153][163]16)"letters' rows and
  180. 1620 printtab(16)"columns should be
  181. 1630 [153][163]16)"made to match, (NULL) for
  182. 1640 printtab(16)"[216], dot for dot.
  183. 1650 [141]230
  184. 1660 [141]110:[151]214,13:[153]
  185. 1670 [153][163]16)"(4) (NULL)eep the atn(NULL)(NULL)(NULL)val(NULL)
  186. 1680 printtab(16)"[199][210][201][196] updated every
  187. 1690 [153][163]16)"time you place a dot.
  188. 1700 printtab(16)"[207]ften the [199][210][201][196] will
  189. 1710 [153][163]16)"help more than the
  190. 1720 printtab(16)"chart will.
  191. 1730 [141]230
  192. 1740 [141]110:[151]214,13:[153]
  193. 1750 [153][163]16)"(5) right$f one of the
  194. 1760 printtab(16)"fields is sequential,
  195. 1770 [153][163]16)"or ordered, use that
  196. 1780 printtab(16)"field as the first
  197. 1790 [153][163]16)"column; as column
  198. 1800 printtab(16)"[193]-[197] was in the demo.
  199. 1810 [141]230
  200. 1820 [141]110:[151]214,13:[153]
  201. 1830 [153][163]16)"(NULL)ress str$ to see the
  202. 1840 printtab(16)"demo again.
  203. 1850 [153][163]16)"(NULL)ress any other key
  204. 1860 printtab(16)