home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 48
/
048side2.d81
/
speller
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
7KB
|
193 lines
5 sk=54272:v=53248:it=0:goto50
6 rem ****** writing sound *******
7 :
10 pokesk+24,15:pokesk+1,10:pokesk+6,240
12 pokesk+4,23:pokesk+6,0:pokesk+4,0:return
14 rem ****** sound *******
15 pokesk+24,15:pokesk+1,130:pokesk+5,9:pokesk+15,30
16 pokesk+4,21:pokesk+4,20:return
18 rem ****** clear answer *******
19 :
20 fori=0to23:sl=1347:cl=55619:pokesl+i,32:pokesl+i+40,32:nexti:return
30 rem ******* right sound *********
31 :
35 x$="correct":sl=1036:fori=1to17:poke55307+i,7:poke55307+i+40,3:next:gosub500
37 forl=0to24:pokesk+l,0:next:pokesk+1,130:pokesk+5,9:pokesk+15,30
40 pokesk+24,15:forl=1to16:pokesk+4,21:fort=1to100:next:pokesk+4,20
41 fori=1to20:next:poke53281,l:next:pokesk+24,0:fori=0to14:sl=1036
42 pokesl+i,32:pokesl+i+40,32:nexti:return
43 rem ******* wrong sound **********
44 :
45 x$="wrong":sl=1036:fori=0to10:poke55307+i,2:poke55307+i+40,2:next:gosub500
46 poke53281,2:pokesk+24,15:pokesk+5,15:pokesk+6,16:pokesk+1,6:pokesk,0
47 pokesk+4,33:forn=1to300:nextn:pokesk+4,32:poke53281,0:x$="":forty=1to100
48 nextty:fori=0to10:sl=1036:pokesl+i,32:pokesl+i+40,32:nexti:return
50 print"[147] please wait...."
55 rb=108:dimq$(rb):fori=1torb:readq$(i):next
60 data apple,hamburger,candy cane,ball,snake,bird,bee,fish,grapes,cake
61 data airplane,lollipop,ice cream,key,sailboat,sun,shoe,leaf,flag,elephant
62 data fire,bottle,balloon,calculator,cup,hammer,square,heart,arrow,candle
63 data rocket,ring,bell,pie,cookie,scissors,footprint,toothbrush,brick
64 data knife,flower,one,two,three,four,five,six,seven,eight,nine,joystick
65 data teeth,lips,car,turtle,snowman,butterfly,match,plant,rainbow,cloud,hand
66 data bat,tank,cannon,frog,snail,spider,clock,chain,truck,boot,corn,windmill
67 data house,lamp,trumpet,mushroom,penguin,lion,clown,seal,mittens,igloo,shell
68 data marble,umbrella,banana,moon,helicopter,present,ladder,guitar,magnet
69 data hat,tie,sock,kite,rabbit,feather,wagon,bed,chair,table,gun,light bulb
70 data wrench,bomb
90 rem ****** define characters *****
91 :
100 dimt(100):dimn(100):printchr$(8):g=54272:w=0
110 poke646,1:forj=0to15:readt(j):next
120 data 0,3,12,15,48,51,60,63,192,195,204,207,240,243,252,255
200 g=53248:gn=12288
220 poke56333,127:poke1,51:forq=0to1023:pokegn+q,peek(g+q):next
240 poke1,55:poke56333,129:poke53272,29
300 poke13312,0
310 poke53265,27:poke53270,200:poke53277,20:poke56576,151
320 forr=0to212step8:b1=12288+r:b2=13312+4*r
330 fori=0to4step4:fork=0to3:j=peek(b1+k+i):n=b2+2*(k+i)+1
340 x1=t((jand240)/16):x2=t(jand15)
345 poken,x1:poken+1,x1:poken+16,x2:poken+17,x2:nextk,i,r
350 rem :::::::main routine ::::::::
360 printchr$(147)
400 pokev+21,0:x$="speller":sl=1036:fori=1to17:poke55307+i,7:poke55307+i+40,6
401 next:gosub500:gosub1000
402 gosub560
405 x$="abcdefghijklmn":sl=1545:fori=0to39:poke55817+i,3:next:gosub500
407 x$="opqrstuvwxyz":sl=1665:fori=1to24:poke55936+i,3:nexti:pokesl+i+40,82
408 pokesl-1+i+40,82:gosub500
420 ns=sl+40:poke210,int(ns/256):poke209,ns and 255:goto710
500 forp=1tolen(x$):l=(asc(mid$(x$,p,1))-64)*4+128
510 ifl=0then550
530 pokesl+g,0:pokesl+1+g,0:pokesl+40+g,0:pokesl+41+g,0
540 pokesl,l:pokesl+1,l+2:pokesl+40,l+1:pokesl+41,l+3
550 sl=sl+2:next:return
555 rem ******* print border *******
560 print"":fort=1to17:print"[158] ";:nextt
565 fort=1to9:print"[158] "tab(36)"[158] ":nextt
570 print"[145]":fort=1to19:print"[158] ";:nextt
575 print"":fort=1to17:print"[158] ";:nextt
580 fort=1to6:print"[158] "tab(36)"[158] ":nextt
585 fort=1to19:print"[158] ";:nextt
590 print"[145][145][145][145][145][145]":print"[151][213][192][192][192][192][192][201][213][192][192][192][192][192][192][201][213][192][192][192][192][192][201]"
595 print"[194]enter[151][194][194]erase [151][194][194]menu[151] [194]"
597 print"[151][202][192][192][192][192][192][203][194]letter[151][194][202][192][192][192][192][192][203]"
600 print"[151] [202][192][192][192][192][192][192][203] "
605 print""
610 t=27:printtab(t)"[207]";:fori=1to7:print"[183]";:next:print"[208]"
615 fori=1to6:printtab(t)"[180] [170]":next:printtab(t)"[204]";:fori=1to7
620 print"[175]";:next:print"[186]":gosub1160:return
700 rem ::::: main routine pt.2 :::::
710 ifit=0thenpoke2047,13:forn=0to62:readq:poke832+n,q:next:it=1
712 pokev+46,7:po=28:b=65:pokev+14,po
715 pokev+15,150:pokev+28,1:gosub900:pokev+21,129
726 data000,000,000,000,000,000,000,000
727 data000,031,255,248,016,000,008,016
728 data000,008,016,000,008,016,000,008
729 data016,000,008,016,000,008,016,000
730 data008,016,000,008,016,000,008,016
731 data000,008,016,000,008,016,000,008
732 data016,000,008,016,000,008,016,000
733 data008,016,000,008,031,255,248,000
735 sl=1347:cl=55619:c=0:goto 800
740 poke2047,13:jv=peek(56320):fr=jvand16:jv=15-(jvand15)
745 iffr<>16thengosub10:c=c+1:return
750 if jv=8 thenpo=po+16:b=b+1:pokev+14,po:gosub15
752 ifa=1andjv=1 thenpokev+15,150:a=0:b=b-14 :gosub15
755 if jv=4 thenpo=po-16:b=b-1:pokev+14,po:gosub15
757 ifa=0andjv=2 thenpokev+15,174:a=1:b=b+14:jv=0:gosub15
760 ifpo>=240thena=1:po=28:pokev+14,po:pokev+15,174
765 ifa=1andpo>=225thena=0:b=65:po=28:pokev+14,po:pokev+15,150
770 ifpo<=27anda=0thenpo=220:a=1:b=91:pokev+14,po:pokev+15,174
772 ifpo<=27anda=1thenpo=236:a=0:b=78:pokev+14,po:pokev+15,150
774 ifa=1andjv=2thengosub1175:b=65:forx=1to1:next:a=0
790 goto 740
794 rem ******* spell it *********
795 :
800 gosub740:ifb=91thenx$=chr$(32):n(c)=32:goto815
805 x$=chr$(b):n(c)=b
815 ifc>11thenc=11:goto800
817 fori=0to2:pokecl+i,1:pokecl+40+i,1:nexti:gosub500:s=sl+2:cl=cl+2
820 goto800
848 rem ******* erase a character ****
849 :
850 ifc<=0thenreturn: cl=55619:sl=1347:c=0:goto860
855 cl=cl-2:sl=sl-2:c=c-1
860 fori=0to2:pokesl+i,32:pokesl+40+i,32:next:return
868 rem **check if spelling is right**
869 :
870 fori=1toc
875 e$=e$+chr$(n(i)):nexti
890 ife$<>g$thengosub45:gosub20:gosub920
895 ife$=g$thengosub35
896 e$="":c=0:gosub20:gosub900:pokev+21,129:return
900 r=int(rnd(.)*rb)+1:x$=q$(r):g$=x$:pokev+21,128
905 poke2040,14:open2,8,2,"0:"+x$+",p,r":forn=0to62
910 input#2,d:poke896+n,d:next:input#2,c0,c1,c2,c3:pokev+39,c2:pokev+37,c1
915 pokev+38,c3:close2:pokev+0,252:pokev+1,80:pokev+23,1:pokev+29,1:return
917 rem **** tell correct answer *****
918 :
920 x$=q$(r):sl=1347:cl=55619:y=len(x$):gosub500:forj=1to5:fori=0to(y*2)
925 pokecl+i,0:pokecl+i+40,0:nexti:fork=1to160:nextk:fori=0to(y*2)
930 pokecl+i,1:pokecl+i+40,2:nexti:nextj
935 jv=peek(56320):fr=jvand16
940 iffr<>16thenreturn
945 goto935
998 rem :::::::: options ::::::::
999 :
1000 print"[163][163][163][163][163][163][163][163][163][163][163][163][163][163]":poke53280,0
1002 poke53281,12:x$="menu":sl=1225:fori=1to14:poke55496+i,7
1005 poke55496+i+40,7:next:print"[163][163][163][163][163][163][163][163]"
1010 gosub500
1015 x$="s":print"pell it":sl=1385:fori=1to2:poke55656+i,6
1020 poke55656+i+40,6:next:gosub500
1025 x$="v":print"iew it (tutorial)":sl=1505:fori=1to2
1030 poke55776+i,6:poke55776+i+40,6:next:gosub500
1035 x$="q":print"uit":sl=1625:fori=1to2:poke55896+i,6
1036 poke55896+i+40,6:next:gosub500
1042 vd=0:xx=1435:cy=55707:pokexx,31:pokecy,7
1045 jv=peek(56320):fr=jvand16:jv=15-(jvand15)
1050 iffr<>16thengosub10:goto1080
1051 ifxx=1675thenp=1
1055 ifjv=2andp=1thenp=0:pokexx,32:gosub15: goto1042
1060 ifjv=2thenpokecy,12:cy=cy+120:xx=xx+120:pokexx,31:pokecy,7:vd=vd+1:gosub15
1075 fori=1to10:nexti:goto1045
1080 ifvd=0thenprint"[147]":poke53281,0:return
1082 ifvd=1thenpoke53281,0:goto1100
1084 ifvd=2then60000
1098 rem ******** view it **********
1099 :
1100 pokev+14,0:print"[147][150]select enter to continue"
1101 pokev+28,1:print"[150]select menu for options":gosub560
1103 sl=1347:cl=55618:gosub900:pokev+21,129:fori=1to(len(x$)*2):pokecl+i,7
1105 pokecl+i+40,7:nexti:gosub500:pokev+15,220:pokev+14,70:k=0
1107 jv=peek(56320):fr=jvand16:jv=15-(jvand15)
1110 iffr<>16thengosub10:goto1125
1119 ifjv=4 thenpokev+14,70:k=0
1121 ifjv=8 thenpokev+14,190:k=1
1123 goto1107
1125 ifk=0 then gosub20:goto1103
1129 ifk=1 thenprint"[147]":goto400
1160 open2,8,2,"0:pointer,p,r":forn=0to62:input#2,d
1162 poke960+n,d:next:clos