home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 8 / 008.d81 / dabble (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1985-01-01  |  9.8 KB  |  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):poke781,22:poke782,38-len(str$(sc%)):syss:printsc%
  219. 2730 return
  220. 29997 :
  221. 29998 rem *** title page            ***
  222. 29999 :
  223. 30000 wd$="dabble":sc%=0:gosub2100:lf=36:v=4:h=3
  224. 30110 q$="a great new way to improve your vocabulary and spelling abilities."
  225. 30115 gosub2300
  226. 30120 poke781,9:poke782,3:syss:q$="mdlzxbackefbghl":forx=1tolen(q$)
  227. 30125 printmid$(q$,x,1)" ";:gosub30:next:gosub80
  228. 30130 pokelw+3,4:pokecw+3,8:gosub30:gosub80:pokels+5,132:pokecs+5,9:gosub70
  229. 30135 gosub80
  230. 30140 pokelw+5,1:pokecw+5,8:gosub30:gosub80:pokels+15,129:pokecs+15,9:gosub70
  231. 30145 gosub80
  232. 30150 pokelw+7,2:pokecw+7,8:gosub30:gosub80:pokels+13,130:pokecs+13,9:gosub70
  233. 30155 gosub80
  234. 30160 pokelw+9,2:pokecw+9,8:gosub30:gosub80:pokels+25,130:pokecs+25,9:gosub70
  235. 30165 gosub80
  236. 30170 pokelw+11,12:pokecw+11,8:gosub30:gosub80:pokels+7,140:pokecs+7,9:gosub70
  237. 30175 gosub80
  238. 30180 pokelw+13,13:pokecw+13,8:gosub30:gosub80:pokels+3,141:pokecs+3,9:gosub70
  239. 30185 gosub80
  240. 30190 poke781,12:poke782,30:syss:printp2$:gosub50:gosub80
  241. 30200 pokelw+13,100:pokecw+13,0:gosub30:gosub80:pokels+3,13:pokecs+3,0:gosub40
  242. 30205 gosub80
  243. 30210 poke781,12:poke782,30:syss:print"       "
  244. 30220 pokelw+13,5:pokecw+13,8:gosub30:gosub80:pokels+21,133:pokecs+21,9:gosub70
  245. 30222 gosub80
  246. 30225 poke781,12:poke782,30:syss:printp3$:gosub60:gosub80
  247. 30230 lf=36:v=17:h=3
  248. 30240 q$="dabble is a great new vocabulary game for the commodore.":gosub2300
  249. 30250 poke781,22:poke782,33:syss:print"10000"
  250. 30260 return
  251. 30997 :
  252. 30998 rem *** read in text file     ***
  253. 30999 :
  254. 31000 open15,8,15:open4,8,4,"0:dabble words,seq.read"
  255. 31010 input#4,r
  256. 31020 forx=1tor:input#4,df$(x):input#4,wd$(x):input#4,st$(x):next
  257. 31025 close4:close15
  258. 31030 forx=1tor:a%=(rnd(1)*r)+1:t1$=df$(x):t2$=wd$(x):t3$=st$(x)
  259. 31040 df$(x)=df$(a%):wd$(x)=wd$(a%):st$(x)=st$(a%):
  260. 31050 df$(a%)=t1$:wd$(a%)=t2$:st$(a%)=t3$:next
  261. 31060 return
  262. 31997 :
  263. 31998 rem *** instructions          ***
  264. 31999 :
  265. 32000 printchr$(147)
  266. 32010 print"ddd    aa   [129]bbb   [129]bbb   [154]l    eeee"
  267. 32020 print"d  d  a  a  [129]b  b  [129]b  b  [154]l    e"
  268. 32030 print"d  d  aaaa  [129]bbb   [129]bbb   [154]l    eee"
  269. 32040 print"d  d  a  a  [129]b  b  [129]b  b  [154]l    e"
  270. 32050 print"ddd   a  a  [129]bbb   [129]bbb  [154] llll eeee[144]"
  271. 32060 poke781,10:poke782,10:syss:print"an original program"
  272. 32070 poke781,13:poke782,19:syss:print"by"
  273. 32080 poke781,16:poke782,13:syss:print"donna k. woody"
  274. 32090 poke781,21:poke782,1:syss:print"do you need instructions (y/n)?[160]";
  275. 32100 poke198,0:wait198,1:getkey$
  276. 32110 ifkey$="y"then32150
  277. 32120 ifkey$="n"then32140
  278. 32130 poke781,23:poke782,7:syss:print"please answer 'y' or 'n'.":goto32090
  279. 32140 return
  280. 32150 printchr$(147):printchr$(9):printchr$(14):printchr$(8)
  281. 32160 print"  [196][193][194][194][204][197] is a cross between [211][195][210][193][194][194][204][197],"
  282. 32170 print:print"and a vocabulary building game and"
  283. 32180 print:print"[202][213][205][194][204][197] [204][197][212][212][197][210][211] and........"
  284. 32190 print:print"[215]ell, a lot of things!"
  285. 32200 print:print"  [193] definition of a word will be shown"
  286. 32210 print:print"on the screen.  [194]elow the definition"
  287. 32220 print:print"will be a group of letters.  [212]he number"
  288. 32230 print:print"of letters will depend on the length of"
  289. 32240 print:print"the word and skill level you select."
  290. 32250 poke781,23:poke782,5:syss:print"[208]ress <[211][208][193][195][197] [194][193][210]> to continue.";
  291. 32260 poke198,0:wait198,1:getkey$:printchr$(147)
  292. 32270 print:print"  [217]our mission (should you decide to"
  293. 32280 print:print"accept it) is to spell the defined"
  294. 32290 print:print"word.  [217]ou will receive points for each"
  295. 32300 print:print"word based on letter values, the number"
  296. 32310 print:print"of letters in the word, and the level"
  297. 32320 print:print"chosen."
  298. 32330 print:print"  [212]he top 10 high scores are saved to"
  299. 32340 print:print"disk."
  300. 32350 print:print"  [193]fter you have correctly spelled the"
  301. 32360 print:print"word (or given up!), a sentence"
  302. 32370 print:print"will be given using the word."
  303. 32380 poke781,23:poke782,5:syss:print"[208]ress <[211][208][193][195][197] [194][193][210]> to continue.";
  304. 32390 poke198,0:wait198,1:getkey$
  305. 32400 printchr$(9):printchr$(142):printchr$(8):goto32140
  306. 32996 :
  307. 32997 rem *** skill levels          ***
  308. 32998 :
  309. 33000 printchr$(147):print"  <<<  choose your skill level >>>   "
  310. 33010 print:print"level <1> - the easiest":print:print"level <2>":print
  311. 33020 print"level <3>":print:print"level <4>"
  312. 33030 print:print"level <5> - the hardest"
  313. 33040 poke781,13:poke782,1:syss:print"which level do you want to try (1-5)? ";
  314. 33050 poke198,0:wait198,1:getkey$
  315. 33060 ifasc(key$)<49orasc(key$)>53thengoto33040
  316. 33070 key=val(key$):onkeygoto33080,33090,33100,33110,33120
  317. 33080 level=key:ltr=2:goto33130
  318. 33090 level=key:ltr=4:goto33130
  319. 33100 level=key:ltr=6:goto33130
  320. 33110 level=key:ltr=8:goto33130
  321. 33120 level=key:ltr=10
  322. 33130 return
  323. 63000 rem   connect back to loadstar
  324. 63010 print"load"chr$(34)"hello"chr$(34)",8":print"run"
  325. 63020 poke631,13:poke632,13:poke198,2:end
  326.