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

  1. 1 poke56,56:poke55,0:clr
  2. 2 dv=peek(186):ifdv<8thendv=8
  3. 3 poke53281,0:poke53280,0:print"[147]":gosub60000
  4. 4 sys57812"fourteens font",dv,0:poke780,0:poke781,0:poke782,56:sys65493
  5. 5 sys57812"ftoolkit cc00",dv,0:poke780,0:poke781,0:poke782,204:sys65493
  6. 9 print"[147]"chr$(142)"":poke53272,31:poke198,0:mt=52224
  7. 10 goto500
  8. 19 rem choice*
  9. 20 gosub62
  10. 21 fori=1tocc:ifa$=mid$(ch$,i,1)thenreturn
  11. 22 next:goto20
  12. 25 rem charge*
  13. 26 a$="251331421502421502"
  14. 27 t=87:pokef+6,96:pokef+24,15
  15. 28 fori=1to18step3
  16. 29 pokef+1,val(mid$(a$,i,2)):pokef+4,33
  17. 30 forj=1tot*val(mid$(a$,i+2,1)):next
  18. 31 pokef+4,0:next:return
  19. 57 rem any key-get a$*
  20. 58 x=9:y=24:gosub66:print" please press a key [145][145][145]"
  21. 62 geta$:ifa$=""then70:return
  22. 64 rem print at*
  23. 66 poke211,x:poke214,y:sys58732:return
  24. 69 rem multitask *
  25. 70 ifjj=nc-2thenjj=-1
  26. 71 jj=jj+1:j%=jj+int(rnd(0)*(nc-jj)):temp=s(jj):s(jj)=s(j%):s(j%)=temp:goto62
  27. 110 rem start up
  28. 111 dimva$(13),vb$(13):f=54272:fori=ftof+78:pokei,0:next
  29. 112 cr$="[216][203][202][201][200][199][198][197][196]&[195][194][217]":cs$="[204][215][214][213][212][211][210][209][208]'[207][206][205]"
  30. 113 s$(0)="[162]":s$(1)="[173]":s$(2)="[192]":s$(3)="[193]":co$(0)="[144]":co$(1)="":co$(2)=""
  31. 114 co$(3)="[144]":s1$(0)="[161]":s1$(1)="[218]":s1$(2)="[223]":s1$(3)="[176]"
  32. 115 fori=0to12:va$(i)=mid$(cr$,i+1,1):vb$(i)=mid$(cs$,i+1,1):next
  33. 116 bk$="!##$[157][157][157][157]#[190][190]#[157][157][157][157]#[190][190]#[157][157][157][157]#[190][190]#[157][157][157][157]\++*[157][157][157][157][145][145][145][145]"
  34. 117 bl$="[153]@@@@[157][157][157][157]@@@@[157][157][157][157]@@@@[157][157][157][157]@@@@[157][157][157][157]@@@@"
  35. 118 bg$="[155] @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
  36. 119 b1$="[155]!##$[157][157][157][157]#[190][190]#[157][157][157][157]#[190][190]#[157][157][157][157]#[190][190]#[157][157][157][157]\++*[157][157][157][157][145][145][145][145]"
  37. 122 deffns(x)=int(x/13):deffnv(x)=x-13*int(x/13)
  38. 126 nc=52:ns=13:  jj=-1:dims(nc):fori=0tonc-1:s(i)=i:next
  39. 130 rem shuffle
  40. 131 ifjj=nc-2thenreturn
  41. 132 jj=jj+1:j%=jj+int(rnd(0)*(nc-jj)):temp=s(jj):s(jj)=s(j%):s(j%)=temp
  42. 133 ifjj<>nc-2then131
  43. 135 dimx(13),y(13),c(13),b(13,5),dk(52),ws(52),ag(52)
  44. 140 ch$="123456789abcoqh":cc=len(ch$):dk=0:ws=13
  45. 144 x(0)=03:y(0)=16:x(13)=2:y(13)=17
  46. 146 k$="123456789abc"
  47. 148 return
  48. 149 rem end game
  49. 150 x=6:y=12:gosub66:print"[213][192][192][192][192][192][192][192][201]"
  50. 152 print"[221]  you  [221]
  51. 154 [153]"(NULL)  win! (NULL)
  52. 156 print"[202][192][192][192][192][192][192][192][203]"
  53. 158 goto170
  54. 160 z3=0:x=02:y=12:gosub66:print"                  "
  55. 162 print"                  "
  56. 164 print"                  "
  57. 165 zx=0:fori=1to12:zx=zx+c(i):next:zx=zx+c(dk)
  58. 166 print"[145][145]";zx;"cards left"
  59. 170 x=2:y=17:gosub66:print"[213][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][201]
  60. 172 [153]"(NULL) 1. new puzzle  (NULL)"
  61. 173 [153]"(NULL) 2. same puzzle (NULL)"
  62. 174 [153]"(NULL) 3. to loadstar (NULL)
  63. 176 print"[202][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][203]
  64. 178 [141]62:[139](a$)[179]"1"[176](a$)[177]"3"[167]178
  65. 180 [145][197](a$)[137]512,400,6000
  66. 199 [143] print card or erase*
  67. 200 x[178]x(i):y[178]y(i):[141]66
  68. 202 ca[178]b(i,c(i))
  69. 203 su[178][165]s(ca):va[178][165]v(ca):[139]q4[167]208
  70. 204 [151]f[170]24,6:[151]f[170]5,128:[151]f[170]4,129:[129]t[178]1[164]10:[130]:[151]f[170]4,128:[151]f[170]5,0
  71. 206 [151]f[170]24,0:[151]f[170]24,15:[151]f[170]4,129:[151]f[170]4,128
  72. 208 [139]c(i)[179][177]0[167]220
  73. 214 [143] erase card*
  74. 216 [153]bl$;:[142]
  75. 220 [153]co$(su);va$(va);"<<>cmdcmdcmdcmd";s$(su);"spc(then^cmdcmdcmdcmdtab(+-^cmdcmdcmdcmdtab(notstep";s1$(su);
  76. 222 [153]"cmdcmdcmdcmdsgn==";vb$(va);"ononononcmdcmdcmdcmd";:[142]
  77. 299 [143] deal
  78. 300 [129]i[178]1[164]12:[139]c(dk)[178]0[167][142]
  79. 302 [143]  x=x(dk):y=y(dk):gosub66:printb1$;:printbk$
  80. 304 c(i)[178]c(i)[170]1:b(i,c(i))[178]dk(c(dk)):c(dk)[178]c(dk)[171]1
  81. 305 [139]k[178]1[167]307
  82. 306 y(i)[178]y(i)[170]1
  83. 307 [141]200
  84. 308 [130]
  85. 309 [142]
  86. 319 [143] play one to waste
  87. 320 [139]c(i)[179]2[167]336
  88. 322 c(ws)[178]c(ws)[170]1:ws(c(ws))[178]b(i,c(i))
  89. 324 x[178]x(i):y[178]y(i):[141]66:[153]bl$:y(i)[178]y(i)[171]1:c(i)[178]c(i)[171]1:[141]200
  90. 328 c(i)[178]c(i)[170]1:x[178]x(ws):y[178]y(ws):[141]66:    :[141]202:c(i)[178]c(i)[171]1
  91. 332 [142]
  92. 336 c(ws)[178]c(ws)[170]1:ws(c(ws))[178]b(i,c(i)):c(i)[178]c(i)[171]1:[141]200:c(i)[178]c(i)[170]1
  93. 340 x[178]x(ws):y[178]y(ws):[141]66:[141]202:c(i)[178]c(i)[171]1:[142]
  94. 400 [129]i[178]1[164]52:dk(i)[178]ag(i):[130]:[137]514
  95. 500 [151]53280,9:[151]53281,9:[153]"load"
  96. 501 [158]mt[170]3,0,39,0,24,126,15:[158]mt[170]3,6,34,9,15,255,12:[158]mt[170]3,5,33,8,14,160,15
  97. 503 [158]mt[170]18,9,"listf o u r t e e n s":[158]mt[170]18,11,"listplaying card puzzles"
  98. 504 [158]mt[170]18,13,"listby maurice jones"
  99. 505 [153]"wait"
  100. 510 [141]111:[141]26
  101. 512 [129]i[178]1[164]52:dk(i)[178]s(i[171]1):ag(i)[178]s(i[171]1):[130]
  102. 514 c(dk)[178]52:[129]i[178]1[164]12:c(i)[178]0:[130]:c(ws)[178]0
  103. 515 k[178]5:[129]i[178]1[164]6:y(i)[178]5:x(i)[178]k:k[178]k[170]5:[130]
  104. 516 k[178]9:[129]i[178]7[164]12:y(i)[178]15:x(i)[178]k:k[178]k[170]5:[130]
  105. 517 [151]53280,15:[151]53281,1:[153]"load ";
  106. 519 [158]mt[170]3,0,39,0,24,000,13:[158]mt[170]3,0,39,0,2,160,12
  107. 521 x[178]11:y[178]1:[141]66:[153]"print#f o u r t e e n s"
  108. 522 x[178]0:y[178]24:[141]66
  109. 523 [153]"print#/   o - oops    h - help    q - quit   ";
  110. 525 [153]"wait";:x[178]x(dk):y[178]y(dk):[141]66:[153]bk$:[129]i[178]1[164]12:x[178]x(i):y[178]y(i):[141]66
  111. 529 [153]"clron";[202](k$,i,1):[130]
  112. 532 q4[178]1:[129]k[178]1[164]5:[141]300:[130]:q4[178]0:x[178]x(dk):y[178]y(dk):[141]66:[153]bl$
  113. 534 x[178]x(13):y[178]y(13)[171]2:[141]66:[153]"clrfrom"
  114. 536 [141]20
  115. 538 [139]i[179]13[167] 550
  116. 542 [145]i[171]12[137]590,160,800
  117. 550 [139]c(i)[178]0[167]534
  118. 554 op[178]0
  119. 562 fc[178]i
  120. 564 x[178]x(13):y[178]y(13)[171]2:[141]66:[153]"print@@@@"
  121. 566 x[178]x(13):y[178]y(13)[171]2:[141]66:[153]"clrand":[141]20
  122. 568 [139]i[179]13[167] 570
  123. 569 [145]i[171]12[137]534,160,800
  124. 570 [139]c(i)[178]0[167]534
  125. 572 [139]fc[178]i[167]534
  126. 574 [139][165]v(b(fc,c(fc)))[170][165]v(b(i,c(i)))[179][177]12[167]op[178]1:[137]534
  127. 578 sc[178]i:i[178]fc:[141]320:i[178]sc:[141]320
  128. 582 [129]i[178]1[164]12:[139]c(i)[179][177]0[167]534
  129. 586 [130]:[137]150
  130. 590 [139]op[178]1[167]534
  131. 594 [139]c(ws)[178]0[167]534
  132. 600 x[178]x(ws):y[178]y(ws):[141]66:c(ws)[178]c(ws)[171]1:ca[178]ws(c(ws)):[141]203
  133. 604 [129]k[178]1[164]100:[130]
  134. 610 [139]c(sc)[179][177]0[167]630
  135. 620 c(sc)[178]1:i[178]sc:[141]200:[137]640
  136. 630 c(sc)[178]c(sc)[170]1:y(sc)[178]y(sc)[170]1:i[178]sc:[141]200
  137. 640 x[178]x(ws):y[178]y(ws):[141]66:c(ws)[178]c(ws)[171]1:ca[178]ws(c(ws)):[139]c(ws)[179][177]0[167]648
  138. 644 [153]bl$:[137]650
  139. 648 [141]203
  140. 649 [129]k[178]1[164]100:[130]
  141. 650 [139]c(fc)[179][177]0[167]670
  142. 660 c(fc)[178]c(fc)[170]1:i[178]fc:[141]200:op[178]1: [137]534
  143. 670 c(fc)[178]c(fc)[170]1:y(fc)[178]y(fc)[170]1:i[178]fc:[141]200:op[178]1:[137]534
  144. 799 [143] help
  145. 800 [158]mt[170]6,208:[151]53280,9:[151]53281,9:[153]"load"
  146. 805 [153]"        the fourteen puzzles
  147. 810 print:print"  [158]the puzzle is solved if all the
  148. 820 [153]"cards in piles [1-c] can be removed in
  149. 830 print"pairs totaling fourteen.  only the top
  150. 840 [153]"card of each pile is available.  kings
  151. 850 print"count 13, queens 12, and jacks 11.
  152. 860 [153]:[153]"  at the "[199](34)"from"[199](34)" prompt enter the number
  153. 870 print"of the pile containing one of the pair
  154. 880 [153]"and you will be prompted with "[199](34)"and"[199](34)" for
  155. 890 print"the second card.
  156. 900 [153]:[153]"  at any prompt:
  157. 910 print:print"   o[158] - oops. takes back last play.
  158. 920 [153]:[153]"   qsys - quit. ends the solution.
  159. 930 print:print"   h[158] - help. gives this screen
  160. 940 [141]58:[158]mt[170]9,208:[137]534
  161. 5999 [143] reconnect*
  162. 6000 [151]v[170]21,0:[151]56,160:[156]
  163. 6020 [159]15,8,15,"r0:hello connect=hello connect":[132]15,er%:[160]15
  164. 6025 [139]er%[179][177]63[167][128]
  165. 6030 [151]646,[194](53281):[153]"loadload"[199](34)"hello connect"[199](34)",8"
  166. 6035 [153]"run"
  167. 6040 [151]631,13:[151]632,13:[151]198,2:[128]
  168. 10000 [159]15,8,15,"s0:fourteens":[160]15:[148]"fourteens",8:[128]
  169. 60000 [153]"load"