home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 48 / 048side2.d81 / speller (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  7KB  |  193 lines

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