home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 46 / 046.d81 / solitaire (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  13KB  |  417 lines

  1. 10 poke53281,0:poke53280,11:printchr$(14):bo$="[176][192][174][157][157][157][221][221][157][157][157][173][192][189]"
  2. 20 dimt(52),a(52),s(52),w(5,48),ws(5)
  3. 30 x=rnd(-ti):gosub2260
  4. 40 s=54272:js=56320
  5. 50 fori=1to24:pokes+i,0:next
  6. 60 fori=1to52:t(i)=0:next
  7. 70 fori=1to3:a(i)=193:next:rem a
  8. 80 fori=4to7:a(i)=202:next:rem j
  9. 90 fori=8to11:a(i)=209:next:rem q
  10. 100 fori=12to15:a(i)=203:next:rem k
  11. 110 fori=16to19:a(i)=176:next:rem 0
  12. 120 fori=20to22:a(i)=178:next:rem2
  13. 130 fori=23to25:a(i)=179:next:rem 3
  14. 140 fori=26to28:a(i)=180:next:rem 4
  15. 150 fori=29to32:a(i)=181:next:rem 5
  16. 160 fori=33to36:a(i)=182:next:rem 6
  17. 170 fori=37to40:a(i)=183:next:rem 7
  18. 180 fori=41to44:a(i)=184:next:rem 8
  19. 190 fori=45to48:a(i)=185:next:rem 9
  20. 200 a(49)=193:a(50)=178:a(51)=179:a(52)=180
  21. 210 ifpz=1thenzz=48
  22. 220 ifpz=2thenzz=52
  23. 230 fori=1tozz
  24. 240 r=int(rnd(1)*zz)+1
  25. 250 ift(r)=1then240
  26. 260 s(i)=a(r):t(r)=1
  27. 270 next
  28. 280 ifpz=2then1180
  29. 290 :
  30. 300 sk=48:fori=1to5:ws(i)=0:w(i,0)=160:next:s(0)=160
  31. 310 x=1837:gosub850
  32. 320 pokex,s(sk):pokex+s,13
  33. 330 fori=0to9step3:poke1840+i+s,7:next
  34. 340 :
  35. 350 mk=0
  36. 360 pokex,peek(x)-128
  37. 370 print"[154][211]tack:"sk"[157] "
  38. 375 pokex,peek(x)+128
  39. 380 joy=15-(peek(js)and15):fb=peek(js)and16:getk$
  40. 390 ifjoy=8ork$=""thengosub1090
  41. 400 ifjoy=4ork$="[157]"thengosub1110
  42. 410 ifjoy=1ork$="[145]"thengosub1130
  43. 420 ifjoy=2ork$=""thengosub1150
  44. 430 iffb=0ork$=chr$(13)then480
  45. 440 ifk$="q"thenrun
  46. 450 pokex,peek(x)-128:fort=1to25:next
  47. 460 goto370
  48. 470 :
  49. 480 gosub2120:mk=mk+1:ifmk=2then530
  50. 490 ifx<>1837andx<>1840andx<>1843andx<>1846andx<>1849thengosub2030:goto350
  51. 500 ifpeek(x)=160thengosub2030:goto350
  52. 510 b=peek(x):c=x:pile=(x-1837)/3+1:goto360
  53. 520 :
  54. 530 ifpile=1then610
  55. 540 ifpeek(x)<>160thengosub2030:goto350
  56. 550 ifpeek(x+80)<>b-128thengosub2030:goto350
  57. 560 ifpeek(x-3)<161thengosub2030:goto350
  58. 570 pokex,b:pokex+s,14:gosub60100
  59. 580 ws(pi)=ws(pi)-1:pokec,w(pi,ws(pi))
  60. 590 goto740
  61. 600 :
  62. 610 ifx=1840orx=1843orx=1846orx=1849then690
  63. 620 ifpeek(x)<>160thengosub2030:goto350
  64. 630 ifpeek(x+80)<>b-128thengosub2030:goto350
  65. 640 ifpeek(x-3)<161thengosub2030:goto350
  66. 650 pokex,b:pokex+s,14:gosub60100
  67. 660 sk=sk-1:poke1837,s(sk)
  68. 670 goto740
  69. 680 :
  70. 690 z=(x-1837)/3+1
  71. 700 ws(z)=ws(z)+1:w(z,ws(z))=b
  72. 710 pokex,b:pokex+s,7
  73. 720 goto660
  74. 730 :
  75. 740 q=peek(1837)+peek(1840)+peek(1843)+peek(1846)+peek(1849)
  76. 750 ifq<>5*160then350
  77. 760 :
  78. 770 print""tab(6)"         [211]uccess!          "
  79. 780 fori=3to11:poke53280,i:gosub2120:next
  80. 790 fort=1to1000:next
  81. 800 print""tab(6)" [208]ress [153][198][201][210][197] to play again. "
  82. 810 fb=peek(js)and16:iffbthen810
  83. 820 run
  84. 830 end
  85. 840 :
  86. 850 print"[147][156]     [176][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][174]"
  87. 860 print"     [221][154]   [195]alculation [211]olitaire   [146][156][221]"
  88. 870 print"     [173][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][189]"
  89. 880 a$="[176][192][174]":b$="[221][154] [146][221]":c$="[173][192][189]"
  90. 890 fori=1to4
  91. 900 forj=1to13:printa$;:next:print
  92. 910 forj=1to13:printb$;:next:print
  93. 920 forj=1to13:printc$;:next:print
  94. 930 print:next
  95. 940 :
  96. 950 printtab(12):forj=1to5:printa$;:next:print
  97. 960 printtab(12):forj=1to5:printb$;:next:print
  98. 970 printtab(12):forj=1to5:printc$;:next:print
  99. 980 print"[154][193]"
  100. 990 print"[159]    2  3  4  5  6  7  8  9  0  [202]  [209]  [203]"
  101. 1000 print"[154]1"
  102. 1010 print"[159]    4  6  8  0  [209]  [193]  3  5  7  9  [202]  [203]"
  103. 1020 print"[154]2"
  104. 1030 print"[159]    6  9  [209]  2  5  8  [202]  [193]  4  7  0  [203]"
  105. 1040 print"[154]4"
  106. 1050 print"[159]    8  [209]  3  7  [202]  2  6  0  [193]  5  9  [203]"
  107. 1060 printtab(13)"[211]  [215]  [215]  [215]  [215]"
  108. 1065 print""
  109. 1066 fora=1to4
  110. 1067 printtab(3)bo$:print
  111. 1068 next:gosub4030
  112. 1070 return
  113. 1080 :
  114. 1090 x=x+3:ifsgn(peek(x)-128)=-1thenx=x-3
  115. 1100 return
  116. 1110 x=x-3:ifsgn(peek(x)-128)=-1thenx=x+3
  117. 1120 return
  118. 1130 x=x-160:ifsgn(peek(x)-128)=-1thenx=x+160
  119. 1140 return
  120. 1150 x=x+160:ifsgn(peek(x)-128)=-1thenx=x-160
  121. 1160 return
  122. 1170 :
  123. 1180 x=1880:gosub1870:w=1883
  124. 1190 pokex+s,13:pokew+s,7
  125. 1200 k=52:fori=1274to1754step120
  126. 1210 forj=0to6*3step3
  127. 1220 pokei+j,s(k):k=k-1
  128. 1230 next:next
  129. 1240 poke1883,s(k):k=k-1:pokex,s(k)
  130. 1250 mk=0:s(0)=160
  131. 1260 :
  132. 1270 print"[154][211]tack:"k"[157] "
  133. 1275 pokex,peek(x)-128
  134. 1280 pokex,peek(x)+128
  135. 1290 joy=15-(peek(js)and15):fb=peek(js)and16:getk$
  136. 1300 ifjoy=8ork$=""thengosub2170
  137. 1310 ifjoy=4ork$="[157]"thengosub2190
  138. 1320 ifjoy=1ork$="[145]"thengosub2210
  139. 1330 ifjoy=2ork$=""thengosub2230
  140. 1340 iffb=0ork$=chr$(13)then1390
  141. 1350 ifk$="q"thenrun
  142. 1360 pokex,peek(x)-128:fort=1to25:next
  143. 1370 goto1280
  144. 1380 :
  145. 1390 gosub2120
  146. 1400 ifx=1883thengosub2030:goto1270
  147. 1410 ifpeek(x)=160thengosub2030:goto1270
  148. 1420 b=peek(x)
  149. 1430 ifx<>1880then1480
  150. 1440 poke1883,b
  151. 1450 k=k-1:pokex,s(k)
  152. 1460 goto1270
  153. 1470 :
  154. 1480 ifx<>1754andx<>1757andx<>1760andx<>1763andx<>1766andx<>1769andx<>1772then1540
  155. 1490 gosub1600:iff1thengosub2030:goto1270
  156. 1500 poke1883,b:pokex,160
  157. 1502 gosub60200
  158. 1510 mk=mk+1:ifmk=35then770
  159. 1520 goto1270
  160. 1530 :
  161. 1540 ifpeek(x+120)<>160thengosub2030:goto1270
  162. 1550 gosub1600:iff1thengosub2030:goto1270
  163. 1560 poke1883,b:pokex,160:gosub60200
  164. 1570 mk=mk+1:ifmk=35then770
  165. 1580 goto1270
  166. 1590 :
  167. 1600 f1=0:z=peek(w)
  168. 1610 ifz=193andb=178thenreturn:rem a
  169. 1620 ifz=203andb=209thenreturn:rem k
  170. 1630 ifz=178andb=193thenreturn:rem 2
  171. 1640 ifz=178andb=179thenreturn
  172. 1650 ifz=179andb=178thenreturn:rem 3
  173. 1660 ifz=179andb=180thenreturn
  174. 1670 ifz=180andb=179thenreturn:rem 4
  175. 1680 ifz=180andb=181thenreturn
  176. 1690 ifz=181andb=180thenreturn:rem 5
  177. 1700 ifz=181andb=182thenreturn
  178. 1710 ifz=182andb=181thenreturn:rem 6
  179. 1720 ifz=182andb=183thenreturn
  180. 1730 ifz=183andb=182thenreturn:rem 7
  181. 1740 ifz=183andb=184thenreturn
  182. 1750 ifz=184andb=183thenreturn:rem 8
  183. 1760 ifz=184andb=185thenreturn
  184. 1770 ifz=185andb=184thenreturn:rem 9
  185. 1780 ifz=185andb=176thenreturn
  186. 1790 ifz=176andb=185thenreturn:rem 0
  187. 1800 ifz=176andb=202thenreturn
  188. 1810 ifz=202andb=176thenreturn:rem j
  189. 1820 ifz=202andb=209thenreturn
  190. 1830 ifz=209andb=202thenreturn:rem q
  191. 1840 ifz=209andb=203thenreturn
  192. 1850 f1=1:return
  193. 1860 :
  194. 1870 print"[147][156]     [176][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][174]"
  195. 1880 print"     [221][159] [207]ne [198]oundation [211]olitaire  [146][156][221]"
  196. 1890 print"     [173][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][189]"
  197. 1900 a$="[154][176][192][174]":b$="[221] [154][146][221]":c$="[173][192][189]"
  198. 1910 fori=1to5
  199. 1920 printtab(9):forj=1to7:printa$;:next:print
  200. 1930 printtab(9):forj=1to7:printb$;:next:print
  201. 1940 printtab(9):forj=1to7:printc$;:next:print
  202. 1950 next
  203. 1960 :
  204. 1970 printtab(15):forj=1to2:printa$;:next:print
  205. 1980 printtab(15):forj=1to2:printb$;:next:print
  206. 1990 printtab(15):forj=1to2:printc$;:next:print
  207. 2000 print"[211]tack: 16       [211]  [215]"
  208. 2005 gosub4030
  209. 2010 return
  210. 2020 :
  211. 2030 print"[156][176][192][192][192][192][192][192][192][192][192][174]"
  212. 2040 print"[221] [201]llegal [146][156][221]"
  213. 2050 print"[221]  [205]ove!  [146][156][221]"
  214. 2060 print"[173][192][192][192][192][192][192][192][192][192][189]"
  215. 2070 fort=1to1000:next
  216. 2080 print"           "
  217. 2090 fori=1to3:print"           ":next
  218. 2100 return
  219. 2110 :
  220. 2120 pokes+24,15:pokes+5,9
  221. 2130 pokes+4,17:pokes+1,25:pokes,177
  222. 2140 fort=1to100:next
  223. 2150 pokes+4,16:return
  224. 2160 :
  225. 2170 x=x+3:ifpeek(x)=32thenx=x-3
  226. 2180 return
  227. 2190 x=x-3:ifpeek(x)=32thenx=x+3
  228. 2200 return
  229. 2210 x=x-120:ifpeek(x)<128thenx=x+120
  230. 2220 return
  231. 2230 x=x+120:ifpeek(x)=32thenx=x-120
  232. 2240 return
  233. 2250 :
  234. 2260 print"[147]"
  235. 2270 printtab(9)"[156][176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
  236. 2280 printtab(9)"[221]                    [146][156][221]"
  237. 2290 printtab(9)"[221]     [211]olitaire      [146][156][221]"
  238. 2300 printtab(9)"[221]                    [146][156][221]"
  239. 2310 printtab(9)"[171][192][192][192][192][192][192][1