home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 222 / 222.d81 / michael's (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  11KB  |  380 lines

  1. 1 a=rnd(-ti)
  2. 2 dv=peek(186):ifdv<8thendv=8
  3. 3 print"[147][158]        [208]laying card puzzles ..."
  4. 4 sys57812"mich font",dv,0:poke780,0:poke781,0:poke782,8:sys65493:ml=16*256
  5. 5 sys57812"mr.mouse 2+ 1000",dv:poke780,0:poke781,0:poke782,16:sys65493
  6. 6 dimi,x,y,su,et,mt,s,f,ca,va,t,jj,j%,nc,dv,fc,fr,fs,fv,g7,ga,gh,gt,hi,im,it
  7. 7 hl=03:sk=13:bd=03:      poke4095,31
  8. 8 dimiv,j,k,mc,mk,ms,mv,pl,sk,t2,t6,t7,tc,te,ts,tv,a$,bk$,ch$,mm,lo
  9. 9 gosub111:print"[147][146]":poke53272,19
  10. 10 deffnb(x)=peek(57)+256*peek(58)
  11. 11 goto482
  12. 17 :
  13. 18 rem brancher
  14. 19 :
  15. 20 gosub62
  16. 21 fori=1tolen(ch$):ifa$=mid$(ch$,i,1)thenreturn
  17. 22 next:goto20
  18. 23 :
  19. 24 rem charge
  20. 25 :
  21. 26 a$="251331421502421502"
  22. 27 t=87:pokef+6,96:pokef+24,15
  23. 28 fori=1to18step3
  24. 29 pokef+1,val(mid$(a$,i,2)):pokef+4,33
  25. 30 forj=1tot*val(mid$(a$,i+2,1)):next
  26. 31 pokef+4,0:next:return
  27. 55 :
  28. 56 rem press a key at 58 - get a$ at 62
  29. 57 :
  30. 58 x=0:y=24:gosub66:print"/           please press a key [160]       [145][145][145]"
  31. 62 gosub2000:::geta$:ifa$=""then70
  32. 63 rem ifa$=""thengoto80
  33. 64 return
  34. 65 rem print at
  35. 66 poke211,x:poke214,y:sys58732:return
  36. 67 :
  37. 68 rem multitask *
  38. 69 :
  39. 70 ifjj=nc-2thenjj=-1
  40. 71 jj=jj+1:j%=jj+int(rnd(0)*(nc-jj)):temp=s(jj):s(jj)=s(j%):s(j%)=temp:goto62
  41. 77 :
  42. 78 rem jeff's edit routine
  43. 79 :
  44. 80 print"[145][145][145] [144]break at";br;:end
  45. 86 goto64
  46. 87 :
  47. 88 rem bad choice sound
  48. 89 :
  49. 90 pokef+24,15:pokef+8,4:pokef+12,63:pokef+13,17:pokef+11,33
  50. 92 fort=1to100:next:pokef+11,32:return
  51. 108 :
  52. 109 rem set-up
  53. 110 :
  54. 111 dimva$(13),vb$(13),st$(4,12),co$(3),s$(3),s1$(3)
  55. 112 data"[216]","[203]","[202]","[201]","[200]","[199]","[198]","[197]","[196]","&","[195]","[194]","[217]"
  56. 113 s$(0)="[162]":s$(1)="[173]":s$(2)="[192]":s$(3)="[193]":co$(0)="[144]":co$(1)="":co$(2)=""
  57. 114 co$(3)="[144]":s1$(0)="[161]":s1$(1)="[218]":s1$(2)="[223]":s1$(3)="[176]"
  58. 115 data"[204]","[215]","[214]","[213]","[212]","[211]","[210]","[209]","[208]","'","[207]","[206]","[205]"
  59. 116 bk$="[156]!##$[157][157][157][157][170][188][188][171][157][157][157][157][170][188][188][171][157][157][157][157][170][188][188][171][157][157][157][157]\**+[157][157][157][157][145][145][145][145]"
  60. 117 deffns(x)=int(x/13):deffnv(x)=x-13*int(x/13)
  61. 118 f=54272:fori=ftof+78:pokei,0:next:mt=49152
  62. 119 nc=52:jj=-1:dims(nc):fori=0tonc-1:s(i)=i:next
  63. 120 jj=jj+1:j%=jj+int(rnd(0)*(nc-jj)):temp=s(jj):s(jj)=s(j%):s(j%)=temp
  64. 121 ifjj<>nc-2then120
  65. 122 st$(0,1)="[215][216][157][157][217][218][146]":st$(0,0)="[211][212][146]":st$(3,0)="[179][180][146]"
  66. 123 st$(0,9)="[193][194][157][157][195][196][157][157][197][198][157][157][199][200][157][157][201][202][146]":st$(3,2)="[183][184][157][157][179][180][157][157][185][186][146]"
  67. 124 st$(0,8)="[193][194][157][157][203][204][157][157][205][206][157][157][207][208][157][157][201][202][146]":st$(0,3)="[193][194][157][157][201][202][146]"
  68. 125 st$(3,8)="[161][162][157][157][171][172][157][157][173][174][157][157][175][176][157][157][169][170][146]":st$(0,7)="[193][194][157][157][211][212][157][157][209][210][157][157][213][214][157][157][201][202][146]"
  69. 126 st$(3,9)="[161][162][157][157][163][164][157][157][165][166][157][157][167][168][157][157][169][170][146]":st$(3,7)="[161][162][157][157][179][180][157][157][177][178][157][157][181][182][157][157][169][170][146]"
  70. 127 st$(3,1)="[183][184][157][157][185][186][146]":st$(0,2)="[215][216][157][157][211][212][157][157][217][218][146]"
  71. 128 st$(0,6)="[193][194][157][157][211][212][157][157][209][210][157][157][201][202][146]":st$(3,6)="[161][162][157][157][179][180][157][157][177][178][157][157][169][170][146]"
  72. 129 st$(3,3)="[161][162][157][157][169][170][146]":st$(0,5)="[193][194][157][157][209][210][157][157][201][202][146]"
  73. 130 st$(3,5)="[161][162][157][157][177][178][157][157][169][170][146]":st$(0,4)="[193][194][157][157][211][212][157][157][201][202][146]"
  74. 131 st$(3,4)="[161][162][157][157][179][180][157][157][169][170][146]":
  75. 132 st$(2,9)="ab[157][157]cd[157][157]ef[157][157]gh[157][157]ij":st$(2,8)="ab[157][157]kl[157][157]mn[157][157]op[157][157]ij"
  76. 133 st$(2,7)="ab[157][157]st[157][157]qr[157][157]uv[157][157]ij":st$(2,6)="ab[157][157]st[157][157]qr[157][157]ij"
  77. 134 st$(2,5)="ab[157][157]qr[157][157]ij":st$(2,4)="ab[157][157]st[157][157]ij":st$(2,3)="ab[157][157]ij"
  78. 135 st$(2,2)="wx[157][157]st[157][157]yz":st$(2,1)="wx[157][157]yz":st$(2,0)="st"
  79. 136 fori=2to3:forj=10to12:st$(i,j)="01[157][157]23[157][157]45[157][157]67[157][157]89":next:next
  80. 137 st$(1,9)="[219][220][157][157][187][188][157][157][223][191][157][157][189][190][157][157][221][255][146]"
  81. 138 st$(1,8)="[219][220][157][157]#$[157][157]%&[157][157]*+[157][157][221][255][146]"
  82. 139 st$(1,6)="[219][220][157][157]\^[157][157]<>[157][157][221][255][146]"
  83. 140 st$(1,5)="[219][220][157][157]<>[157][157][221][255][146]"
  84. 141 st$(1,4)="[219][220][157][157]\^[157][157][221][255][146]"
  85. 142 st$(1,7)="[219][220][157][157]\^[157][157]<>[157][157]_=[157][157][221][255][146]"
  86. 143 st$(1,1)="[166][167][157][157][168][169]":st$(1,2)="[166][167][157][157]\^[146][157][157][146][168][169]"
  87. 144 st$(1,0)="\^[146]":st$(1,3)="[219][220][157][157][221][255][146]"
  88. 145 fori=0to1:st$(i,11)="()[157][157]>?[157][157]45[157][157]<=[157][157]:;":next
  89. 146 st$(0,10)="()[157][157]^_[157][157]45[157][157][][157][157]:;"
  90. 147 st$(1,10)="()[157][157]^_[157][157]45[157][157][][157][157]:;"
  91. 148 st$(1,12)="01[157][157]23[157][157]45[157][157]67[157][157]89"
  92. 149 st$(0,12)="()[157][157]^_[157][157]45[157][157][][157][157]:;"
  93. 150 st$(2,12)="[219][220][157][157]^_[157][157]45[157][157][][157][157]:;"
  94. 151 st$(3,12)="[219][220][157][157]^_[157][157]45[157][157][][157][157]:;":gosub2300
  95. 152 fori=0to12:readva$(i):next:fori=0to12:readvb$(i):next
  96. 154 dimdk(nc),b(7,36),x(10),y(10),c(7)
  97. 156 dk=0
  98. 158 fori=1to7:x(i)=5*i-2:y(i)=2:next:x(0)=3:y(0)=16:x(8)=15:y(8)=22
  99. 180 return
  100. 191 :
  101. 192 rem print-erase card,194-spread,200-stacked,202-other place,203-any card
  102. 193 :
  103. 194 y(i)=1+c(i):ifc(i)=0theny(i)=2
  104. 196 ifc(i)>15theny(i)=16
  105. 200 x=x(i):y=y(i):gosub66:ifc(i)=0then224
  106. 202 ca=b(i,c(i))
  107. 203 su=fns(ca):va=fnv(ca)
  108. 210 ifso=1then220
  109. 214 pokef+24,6:pokef+5,128:pokef+4,129:fort=1to05:next:pokef+4,128:pokef+5,0
  110. 216 pokef+24,0:pokef+24,15:pokef+4,129:pokef+4,128
  111. 220 printco$(su);va$(va);"[179][179][177][157][157][157][157]";s$(su);"  [174][157][157][157][157][163]  [174][157][157][157][157][163]  ";s1$(su);
  112. 222 print"[157][157][157][157][180][178][178]";vb$(va);"[145][145][145][145][157][157][157]";st$(su,va);:return
  113. 223 rem erase a card on tiles
  114. 224 sysmt+3,x,x+3,y,y+4,00,sk:return
  115. 267 :
  116. 268 rem will it play?
  117. 269 :
  118. 270 pl=1:ifc(t2)=0andfv=12thenpl=2
  119. 272 ifb(t2,c(t2))=fc+1thenpl=2
  120. 274 rem** pl=2
  121. 276 return
  122. 277 :
  123. 278 rem toggle card sound
  124. 279 :
  125. 280 ifso=0then288
  126. 284 so=0:return
  127. 288 so=1:return
  128. 297 :
  129. 298 rem print choice box-color needed
  130. 299 :
  131. 300 x=x(8):y=y(08):gosub66:print"         [157][157][157][157][157][157][157][157][157]         [157][157][157][157][157][157][157][157]";
  132. 301 print"[157]         ";
  133. 302 gosub66:return
  134. 307 :
  135. 308 rem erase choice box-0n hl
  136. 309 :
  137. 310 poke646,hl:x=x(08):y=y(08):gosub66
  138. 312 print"         [157][157][157][157][157][157][157][157][157]michael's[157][157][157][157][157][157][157][157][157] puzzles [146]";:return
  139. 321 print
  140. 347 :
  141. 348 rem calculate score
  142. 349 :
  143. 350 fori=1to7:iffnv(b(i,1))=12theng7=g7+10
  144. 352 ifc(i)<2then366
  145. 354 forj=2toc(i):ifb(i,j)+1<>b(i,j-1)then362
  146. 358 g7=g7+10
  147. 362 next
  148. 366 next:return
  149. 413 :
  150. 414 spread pile (graphics only)
  151. 415 :
  152. 416 k=c(i):x=x(i):pu=k:ifpu>15thenpu=15
  153. 418 forj=puto1step-1:y=1+j:gosub66:gosub224:next:print"[146]";:sysmt+6,168
  154. 420 x=1:y=1:forj=1tok:gosub66:c(i)=j:gosub202:x=x+1:next:return
  155. 437 :
  156. 438 rem great game
  157. 439 :
  158. 440 poke646,02:x=13:y=03:gosub66:print"[192][192][192][192][192][192][192][192][192]"
  159. 442 y=y+1:gosub66:print"  great  "
  160. 444 y=y+1:gosub66:print"  game!  "
  161. 446 y=y+1:gosub66:print"[192][192][192][192][192][192][192][192][192]"
  162. 448 g7=1000:sysmt+3,9,30,8,14,160,0:      goto451
  163. 450 sysmt+3,9,30,8,14,160,0:y=11:x=15:gosub66:print"[144]a moment": g7=0:gosub350
  164. 451 ifg7>h