home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 8
/
008.d81
/
dabble
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
10KB
|
326 lines
10 s=65520:poke783,peek(783)and254:poke53280,7:poke53281,1:printchr$(142)
11 lw=1544:ls=1384:cw=55816:cs=55656:p1$="[129]that letter is not available.[144]"
12 printchr$(8):p2$=" wrong [146][144]":p3$="[129] right [146][144]":dimsl$(35):f=54272
13 dimdf$(40),wd$(40),st$(40)
20 goto100
27 :
28 rem *** word letter sound ***
29 :
30 pokef+1,14:pokef+5,3:pokef+6,255-15:pokef+24,15:pokef+4,17
31 ford=3to40step15:pokef+1,d:pokef+4,17:nextd:pokef+4,16:return
37 :
38 rem *** backspace sound ***
39 :
40 pokef+1,14:pokef+5,3:pokef+6,255-15:pokef+24,15:pokef+4,17
41 ford=1to40step10:pokef+1,40-d:pokef+4,17:nextd:pokef+4,16:return
47 :
48 rem *** wrong answer sound ***
49 :
50 pokef+24,15:pokef+6,240:pokef+4,17
51 fora=1to4:forx1=1to25:pokef+1,80-x1:nextx1:nexta:pokef+4,32:pokef+4,16:return
57 :
58 rem *** right answer sound ***
59 :
60 pokef+24,15:pokef+6,240:pokef+4,17
61 fora=1to4:forx1=16to62step4:pokef+1,77-x1:nextx1:nexta:pokef+4,32:
62 pokef+4,16:return
67 :
68 rem *** scrambled letter sound ***
69 :
70 pokef+24,15:pokef+6,240:pokef+4,17
71 forx1=25to1step-4:pokef+1,26-x1:nextx1:pokef+4,32:pokef+4,16:return
77 :
78 rem *** delay loop ***
79 :
80 ifpeek(198)=1thenreturn
81 forx1=1to500:next:return
99 :
100 gosub30000:rem *** title page ***
101 :
110 gosub31000:rem *** read text file ***
119 :
120 poke781,23:poke782,5:syss:print"[129]press <space bar> to continue.[144]"
130 poke198,0:wait198,1:getkey$
140 ifkey$=chr$(133)then400:rem *** print final score - end game ***
149 :
150 gosub32000:rem *** instructions ***
160 q%=1:sc=0:gu$="":z9=0
169 :
170 gosub33000:rem *** skill levels ***
180 vc=13:hc=3:vl=8:hl=3:gu$=""
189 :
190 gosub2000:rem *** get definition, words, sentences ***
199 :
200 gosub2050:rem *** scramble letters ***
209 :
210 gosub2100:rem *** format screen ***
219 :
220 lf=34:v=4:h=3:q$=df$:gosub 2300:rem *** print defintiion ***
229 :
230 poke781,9:poke782,3:syss
235 rem *** print scrambled letters w/sound ***
240 forx=1tolen(sl$):printsl$(x)" ";:gosub30:next
249 :
250 gu$="":gosub2400:rem *** get keyboard input ***
251 :
252 ifflag=1thenhc=3:forx=1tolen(wd$):poke781,vc:poke782,hc:syss
253 ifflag=1thenprintmid$(wd$,x,1);" ":hc=hc+2:next:flag=0
259 :
260 lf=34:v=17:h=3:q$=st$:gosub2300:rem *** print sentence ***
269 :
270 ifkey$=chr$(133)then300:rem *** f1 pressed ***
279 :
280 gosub2700:rem *** figure and print score ***
299 :
300 poke781,23:poke782,1:syss:print"[129]do you want to continue (y/n)? [144]";
310 poke198,0:wait198,1:getkey$
320 ifkey$="n"thenprintchr$(147):goto350
330 ifkey$="y"then180:rem *** get another word ***
340 goto300
349 :
350 poke781,23:poke782,1:syss:print"do you want to play again (y/n)? ";
360 poke198,0:wait198,1:getkey$
370 ifkey$="n"then400
380 ifkey$="y"thengosub31030:goto160:rem *** set up new skill level ***
390 goto350
399 :
400 printchr$(147):print:print"your final score was "sc%:flag=0
409 :
410 open15,8,15:open4,8,4,"0:dabble score,seq,read"
420 forx=0to9:input#4,h$(x,0):input#4,h$(x,1):next:close4:close15
429 :
430 ifsc%<val(h$(9,1))thenflag=1
439 :
440 ifflag=1thenprint:print"your score was not high enough to be"
450 ifflag=1thenprint"included in the high score list."
460 ifflag=1thenprint:print"better luck next time!":flag=0:goto650
469 :
470 print:print"your score was very good! enter your"
480 print"initials and i will include it in my"
490 print"high score list."
500 print:print
510 input"enter your initials ->[160]";it$
520 print:print"one moment, please....."
529 :
530 ifit$=""thenit$="aaa"
535 iflen(it$)>3thenit$=left$(it$,3)
540 h$(9,0)=it$:h$(9,1)=right$(str$(sc%),len(str$(sc%))-1)
550 fori=0to8:forj=i+1to9:ifval(h$(i,1))>=val(h$(j,1))then 580
560 k$=h$(i,1):h$(i,1)=h$(j,1):h$(j,1)=k$
570 k$=h$(i,0):h$(i,0)=h$(j,0):h$(j,0)=k$
580 nextj:nexti
589 :
590 open15,8,15,"s0:dabble score"
600 open4,8,4,"0:dabble score,seq,write"
610 forx=0to9:print#4,h$(x,0):print#4,h$(x,1):next
620 close4:close15
629 :
630 poke781,23:poke782,1:syss:print"press <space bar> to continue."
640 poke198,0:wait198,1:getkey$
649 :
650 printchr$(147):print"high scores for dabble are:"
660 print:forx=0to9:printh$(x,0);tab(15-len(h$(x,1)));h$(x,1):print:next
670 poke781,23:poke782,1:syss:print"press <space bar> to continue."
680 poke198,0:wait198,1:getkey$
690 printchr$(147):poke781,15:poke782,1:syss
700 print"thanks for playing dabble!"
709 :
800 goto63000:rem *** end ***
1997 :
1998 rem *** get definition etc. ***
1999 :
2000 z9=z9+1:ifz9>rthen2020
2010 df$=df$(z9):wd$=wd$(z9):st$=st$(z9):return
2020 printchr$(147):print"one moment, please, while i get some"
2025 print"more questions......."
2030 gosub31030:z9=0:goto2000
2047 :
2048 rem *** scramble letters ***
2050 sl$=wd$
2060 forz=1toltr:j$=chr$(((rnd(1)*26)+1)+64):sl$=sl$+j$:next
2065 iflen(sl$)>17thensl$=left$(sl$,17)
2070 forz=1tolen(sl$):sl$(z)=mid$(sl$,z,1):next
2080 forz=1tolen(sl$):a%=(rnd(1)*len(sl$))+1:tq$=sl$(z):sl$(z)=sl$(a%)
2085 sl$(a%)=tq$:next
2087 return
2097 :
2098 rem *** format screen ***
2099 :
2100 printchr$(147):poke781,0:poke782,16:syss:print"[129] dabble "
2105 poke781,2:poke782,1:syss:forx=0to37:print"[149][218]";:next
2110 poke781,7:poke782,1:syss:forx=0to37:print"[218]";:next:
2120 poke781,11:poke782,1:syss:forx=0to37:print"[218]";:next:
2130 poke781,15:poke782,1:syss:forx=0to37:print"[218]";:next:
2140 poke781,20:poke782,1:syss:forx=0to37:print"[218]";:next:
2150 forx=2to19:poke781,x:poke782,1:syss:print"[149][218]";tab(38)"[218][144]":next
2160 poke781,2:poke782,14:syss:print"[129] definition "
2170 poke781,7:poke782,15:syss:print" letters "
2180 poke781,11:poke782,12:syss:print" spell the word "
2190 poke781,15:poke782,15:syss:print" sentence [144]"
2195 poke781,21:poke782,1:syss:print"press [129]del[144] to back up"
2200 poke781,22:poke782,1:syss:print"press [129]f1[144] to give up"
2210 poke781,22:poke782,23:syss:print"score >>"
2220 poke781,22:poke782,38-len(str$(sc%)):syss:printsc%
2230 sl=len(wd$):ifsl*2>=36then2250
2240 poke781,13:poke782,3:syss:forx=1tosl:print"[164] ";:next:goto2260
2250 poke781,13:poke782,3:syss:forx=1tosl:print"[164]";:next
2260 return
2297 :
2298 rem *** format statements ***
2299 :
2300 iflen(q$)>lfthen2320
2310 poke781,v:poke782,h:syss:printq$:return
2320 yf=0:xf=lf
2330 ifmid$(q$,xf,1)=chr$(32)thenpoke781,v:poke782,h:syss
2335 ifmid$(q$,xf,1)=chr$(32)thenprintleft$(q$,xf-1):v=v+1:goto2350
2340 xf=xf-1:goto2330
2350 yf=xf+lf:ifyf>len(q$)thenyf=len(q$)-xf
2360 ifyf<=lfthenpoke781,v:poke782,h:syss:printright$(q$,yf):return
2370 ifmid$(q$,yf,1)=chr$(32)thenpoke781,v:poke782,h:syss
2375 ifmid$(q$,yf,1)=chr$(32)thenprintmid$(q$,xf+1,yf-xf):xf=yf:v=v+1:goto2360
2380 yf=yf-1:goto2370
2396 :
2397 rem *** keyboard imput and ***
2398 rem *** printing to screen ***
2399 :
2400 poke781,vc:poke782,hc:syss:flag=0:poke198,0:wait198,1:getkey$
2405 iflen(gu$)>len(wd$)then2400
2410 poke781,23:poke782,1:syss:print" "
2420 ifkey$=chr$(133)thenflag=1:goto2690
2425 ifkey$=chr$(20)thenpoke781,12:poke782,30:syss:print" ":goto2540
2430 ifkey$<chr$(65)orkey$>chr$(90)then2400
2440 forx=ls+3to(ls+3)+(len(sl$)*2)step2
2450 ifasc(key$)=peek(x)+64thenloc=x:cc=x-ls:x=(ls+3)+(len(sl$)*2):flag=1
2460 next
2470 ifflag=0thenpoke781,23:poke782,1:syss:printp1$:gosub50:goto2400
2480 poke781,vc:poke782,hc:syss:printkey$:gosub30
2490 pokeloc,asc(key$)+64:pokecs+cc,6:gosub70
2500 gu$=gu$+key$:hc=hc+2:flag=0
2505 ifflag=1thengu$=gu$+key$:hc=hc+2:goto2564
2510 iflen(gu$)<len(wd$)then2400
2520 ifgu$=wd$thenpoke781,12:poke782,30:syss:printp3$:gosub60:goto2690
2530 poke781,12:poke782,30:syss:printp2$:gosub50
2540 hc=hc-2:ifhc<3thenhc=3:goto2400
2550 iflen(gu$)=1thengu$="":goto2570
2560 gu$=left$(gu$,len(gu$)-1)
2570 cn=peek(lw+hc):poke781,vc:poke782,hc:syss:print"[164]":gosub40:
2580 forx=ls+3to(ls+3)+(len(sl$)*2)step2
2590 ifcn+128=peek(x)thenloc=x:cc=x-ls:x=(ls+3)+(len(sl$)*2)
2600 next
2610 pokeloc,cn:pokecs+cc,0:gosub70:cc=0:loc=0
2620 goto2400
2690 return
2696 :
2697 rem *** figure and print score ***
2698 :
2700 s1=0:forz=1tolen(wd$):s1=s1+asc(mid$(wd$,z,1))-64:next
2710 s1=s1+(len(sl$)*2):s1=s1+(level*1.75)
2720 sc%=sc%+int(s1):p