home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 8 / 008.d81 / dabble (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  10KB  |  326 lines

  1. 10 s=65520:poke783,peek(783)and254:poke53280,7:poke53281,1:printchr$(142)
  2. 11 lw=1544:ls=1384:cw=55816:cs=55656:p1$="[129]that letter is not available.[144]"
  3. 12 printchr$(8):p2$=" wrong [146][144]":p3$="[129] right [146][144]":dimsl$(35):f=54272
  4. 13 dimdf$(40),wd$(40),st$(40)
  5. 20 goto100
  6. 27 :
  7. 28 rem *** word letter sound       ***
  8. 29 :
  9. 30 pokef+1,14:pokef+5,3:pokef+6,255-15:pokef+24,15:pokef+4,17
  10. 31 ford=3to40step15:pokef+1,d:pokef+4,17:nextd:pokef+4,16:return
  11. 37 :
  12. 38 rem *** backspace sound         ***
  13. 39 :
  14. 40 pokef+1,14:pokef+5,3:pokef+6,255-15:pokef+24,15:pokef+4,17
  15. 41 ford=1to40step10:pokef+1,40-d:pokef+4,17:nextd:pokef+4,16:return
  16. 47 :
  17. 48 rem *** wrong answer sound       ***
  18. 49 :
  19. 50 pokef+24,15:pokef+6,240:pokef+4,17
  20. 51 fora=1to4:forx1=1to25:pokef+1,80-x1:nextx1:nexta:pokef+4,32:pokef+4,16:return
  21. 57 :
  22. 58 rem *** right answer sound       ***
  23. 59 :
  24. 60 pokef+24,15:pokef+6,240:pokef+4,17
  25. 61 fora=1to4:forx1=16to62step4:pokef+1,77-x1:nextx1:nexta:pokef+4,32:
  26. 62 pokef+4,16:return
  27. 67 :
  28. 68 rem *** scrambled letter sound   ***
  29. 69 :
  30. 70 pokef+24,15:pokef+6,240:pokef+4,17
  31. 71 forx1=25to1step-4:pokef+1,26-x1:nextx1:pokef+4,32:pokef+4,16:return
  32. 77 :
  33. 78 rem *** delay loop               ***
  34. 79 :
  35. 80 ifpeek(198)=1thenreturn
  36. 81 forx1=1to500:next:return
  37. 99 :
  38. 100 gosub30000:rem *** title page ***
  39. 101 :
  40. 110 gosub31000:rem *** read text file ***
  41. 119 :
  42. 120 poke781,23:poke782,5:syss:print"[129]press <space bar> to continue.[144]"
  43. 130 poke198,0:wait198,1:getkey$
  44. 140 ifkey$=chr$(133)then400:rem *** print final score - end game ***
  45. 149 :
  46. 150 gosub32000:rem *** instructions ***
  47. 160 q%=1:sc=0:gu$="":z9=0
  48. 169 :
  49. 170 gosub33000:rem *** skill levels ***
  50. 180 vc=13:hc=3:vl=8:hl=3:gu$=""
  51. 189 :
  52. 190 gosub2000:rem *** get definition, words, sentences ***
  53. 199 :
  54. 200 gosub2050:rem *** scramble letters ***
  55. 209 :
  56. 210 gosub2100:rem *** format screen ***
  57. 219 :
  58. 220 lf=34:v=4:h=3:q$=df$:gosub 2300:rem *** print defintiion ***
  59. 229 :
  60. 230 poke781,9:poke782,3:syss
  61. 235 rem *** print scrambled letters w/sound ***
  62. 240 forx=1tolen(sl$):printsl$(x)" ";:gosub30:next
  63. 249 :
  64. 250 gu$="":gosub2400:rem *** get keyboard input ***
  65. 251 :
  66. 252 ifflag=1thenhc=3:forx=1tolen(wd$):poke781,vc:poke782,hc:syss
  67. 253 ifflag=1thenprintmid$(wd$,x,1);" ":hc=hc+2:next:flag=0
  68. 259 :
  69. 260 lf=34:v=17:h=3:q$=st$:gosub2300:rem *** print sentence ***
  70. 269 :
  71. 270 ifkey$=chr$(133)then300:rem *** f1 pressed ***
  72. 279 :
  73. 280 gosub2700:rem *** figure and print score ***
  74. 299 :
  75. 300 poke781,23:poke782,1:syss:print"[129]do you want to continue (y/n)? [144]";
  76. 310 poke198,0:wait198,1:getkey$
  77. 320 ifkey$="n"thenprintchr$(147):goto350
  78. 330 ifkey$="y"then180:rem *** get another word ***
  79. 340 goto300
  80. 349 :
  81. 350 poke781,23:poke782,1:syss:print"do you want to play again (y/n)? ";
  82. 360 poke198,0:wait198,1:getkey$
  83. 370 ifkey$="n"then400
  84. 380 ifkey$="y"thengosub31030:goto160:rem *** set up new skill level ***
  85. 390 goto350
  86. 399 :
  87. 400 printchr$(147):print:print"your final score was "sc%:flag=0
  88. 409 :
  89. 410 open15,8,15:open4,8,4,"0:dabble score,seq,read"
  90. 420 forx=0to9:input#4,h$(x,0):input#4,h$(x,1):next:close4:close15
  91. 429 :
  92. 430 ifsc%<val(h$(9,1))thenflag=1
  93. 439 :
  94. 440 ifflag=1thenprint:print"your score was not high enough to be"
  95. 450 ifflag=1thenprint"included in the high score list."
  96. 460 ifflag=1thenprint:print"better luck next time!":flag=0:goto650
  97. 469 :
  98. 470 print:print"your score was very good!  enter your"
  99. 480 print"initials and i will include it in my"
  100. 490 print"high score list."
  101. 500 print:print
  102. 510 input"enter your initials ->[160]";it$
  103. 520 print:print"one moment, please....."
  104. 529 :
  105. 530 ifit$=""thenit$="aaa"
  106. 535 iflen(it$)>3thenit$=left$(it$,3)
  107. 540 h$(9,0)=it$:h$(9,1)=right$(str$(sc%),len(str$(sc%))-1)
  108. 550 fori=0to8:forj=i+1to9:ifval(h$(i,1))>=val(h$(j,1))then 580
  109. 560 k$=h$(i,1):h$(i,1)=h$(j,1):h$(j,1)=k$
  110. 570 k$=h$(i,0):h$(i,0)=h$(j,0):h$(j,0)=k$
  111. 580 nextj:nexti
  112. 589 :
  113. 590 open15,8,15,"s0:dabble score"
  114. 600 open4,8,4,"0:dabble score,seq,write"
  115. 610 forx=0to9:print#4,h$(x,0):print#4,h$(x,1):next
  116. 620 close4:close15
  117. 629 :
  118. 630 poke781,23:poke782,1:syss:print"press <space bar> to continue."
  119. 640 poke198,0:wait198,1:getkey$
  120. 649 :
  121. 650 printchr$(147):print"high scores for dabble are:"
  122. 660 print:forx=0to9:printh$(x,0);tab(15-len(h$(x,1)));h$(x,1):print:next
  123. 670 poke781,23:poke782,1:syss:print"press <space bar> to continue."
  124. 680 poke198,0:wait198,1:getkey$
  125. 690 printchr$(147):poke781,15:poke782,1:syss
  126. 700 print"thanks for playing dabble!"
  127. 709 :
  128. 800 goto63000:rem *** end ***
  129. 1997 :
  130. 1998 rem *** get definition etc.    ***
  131. 1999 :
  132. 2000 z9=z9+1:ifz9>rthen2020
  133. 2010 df$=df$(z9):wd$=wd$(z9):st$=st$(z9):return
  134. 2020 printchr$(147):print"one moment, please, while i get some"
  135. 2025 print"more questions......."
  136. 2030 gosub31030:z9=0:goto2000
  137. 2047 :
  138. 2048 rem *** scramble letters       ***
  139. 2050 sl$=wd$
  140. 2060 forz=1toltr:j$=chr$(((rnd(1)*26)+1)+64):sl$=sl$+j$:next
  141. 2065 iflen(sl$)>17thensl$=left$(sl$,17)
  142. 2070 forz=1tolen(sl$):sl$(z)=mid$(sl$,z,1):next
  143. 2080 forz=1tolen(sl$):a%=(rnd(1)*len(sl$))+1:tq$=sl$(z):sl$(z)=sl$(a%)
  144. 2085 sl$(a%)=tq$:next
  145. 2087 return
  146. 2097 :
  147. 2098 rem *** format screen          ***
  148. 2099 :
  149. 2100 printchr$(147):poke781,0:poke782,16:syss:print"[129] dabble "
  150. 2105 poke781,2:poke782,1:syss:forx=0to37:print"[149][218]";:next
  151. 2110 poke781,7:poke782,1:syss:forx=0to37:print"[218]";:next:
  152. 2120 poke781,11:poke782,1:syss:forx=0to37:print"[218]";:next:
  153. 2130 poke781,15:poke782,1:syss:forx=0to37:print"[218]";:next:
  154. 2140 poke781,20:poke782,1:syss:forx=0to37:print"[218]";:next:
  155. 2150 forx=2to19:poke781,x:poke782,1:syss:print"[149][218]";tab(38)"[218][144]":next
  156. 2160 poke781,2:poke782,14:syss:print"[129] definition "
  157. 2170 poke781,7:poke782,15:syss:print" letters "
  158. 2180 poke781,11:poke782,12:syss:print" spell the word "
  159. 2190 poke781,15:poke782,15:syss:print" sentence [144]"
  160. 2195 poke781,21:poke782,1:syss:print"press [129]del[144] to back up"
  161. 2200 poke781,22:poke782,1:syss:print"press [129]f1[144]  to give up"
  162. 2210 poke781,22:poke782,23:syss:print"score >>"
  163. 2220 poke781,22:poke782,38-len(str$(sc%)):syss:printsc%
  164. 2230 sl=len(wd$):ifsl*2>=36then2250
  165. 2240 poke781,13:poke782,3:syss:forx=1tosl:print"[164] ";:next:goto2260
  166. 2250 poke781,13:poke782,3:syss:forx=1tosl:print"[164]";:next
  167. 2260 return
  168. 2297 :
  169. 2298 rem *** format statements      ***
  170. 2299 :
  171. 2300 iflen(q$)>lfthen2320
  172. 2310 poke781,v:poke782,h:syss:printq$:return
  173. 2320 yf=0:xf=lf
  174. 2330 ifmid$(q$,xf,1)=chr$(32)thenpoke781,v:poke782,h:syss
  175. 2335 ifmid$(q$,xf,1)=chr$(32)thenprintleft$(q$,xf-1):v=v+1:goto2350
  176. 2340 xf=xf-1:goto2330
  177. 2350 yf=xf+lf:ifyf>len(q$)thenyf=len(q$)-xf
  178. 2360 ifyf<=lfthenpoke781,v:poke782,h:syss:printright$(q$,yf):return
  179. 2370 ifmid$(q$,yf,1)=chr$(32)thenpoke781,v:poke782,h:syss
  180. 2375 ifmid$(q$,yf,1)=chr$(32)thenprintmid$(q$,xf+1,yf-xf):xf=yf:v=v+1:goto2360
  181. 2380 yf=yf-1:goto2370
  182. 2396 :
  183. 2397 rem *** keyboard imput and     ***
  184. 2398 rem *** printing to screen     ***
  185. 2399 :
  186. 2400 poke781,vc:poke782,hc:syss:flag=0:poke198,0:wait198,1:getkey$
  187. 2405 iflen(gu$)>len(wd$)then2400
  188. 2410 poke781,23:poke782,1:syss:print"                             "
  189. 2420 ifkey$=chr$(133)thenflag=1:goto2690
  190. 2425 ifkey$=chr$(20)thenpoke781,12:poke782,30:syss:print"       ":goto2540
  191. 2430 ifkey$<chr$(65)orkey$>chr$(90)then2400
  192. 2440 forx=ls+3to(ls+3)+(len(sl$)*2)step2
  193. 2450 ifasc(key$)=peek(x)+64thenloc=x:cc=x-ls:x=(ls+3)+(len(sl$)*2):flag=1
  194. 2460 next
  195. 2470 ifflag=0thenpoke781,23:poke782,1:syss:printp1$:gosub50:goto2400
  196. 2480 poke781,vc:poke782,hc:syss:printkey$:gosub30
  197. 2490 pokeloc,asc(key$)+64:pokecs+cc,6:gosub70
  198. 2500 gu$=gu$+key$:hc=hc+2:flag=0
  199. 2505 ifflag=1thengu$=gu$+key$:hc=hc+2:goto2564
  200. 2510 iflen(gu$)<len(wd$)then2400
  201. 2520 ifgu$=wd$thenpoke781,12:poke782,30:syss:printp3$:gosub60:goto2690
  202. 2530 poke781,12:poke782,30:syss:printp2$:gosub50
  203. 2540 hc=hc-2:ifhc<3thenhc=3:goto2400
  204. 2550 iflen(gu$)=1thengu$="":goto2570
  205. 2560 gu$=left$(gu$,len(gu$)-1)
  206. 2570 cn=peek(lw+hc):poke781,vc:poke782,hc:syss:print"[164]":gosub40:
  207. 2580 forx=ls+3to(ls+3)+(len(sl$)*2)step2
  208. 2590 ifcn+128=peek(x)thenloc=x:cc=x-ls:x=(ls+3)+(len(sl$)*2)
  209. 2600 next
  210. 2610 pokeloc,cn:pokecs+cc,0:gosub70:cc=0:loc=0
  211. 2620 goto2400
  212. 2690 return
  213. 2696 :
  214. 2697 rem *** figure and print score ***
  215. 2698 :
  216. 2700 s1=0:forz=1tolen(wd$):s1=s1+asc(mid$(wd$,z,1))-64:next
  217. 2710 s1=s1+(len(sl$)*2):s1=s1+(level*1.75)
  218. 2720 sc%=sc%+int(s1):p