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

  1. 1 rem save"strategy v4.2",9
  2. 6 deffns(x)=int(x/13):deffnv(x)=x-13*int(x/13):ns=13:nc=52
  3. 7 nm$="[144][170][171]strategy[170][171]"
  4. 8 jj=-1:dims(nc),x(12),y(12):fori=0tonc-1:s(i)=i:next
  5. 9 poke198,0
  6. 10 goto500
  7. 19 rem choice*
  8. 20 gosub62
  9. 21 fori=1to10:ifa$=mid$(ch$,i,1)thenreturn
  10. 22 next:goto20
  11. 25 rem charge*
  12. 26 a$="251331421502421502"
  13. 27 t=87:pokef+6,96:pokef+24,15
  14. 28 fori=1to18step3
  15. 29 pokef+1,val(mid$(a$,i,2)):pokef+4,33
  16. 30 forj=1tot*val(mid$(a$,i+2,1)):next
  17. 31 pokef+4,0:next:return
  18. 57 rem any key-get a$*
  19. 58 x=10:y=23:gosub66:print" please press a key [145][145][145]"
  20. 62 geta$:ifa$=""then70:return
  21. 64 rem print at*
  22. 66 poke211,x:poke214,y:sys58732:return
  23. 69 rem multitask *
  24. 70 ifjj=nc-2thenjj=-1
  25. 71 jj=jj+1:j%=jj+int(rnd(0)*(nc-jj)):temp=s(jj):s(jj)=s(j%):s(j%)=temp:goto62
  26. 80 print"[152]"bt$;:fori=0to22:printbg$;:next:printbb$""
  27. 82 poke2023,195:poke56295,12:fori=217to242:pokei,peek(i)or128:next
  28. 84 return
  29. 90 printtab(10)"[213][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][201]"
  30. 92 printtab(10)"[215][146][144] s t r a t e g y [214]"
  31. 94 printtab(10)"[215][146]                 [214]"
  32. 96 printtab(10)"[215][146] [151]a maurice jones [214]"
  33. 97 printtab(10)"[215][146]    [151]solitaire    [214]"
  34. 98 printtab(10)"[202][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][203]"
  35. 99 return
  36. 110 rem start up
  37. 111 dimva$(13),c(12),b(12,52),vb$(13):f=54272:fori=ftof+78:pokei,0:next
  38. 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]"
  39. 115 s$(0)="[162]":s$(1)="[173]":s$(2)="[192]":s$(3)="[193]":co$(0)="[144]":co$(1)="":co$(2)=""
  40. 116 co$(3)="[144]":s1$(0)="[161]":s1$(1)="[218]":s1$(2)="[223]":s1$(3)="[176]"
  41. 117 fori=0to12:va$(i)=mid$(cr$,i+1,1):vb$(i)=mid$(cs$,i+1,1):next
  42. 118 ch$="12345678qh"
  43. 119 fori=0to12:readx(i),y(i):next
  44. 120 data9,13,17,09,22,09,27,09,32,09,17,16,22,16,27,16,32,16,17,2,22,2,27,2,32,2
  45. 122 bk$="!##$[157][157][157][157]@[170][171]%[157][157][157][157]@[170][171]%[157][157][157][157]@[170][171]%[157][157][157][157]\++*[157][157][157][157][145][145][145][145][145]"
  46. 123 bl$="[152][191][191][191][191][157][157][157][157][191][191][191][191][157][157][157][157][191][191][191][191][157][157][157][157][191][191][191][191][157][157][157][157][191][191][191][191][157][157][157][157][145][145][145][145][145]"
  47. 124 tp$="[213][146][179][179][179][179][179][179][179][179][179][179][179][179][201]":bm$="[202][146][178][178][178][178][178][178][178][178][178][178][178][178][203]"
  48. 125 bt$="[192][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][193]"
  49. 126 bg$="[199][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][197]"
  50. 127 bb$="[194][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198]"
  51. 128 cd$="[152][213][209][209][201][157][157][157][157][215][146]  [214][157][157][157][157][215][146]  [214][157][157][157][157][215][146]  [214][157][157][157][157][202][219][219][203]"
  52. 129 return
  53. 130 rem shuffle
  54. 131 ifjj=nc-2thenreturn
  55. 132 jj=jj+1:j%=jj+int(rnd(0)*(nc-jj)):temp=s(jj):s(jj)=s(j%):s(j%)=temp
  56. 133 ifjj<>nc-2then131
  57. 134 return
  58. 199 rem print card or erase*
  59. 200 x=x(i):y=y(i):gosub66
  60. 202 ca=b(i,c(i)):su=fns(ca):va=fnv(ca)
  61. 204 pokef+24,6:pokef+5,128:pokef+4,129:fort=1to50:next:pokef+4,128:pokef+5,0
  62. 206 pokef+24,0:pokef+24,15:pokef+4,129:pokef+4,128
  63. 208 ifc(i)<>0then220
  64. 214 rem erase card*
  65. 216 printbl$;:return
  66. 220 printco$(su);va$(va);"[179][179][177][157][157][157][157]";s$(su);"[166][167][174][157][157][157][157][163][170][171][174][157][157][157][157][163][168][169]";s1$(su);
  67. 222 print"[157][157][157][157][180][178][178]";vb$(va);"[145][145][145][145][145][157][157][157][157]";:return
  68. 249 rem print back****????
  69. 250 x=x(i):y=y(i):gosub66
  70. 251 ifz8=1then258
  71. 252 pokef+24,6:pokef+5,128:pokef+4,129:fort=1to50:next:pokef+4,128:pokef+5,0
  72. 254 pokef+24,0:pokef+24,15:pokef+4,129:pokef+4,128:ifz9=1then return
  73. 258 printbk$:return
  74. 500 gosub111:poke53280,15:poke53281,1:print"[147]"chr$(142)"":poke53272,31
  75. 502 gosub80:print"":gosub90
  76. 504 gosub131:gosub26
  77. 505 fori=1to52:b(0,i)=s(i-1):next:c(0)=52:fori=1to12:c(i)=0:next
  78. 506 gosub80
  79. 508 x=2:y=2:gosub66:printtp$:y=3:gosub66
  80. 509 print"[215][146][144][170][171]strategy[170][171][214]":y=4:gosub66:printbm$"
  81. 510 [129]i[178]1[164]12:x[178]x(i):y[178]y(i):[141]66:[153]cd$"";:[139]i[177]8[167]522
  82. 514 [153]"waitcmdcmdclr";  [202]([196](i),2,1);:[137]522
  83. 518 [153]"waitclrcmdcmdcmdononf"
  84. 522 [130]:x[178]4:y[178]13:[141]66:[153]"wait";bk$
  85. 523 x[178]4:y[178]21:[141]66:[153]"print#ascascascascascascascascascasc":[153]"valwait stoph - help print#chr$"
  86. 524 [153]"str$str$str$str$str$str$str$str$str$str$":     wh[178]1
  87. 530 [139]c(0)[178]0[167]i[178]0:[141]200:[137]600
  88. 532 [139]c(0)[178]1[167]x[178]4:y[178]13:[141]66;:[153]    bl$
  89. 535 i[178]0:[141]200:fc[178]b(0,c(0))
  90. 540 [139][165]v(fc)[178]0[167]555
  91. 545 x[178]5:y[178]11:[141]66:[153]"print#sinsinclrtoprint#sinsinsin":[141]20:[139]i[177]8[167]570
  92. 548 x[178]x(0):y[178]y(0):[141]66:[153]bl$
  93. 550 c(i)[178]c(i)[170]1:b(i,c(i))[178]fc:[141]200:c(0)[178]c(0)[171]1:[137]530
  94. 555 x[178]5:y[178]11:[141]66:[153]"any key":[141]62:i[178][165]s(fc)[170]9:c(i)[178]1:b(i,c(i))[178]fc
  95. 556 x[178]x(0):y[178]y(0):[141]66:[153]bl$
  96. 557 [141]200:c(0)[178]c(0)[171]1:[137]530
  97. 570 [145]i[171]8[137]900,1300
  98. 599 [143] play to f*
  99. 600 wh[178]2
  100. 604 [129]j[178]1[164]8:[139]c(j)[178]0[167]612
  101. 608 k[178]c(j):pp[178][165]s(b(j,k))[170]9:[139][165]v(b(pp,c(pp)))[170]1[178][165]v(b(j,k))[167]640
  102. 612 [130]
  103. 616 x[178]4:y[178]8:[141]66:[153]"          "
  104. 620 x[178]4:y[178]9:[141]66:[153]" no plays "
  105. 622 x[178]4:y[178]10:[141]66:[153]" possible "
  106. 624 x[178]4:y[178]11:[141]66:[153]"          "
  107. 628 [158]886:[141]58:[158]907:[137]900
  108. 640 x[178]5:y[178]11:[141]66:[153]"print#sinclrfromprint#sinsin":[141]20:[139]i[177]8[167]700
  109. 644 fc[178]b(i,c(i)):pi[178][165]s(fc)[170]9:[139][165]v(fc)[171]1[179][177][165]v(b(pi,c(pi)))[167]640
  110. 648 c(i)[178]c(i)[171]1:[141]200:c(pi)[178]c(pi)[170]1:b(pi,c(pi))[178]fc:i[178]pi:[141]200
  111. 652 tc[178]0:[129]j[178]1[164]8:tc[178]tc[170]c(j):[130]:[139]tc[177]0[167]604
  112. 660 [137]800
  113. 700 [145]i[171]8[137]900,1300
  114. 710 [158]886
  115. 711 [153]"print#"bt$;
  116. 712 [153]"load"bt$;:[129]i[178]0[164]22:[153]bg$;:[130]
  117. 713 [151]214,23:[153]:[153]bb$"":[151]2023,195:[151]56295,12
  118. 714 [129]i[178]217[164]242:[151]i,[194](i)[176]128:[130]
  119. 715 [129]i[178]1[164]8:[139]c(i)[177]30[167]720
  120. 716 [130]:[137]740
  121. 720 [153]"stopno more than 30 cards in a pile."
  122. 724 [153]"a beta tester might put more than 30
  123. 728 print"cards in a pile, but why would
  124. 732 [153]"anyone else?
  125. 734 print:print:print"--mauricejones"
  126. 736 goto764
  127. 740 print"[156]";:fori=1to8:print"";mid$(str$(i),2,1):next
  128. 742 print"[144]":forj=1to8:x=4:y=2*j-1:gosub66:ifc(j)=0then760
  129. 744 fork=1toc(j):print"";:i=j:c(i)=k:gosub202:next
  130. 760 next
  131. 764 gosub58:sys907:goto1022
  132. 800 x=3:y=6:gosub66:print"          "
  133. 804 printtab(3)"   you    "
  134. 808 printtab(3)"   win!   "
  135. 812 printtab(3)"          "
  136. 816 goto1002
  137. 900 x=3:y=13:gosub66:print"                   "
  138. 902 y=y+1:gosub66:print"                   "
  139. 904 y=y+1:gosub66:print"                   "
  140. 905 tc=0:fori=0to8:tc=tc+c(i):next
  141. 906 x=x+2:y=y-1:gosub66:print""tc"cards left"
  142. 1002 x=4:y=18:gosub66:print"[156]                 "
  143. 1006 y=y+1:gosub66:print" 1.new game      "
  144. 1008 y=y+1:gosub66:print" 2.inspect cards "
  145. 1010 y=y+1:gosub66:print" 3.to loadstar   "
  146. 1012 y=y+1:gosub66:print"                 "
  147. 1022 gosub62:if a$<"1"ora$>"3"then1022
  148. 1024 onval(a$)goto505,710,6000
  149. 1299 rem help
  150. 1300 sys886:z7=0:print"[147]/":poke53280,3:poke53281,3
  151. 1304 printtab(14)"[144][170][171]strategy[170][171]
  152. 1308 [153]"  all ofclosethe cards are turned one at
  153. 1312 print"a time. aces are played to