home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 94 / 094.d81 / tens (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  5KB  |  163 lines

  1. 1 rem save"tens v3.0",8
  2. 9 printchr$(142):poke53272,31:poke198,0:mt=52480
  3. 10 goto500
  4. 19 rem choice*
  5. 20 gosub62
  6. 21 fori=1tocc:ifa$=mid$(ch$,i,1)thenreturn
  7. 22 next:goto20
  8. 25 rem charge*
  9. 26 a$="251331421502421502"
  10. 27 t=87:pokef+6,96:pokef+24,15
  11. 28 fori=1to18step3
  12. 29 pokef+1,val(mid$(a$,i,2)):pokef+4,33
  13. 30 forj=1tot*val(mid$(a$,i+2,1)):next
  14. 31 pokef+4,0:next:return
  15. 57 rem any key-get a$*
  16. 58 x=10:y=24:gosub66:print" please press a key [145][145][145]"
  17. 62 geta$:ifa$=""then70:return
  18. 64 rem print at*
  19. 66 poke211,x:poke214,y:sys58732:return
  20. 69 rem multitask *
  21. 70 ifjj=nc-2thenjj=-1
  22. 71 jj=jj+1:j%=jj+int(rnd(0)*(nc-jj)):temp=s(jj):s(jj)=s(j%):s(j%)=temp:goto62
  23. 79 rem illusion on deck
  24. 80 x=x(dk):y=y(dk):gosub66:printb1$;:fork=1to80:next:printbk$
  25. 82 c(i)=0:gosub200:c(i)=1:x=x(ws):y=y(ws):gosub66:gosub202:c(i)=0:return
  26. 110 rem start up
  27. 111 dimva$(13),vb$(13):f=54272:fori=ftof+78:pokei,0:next
  28. 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]"
  29. 113 s$(0)="[162]":s$(1)="[173]":s$(2)="[192]":s$(3)="[193]":co$(0)="[144]":co$(1)="":co$(2)=""
  30. 114 co$(3)="[144]":s1$(0)="[161]":s1$(1)="[218]":s1$(2)="[223]":s1$(3)="[176]"
  31. 115 fori=0to12:va$(i)=mid$(cr$,i+1,1):vb$(i)=mid$(cs$,i+1,1):next
  32. 116 bk$="[129]!##$[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]"
  33. 117 bl$="[155]@@@@[157][157][157][157]@@@@[157][157][157][157]@@@@[157][157][157][157]@@@@[157][157][157][157]@@@@[157][157][157][157][145][145][145][145]"
  34. 118 bg$="[155] %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
  35. 119 deffns(x)=int(x/13):deffnv(x)=x-13*int(x/13)
  36. 120 nc=52:ns=13:  jj=-1:dims(nc):fori=0tonc-1:s(i)=i:next
  37. 121 b1$="[150]!##$[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]"
  38. 130 rem shuffle
  39. 131 ifjj=nc-2thenreturn
  40. 132 jj=jj+1:j%=jj+int(rnd(0)*(nc-jj)):temp=s(jj):s(jj)=s(j%):s(j%)=temp
  41. 133 ifjj<>nc-2then131
  42. 135 dimx(15),y(15),c(15),b(13,1),dk(52),ws(52):return
  43. 140 ch$="0123456789 qh":cc=13:dk=10:ws=11:np=9
  44. 142 x=9: fori=0to4:y(i)=4:y(i+5)=11:x(i)=x+5:x(i+5)=x+5:x=x+5:next
  45. 144 x(10)=5:y(10)=18:x(11)=12:y(11)=18
  46. 148 return
  47. 149 rem end game
  48. 150 x=6:y=12:gosub66:print" [192][192][192][192][192][192][192] "
  49. 152 y=y+1:gosub66:print"   you   "
  50. 154 y=y+1:gosub66:print"   win!  "
  51. 156 y=y+1:gosub66:print" [192][192][192][192][192][192][192] "
  52. 158 wn=0:goto170
  53. 160 x=02:y=12:gosub66:print"                  "
  54. 162 y=y+1:gosub66:print"                  "
  55. 164 y=y+1:gosub66:print"                  "
  56. 166 x=x+1:y=y-1:gosub66:print""c(dk)"cards left"
  57. 170 x=2:y=17:gosub66: print" [192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192] "
  58. 172 y=y+1:gosub66:print"  1. new game     "
  59. 174 y=y+1:gosub66:  print"  2. to loadstar  "
  60. 176 y=y+1:gosub66:print" [192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192] "
  61. 177 sysmt+3,1,39,24,24,160,6
  62. 178 gosub62:ifa$<"1"ora$>"2"then178
  63. 182 onval(a$)goto612,6000
  64. 190 ch$="0123456789abc qh":cc=16:dk=14:ws=15:np=12
  65. 192 x=-2:fori=0to6:y(i)=4:y(i+5)=10:x(i)=x+5:x=x+5:next
  66. 194 x(14)=09:y(14)=18:x(15)=27:y(15)=18
  67. 196 x=-2:fori=7to12:y(i)=11:x(i)=x+5:x=x+5:   next
  68. 198 return
  69. 199 rem print card or erase*
  70. 200 x=x(i):y=y(i):gosub66
  71. 202 ca=b(i,c(i)):su=fns(ca):va=fnv(ca)
  72. 204 pokef+24,6:pokef+5,128:pokef+4,129:fort=1to20:next:pokef+4,128:pokef+5,0
  73. 206 pokef+24,0:pokef+24,15:pokef+4,129:pokef+4,128
  74. 208 ifc(i)<>0then220
  75. 214 rem erase card*
  76. 216 printbl$;:return
  77. 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);
  78. 222 print"[157][157][157][157][180][178][178]";vb$(va);"[145][145][145][145][157][157][157][157]";:return
  79. 299 rem deal
  80. 300 fori=0tonp:ifc(i)>0then308
  81. 304 x=x(dk):y=y(dk):gosub66:printb1$;:printbk$:c(i)=1:b(i,1)=dk(c(dk))
  82. 306 c(dk)=c(dk)-1:gosub200:ifc(dk)=0then310
  83. 308 next
  84. 309 return
  85. 310 x=x(dk):y=y(dk):gosub66:printbl$:wn=1:return
  86. 319 rem play faces in tens
  87. 320 kk=i:tc=fnv(b(i,1)):k=0:forj=0to12:iffnv(b(j,1))<>tcthen328
  88. 324 k=k+1
  89. 328 next
  90. 332 ifk=4then 338
  91. 336 return
  92. 338 c(kk)=0:i=kk:gosub200:c(kk)=1:x=x(ws):y=y(ws):gosub66:i=kk:gosub202:c(kk)=0
  93. 340 forj=0to12:iffnv(b(j,1))<>tcthen348
  94. 344 c(j)=0:i=j: gosub200:c(j)=1:x=x(ws):y=y(ws):gosub66:i=j:gosub202:c(j)=0
  95. 348 next
  96. 350 return
  97. 500 poke53280,08:poke53281,01:sysmt+3,0,39,0,24,126,08
  98. 501 sysmt+3,8,32,10,15,255,0
  99. 502 sysmt+3,7,31,9,14,160,06
  100. 503 sysmt+18,10,"[212][160][207][160][213][160][199][160][200][160][160][212][160][197][160][206][160][211]":sysmt+18,12,"a maurice jones "
  101. 504 sysmt+18,13,"solitaire   "
  102. 510 gosub111:gosub26:gosub190
  103. 612 fori=1to52:dk(i)=s(i-1):next:c(dk)=52:fori=0to12:c(i)=0:next:c(ws)=0
  104. 614 poke53280,08:poke53281,1:print"[147]";
  105. 616 sysmt+3,0,39,0,24,000,15:sysmt+3,0,39,0,2,160,6:sysmt+3,0,39,24,24,160,6
  106. 618 sysmt+18,24,"  h - help            q - quit"
  107. 619 x=0:y=24:gosub66:print"[146][144]/";
  108. 620 x=10:y=1:gosub66:print"[212][160][207][160][213][160][199][160][200] [160] [212][160][197][160][206][160][211]  "
  109. 625 x=x(dk):y=y(dk):gosub66:printbk$:fori=0to12:x=x(i):y=y(i):gosub66:
  110. 629 print"[156]";mid$(str$(i),2,1):next
  111. 630 b9$="abc":fori=10to12:x=x(i):y=y(i):gosub66:
  112. 631 print"[156]";mid$(b9$,i-9  ,1):next
  113. 632 gosub300
  114. 634 x=16:y=19:gosub66:print" [192][192][192][192][192][192] ":y=y+1:gosub66:print"  from  "
  115. 635 y=y+1:gosub66:print" [192][192][192][192][192][192] [146]"
  116. 638 gosub20:i=i-1: ifi<13then646
  117. 642 oni-12goto678,160,900
  118. 646 ifc(i)=0then638
  119. 650 iffnv(b(i,c(i)))<09then658
  120. 654 gosub320:goto634
  121. 658 x=17:y=20:gosub66:print"    "
  122. 660 fc=i:x=17:y=20:gosub66:print" and "
  123. 662 gosub20:i=i-1:ifi<13then668
  124. 666 oni-12goto634,160,900
  125. 668 ifc(i)=0then634
  126. 669 rem ifi=fcthen634
  127. 670 iffnv(b(fc,c(fc)))+fnv(b(i,c(i)))<>08thengosub2000:goto634
  128. 674 sc=i:i=fc:gosub82:forj=1to100:next: i=sc:gosub82:  goto634
  129. 678 gosub300:ifwn<>1then634
  130. 682 fori=1to100:next:goto150
  131. 800 rem help
  132. 802 return
  133. 900 poke53280,1:sysmt+6,208:print"[147]":print"             tough tens    "
  134. 910 print"/": print"  discard pairs of cards which total"
  135. 929 print"ten.  discard kings, queens, jacks, and
  136. 930 [153]"tens only in sets of four of the same
  137. 940 print"value.  empty spaces are filled from
  138. 950 [153]"the deck.  the game is won if all the
  139. 960 print"cards of the deck can be played to the
  140. 970 [153]"board.":[153]"  at the "[199](34)"from"[199](34)" prompt enter the char-
  141. 980 print"acter [0-c] of the pile containing a
  142. 990 [153]"card you want to play.  if the card is
  143. 1000 print"a ten, jack, queen, or king all four
  144. 1010 [153]"such cards will be discarded with no
  145. 1020 print"further action on your part.  otherwise
  146. 1030 [153]"you will be prompted with "[199](34)"and"[199](34)" for the
  147. 1040 print"second card in the pair.  the space bar
  148. 1050 [153]"deals to the empty spaces.
  149. 1080 print"  at any prompt q ends the game and h
  150. 1090 [153]"gives this screen.
  151. 1100 gosub58:sysmt+9,208:poke53280,8:goto634
  152. 2000 pokef+8,4
  153. 2010 pokef+12,63:pokef+13,17:pokef+11,33:fort=1to100:next:pokef+11,32
  154. 2020 return
  155. 5999 rem reconnect*
  156. 6000 pokev+21,0:poke56,160:clr
  157. 6020 open15,8,15,"r0:hello connect=hello connect":input#15,er%:close15
  158. 6025 ifer%<>63thenend
  159. 6030 poke646,peek(53281):print"[147]load"chr$(34)"hello connect"chr$(34)",8"
  160. 6035 print"run"
  161. 6040 poke631,13:poke632,13:poke198,2:end
  162. 10000 open15,8,15,"s0:tens":close15:save"tens",8:end
  163.