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

  1. 9 printchr$(142):poke53272,31:poke198,0:mt=52480
  2. 10 goto500
  3. 19 rem choice*
  4. 20 gosub62
  5. 21 fori=1tocc:ifa$=mid$(ch$,i,1)thenreturn
  6. 22 next:goto20
  7. 25 rem charge*
  8. 26 a$="251331421502421502"
  9. 27 t=87:pokef+6,96:pokef+24,15
  10. 28 fori=1to18step3
  11. 29 pokef+1,val(mid$(a$,i,2)):pokef+4,33
  12. 30 forj=1tot*val(mid$(a$,i+2,1)):next
  13. 31 pokef+4,0:next:return
  14. 57 rem any key-get a$*
  15. 58 x=10:y=24:gosub66:print" please press a key [145][145][145]"
  16. 62 geta$:ifa$=""then70:return
  17. 64 rem print at*
  18. 66 poke211,x:poke214,y:sys58732:return
  19. 69 rem multitask *
  20. 70 ifjj=nc-2thenjj=-1
  21. 71 jj=jj+1:j%=jj+int(rnd(0)*(nc-jj)):temp=s(jj):s(jj)=s(j%):s(j%)=temp:goto62
  22. 80 ifc(dk)=0then82
  23. 81 x=x(dk):y=y(dk):gosub66:printb1$;:fork=1to80:next:printbk$
  24. 82 c(i)=0:gosub200:c(i)=1:x=x(ws):y=y(ws):gosub66:gosub202:c(i)=0:return
  25. 110 rem start up
  26. 111 dimva$(13),vb$(13):f=54272:fori=ftof+78:pokei,0:next
  27. 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]"
  28. 113 s$(0)="[162]":s$(1)="[173]":s$(2)="[192]":s$(3)="[193]":co$(0)="[144]":co$(1)="":co$(2)=""
  29. 114 co$(3)="[144]":s1$(0)="[161]":s1$(1)="[218]":s1$(2)="[223]":s1$(3)="[176]"
  30. 115 fori=0to12:va$(i)=mid$(cr$,i+1,1):vb$(i)=mid$(cs$,i+1,1):next
  31. 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]"
  32. 117 bl$="[155][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]"
  33. 119 deffns(x)=int(x/13):deffnv(x)=x-13*int(x/13)
  34. 120 nc=52:ns=13:  jj=-1:dims(nc):fori=0tonc-1:s(i)=i:next
  35. 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]"
  36. 130 rem shuffle
  37. 131 ifjj=nc-2thenreturn
  38. 132 jj=jj+1:j%=jj+int(rnd(0)*(nc-jj)):temp=s(jj):s(jj)=s(j%):s(j%)=temp
  39. 133 ifjj<>nc-2then131
  40. 135 dimx(15),y(15),c(15),b(13,1),dk(52),ws(52)
  41. 140 ch$="0123456789 qh":cc=13:dk=10:ws=11:np=9
  42. 142 x=7: fori=0to4:y(i)=6:y(i+5)=14:x(i)=x+5:x(i+5)=x+5:x=x+5:next
  43. 144 x(10)=4:y(10)=07:x(11)=04:y(11)=17
  44. 148 return
  45. 149 rem end game
  46. 150 x=6:y=12:gosub66:print" [192][192][192][192][192][192][192] "
  47. 152 y=y+1:gosub66:print"   you   "
  48. 154 y=y+1:gosub66:print"   win!  "
  49. 156 y=y+1:gosub66:print" [192][192][192][192][192][192][192] "
  50. 158 wn=0:goto170
  51. 160 x=02:y=12:gosub66:print"                  "
  52. 162 y=y+1:gosub66:print"                  "
  53. 164 y=y+1:gosub66:print"                  "
  54. 166 x=x+1:y=y-1:gosub66:print""c(dk)"cards left"
  55. 170 x=2:y=17:gosub66: print" [192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192] "
  56. 172 y=y+1:gosub66:print"  1. new game     "
  57. 174 y=y+1:gosub66:  print"  2. to loadstar  "
  58. 176 y=y+1:gosub66:print" [192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192] "
  59. 177 sysmt+3,1,39,24,24,160,6
  60. 178 gosub62:ifa$<"1"ora$>"2"then178
  61. 182 onval(a$)goto512,6000
  62. 199 rem print card or erase*
  63. 200 x=x(i):y=y(i):gosub66
  64. 202 ca=b(i,c(i)):su=fns(ca):va=fnv(ca)
  65. 204 pokef+24,6:pokef+5,128:pokef+4,129:fort=1to20:next:pokef+4,128:pokef+5,0
  66. 206 pokef+24,0:pokef+24,15:pokef+4,129:pokef+4,128
  67. 208 ifc(i)<>0then220
  68. 214 rem erase card*
  69. 216 printbl$;:return
  70. 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);
  71. 222 print"[157][157][157][157][180][178][178]";vb$(va);"[145][145][145][145][157][157][157][157]";:return
  72. 299 rem deal
  73. 300 fori=0tonp:ifc(i)>0then308
  74. 304 x=x(dk):y=y(dk):gosub66:printb1$;:printbk$:c(i)=1:b(i,1)=dk(c(dk))
  75. 306 c(dk)=c(dk)-1:gosub200:ifc(dk)=0then310
  76. 308 next
  77. 309 return
  78. 310 x=x(dk):y=y(dk):gosub66:printbl$:goto309
  79. 500 poke53280,8:poke53281,1:sysmt+3,0,39,0,24,126,08:sysmt+3,8,32,10,15,255,0
  80. 502 sysmt+3,7,31,9,14,160,06
  81. 504 sysmt+18,10,"[212][160][200][160][201][160][210][160][212][160][197][160][197][160][206][160][211]":sysmt+18,12,"a maurice jones  "
  82. 506 sysmt+18,13,"solitaire  "
  83. 510 gosub111:gosub26
  84. 512 fori=1to52:dk(i)=s(i-1):next:c(dk)=52:fori=0to 9:c(i)=0:next:c(ws)=0
  85. 514 poke53280,8:poke53281,1:sysmt+3,0,39,0,24,160,6:sysmt+3,0,39,3,23,127,15
  86. 517 x=12:y=1:gosub66:print"[212][160][200][160][201][160][210][160][212][160][197][160][197][160][206][160][211][146]"
  87. 521 x=5:y=24:gosub66:print" h - help            q - quit[146]";
  88. 523 x=0:y=24:gosub66:print"[144]/";
  89. 525 x=x(dk):y=y(dk):gosub66:printbk$:fori=0to9:x=x(i):y=y(i):gosub66:
  90. 529 print"[156]";mid$(str$(i),2,1):next
  91. 530 gosub300
  92. 534 sysmt+3,3,8,13,15,160,6:x=4:y=14:gosub66:print"from"
  93. 538 gosub20:i=i-1: ifi<10then546
  94. 542 oni-9goto578,160,800
  95. 546 ifc(i)=0then538
  96. 550 iffnv(b(i,c(i)))<>12then558
  97. 554 gosub82:goto534
  98. 558 x=4:y=14:gosub66:print"    "
  99. 560 fc=i:x=4:y=14:gosub66:print"and "
  100. 562 gosub20:i=i-1:ifi<10then570
  101. 566 oni-9goto534,160,800
  102. 570 iffnv(b(fc,c(fc)))+fnv(b(i,c(i)))<>11thengosub940:goto534
  103. 574 sc=i:i=fc:gosub82:forj=1to100:next: i=sc:gosub82:fori=0to9:ifc(i)>0then534
  104. 576 next:ifc(dk)>0then534
  105. 577 goto150
  106. 578 ifc(dk)=0then534
  107. 580 gosub300:goto534
  108. 800 poke53280,1:sysmt+6,208:print"[147]" :print"/             thirteens"
  109. 802 print: print  "  discard pairs which total thirteen."
  110. 803 print"queens count 12, jacks, 11.  discard"
  111. 804 print"kings separately.  spaces are filled "
  112. 806 print"from the deck.  the game is won if all
  113. 808 [153]"cards can be discarded.
  114. 812 print:print"  at the "chr$(34)"from"chr$(34)" prompt, enter the num-
  115. 820 [153]"ber [0-9] of the pile containing a card
  116. 830 print"which you want to discard.  if the card
  117. 840 [153]"is a king, it will be discarded with no
  118. 850 print"further action on your part.  otherwise
  119. 860 [153]"you will be prompted for number of
  120. 870 print"the pile containing the second card.
  121. 874 [153]"the space bar will fill empty spaces
  122. 876 print"from the deck.
  123. 880 [153]:[153]"  at any prompt, q ends the game and
  124. 890 print"h gives this screen.
  125. 900 [141]58:[158]mt[170]9,208:[151]53280,8:[137]534
  126. 940 f[178]54272:[151]f[170]24,15:[151]f[170]8,4
  127. 950 [151]f[170]12,63:[151]f[170]13,17:[151]f[170]11,33:[129]t[178]1[164]100:[130]:[151]f[170]11,32
  128. 960 [142]
  129. 5999 [143] reconnect*
  130. 6000 [151]v[170]21,0:[151]56,160:[156]
  131. 6020 [159]15,8,15,"r0:hello connect=hello connect":[132]15,er%:[160]15
  132. 6025 [139]er%[179][177]63[167][128]
  133. 6030 [151]646,[194](53281):[153]"loadload"[199](34)"hello connect"[199](34)",8"
  134. 6035 [153]"run"
  135. 6040 [151]631,13:[151]632,13:[151]198,2:[128]
  136. 10000 [159]15,8,15,"s0:thirteens":[160]15:[148]"thirteens",8:[128]
  137.