home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1991 September / 1991-09.d64 / spanish.vocab (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  7KB  |  187 lines

  1. 0 rem copyright 1991 - compute publications intl ltd - all rights reserved
  2. 10 rem spanish vocabulary quiz v1.2
  3. 20 rem        by chris stoy
  4. 30 :
  5. 40 goto 2200:rem setup
  6. 100 t=0:print"[144]"an$"":poke 49153,5:poke49157,5
  7. 105 print"[153]"aw$;spc(20-len(aw$))">";:ln=17:gosub 200
  8. 110 on -(wd$="?")-2*(wd$="*") goto 145,700
  9. 115 sys 49152
  10. 116 lc=len(an$):if len(wd$)>len(an$) then lc=len(wd$)
  11. 117 pc=int(peek(49212)*100/lc)-int(peek(49213)/2)
  12. 120 if pc>70 then print"_[205]uy [194]ien! [195]orrect!":sc=sc+abs(t-3):c=c+1:goto145
  13. 125 t=t+1:if t=3 then 145
  14. 126 if t=1 then poke 49157,245
  15. 127 if t=2 then poke 49153,6:poke 49157,229
  16. 130 if pc>30 then print"[129] [193]lmost. [212]ry again.":goto 140
  17. 135 print"[149] [211]orry, wrong. [212]ry again."
  18. 140 gosub 410:goto105
  19. 145 w=w+1:rn%(i)=1:print"[153][212]he answer is "an$"[153].":gosub 1000:if w=x then 700
  20. 150 fl=1:goto 400
  21. 200 wd$="":poke 198,0:print"<";
  22. 205 get ke$:if ke$="" then 205
  23. 206 poke54296,15:poke54296,0
  24. 210 if ke$=chr$(13) then print:return
  25. 215 if ke$=chr$(17) or ke$=chr$(19) or ke$=chr$(145) then 205
  26. 217 if ke$=chr$(147) then for zz=0 to len(wd$):printchr$(20);:next:goto 200
  27. 220 if ke$<>chr$(20) then 235
  28. 225 if len(wd$)=0 then 205
  29. 230 wd$=left$(wd$,len(wd$)-1):print"[157][157]< [157]";:goto 205
  30. 235 if len(wd$)>ln then 205
  31. 240 wd$=wd$+ke$:print"[157]"ke$"<";
  32. 245 goto 205
  33. 300 if x<1 then 1300
  34. 315 print"[147]"tab(11)"[209]uiz "qt$" [215]ords"
  35. 320 printtab(11)"[129][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  36. 325 print"[153]  [201] will give you a word in "qt$"[153],"
  37. 330 print" then [201] will ask you to enter the word":print" in "ot$"[153]."
  38. 335 print"[197]xample:":print""qt$;spc(13);ot$
  39. 340 print"[150][163][163][163][163][163][163][163]"spc(13)"[163][163][163][163][163][163][163]":print"[153]"eq$:print"[145]"tab(20);eo$:gosub 1000
  40. 345 for z=1 to x:rn%(z)=0:next:w=0:sc=0:c=0
  41. 400 i=int(x*rnd(0))+1:if rn%(i)=1 then400
  42. 405 print"[147][158][212]ype your answer, then hit [[210][197][212][213][210][206][158]]."
  43. 410 print""qt$;spc(13);ot$:print"[150][163][163][163][163][163][163][163]"spc(13)"[163][163][163][163][163][163][163]":return
  44. 500 qt$="[197]nglish":ot$="[211]panish":eq$="the word":eo$="la palabra"
  45. 505 gosub 300:if x=0 then 2100
  46. 510 aw$=en$(i):an$=sp$(i):gosub 100:if fl then 510
  47. 513 if f=1 then 500
  48. 515 goto 2100
  49. 600 ot$="[197]nglish":qt$="[211]panish":eo$="the word":eq$="la palabra"
  50. 605 gosub 300:if x=0 then 2100
  51. 610 an$=en$(i):aw$=sp$(i):gosub 100:if fl then 610
  52. 613 if f=1 then 600
  53. 615 goto 2100
  54. 700 fl=0:if w=0 then f=0:return
  55. 703 print"[147]"tab(12)"[195]ongatulations!!"
  56. 705 print tab(9)"[153][217]ou completed the list."
  57. 710 for z=1to192:poke53280,z:next:forz=1to8:print"":next:print""
  58. 715 print"   [158][217]our score: ";int(sc/(3*w)*100);"%"
  59. 720 print"   [158][217]ou got"c"[158]correct out of"w"[158][157]."
  60. 730 print"    [153][215]ould you like to try this list"
  61. 740 print"    again ([217][153] or [206][153])? ";
  62. 750 get ke$:if ke$="" then 750
  63. 755 if ke$="y" then print"[217]":f=1:return
  64. 760 if ke$<>"n" then 750
  65. 765 print"[206]":f=0:return
  66. 1000 printtab(7)"[158][208]ress [[210][197][212][213][210][206][158]] to continue.":poke 198,0
  67. 1005 get ke$:if ke$<>chr$(13) then 1005
  68. 1010 return
  69. 1100 poke 53272,21:poke 53280,14:poke 53281,6:print"[154][147]":end
  70. 1200 input#15,er,er$,dt,ds:fl=0
  71. 1205 if er=62 then print"[147]"tab(13)"[198]ile not found.":fl=1:return
  72. 1210 if er>19 then print"[196][201][211][203] [197][210][210][207][210] #"er;er$"":fl=1
  73. 1215 return
  74. 1300 print"[147]"tab(12)"[204]oad a [215]ord [198]ile"
  75. 1315 printtab(12)"[150][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  76. 1320 print"[153]    [197]nter name of file at the prompt."
  77. 1325 print"   [212]ype [$[153]] to view directory."
  78. 1330 print"   [208]ress [[210][197][212][213][210][206][153]] alone to return to"
  79. 1335 print"   [207][208][212][201][207][206][211] [153]menu."
  80. 1340 print:print"[154][206]ame of file:>";:ln=15:gosub 200
  81. 1345 if wd$="" then 2100
  82. 1350 if wd$="$" then 1410
  83. 1360 fl$=wd$:open15,8,15:open2,8,2,"0:"+fl$+",s,r"
  84. 1365 gosub 1200:if fl=1 then close2:close15:gosub 1000:goto 2100
  85. 1390 input#2,x:for s=1 to x:input#2,en$(s),sp$(s):next
  86. 1400 close2:close15:goto 2100
  87. 1410 print"[147][153][208]ress [[211][200][201][198][212][153]] to pause.":sys 49250:print:gosub 1000:goto 1300
  88. 1600 print"[147]"tab(11)"[215]ord [198]ile [207]ptions":printtab(11)"[150][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  89. 1605 printtab(16)"[153][207]ptions":printtab(16)"[149][163][163][163][163][163][163][163]"
  90. 1610 printtab(8)"1. [195]reate a file":printtab(8)"2. [193]ppend to a file"
  91. 1615 printtab(8)"3. [197]dit a file"
  92. 1620 printtab(8)"4. [210]eturn to [205]ain [205]enu"
  93. 1630 print"[153]      [197]nter your choice:    [157][157][157]";
  94. 1635 get ke$:if ke$<"1" or ke$>"5" then 1635
  95. 1640 print ke$:on val(ke$) goto 1700,1700,1800,2100
  96. 1698 rem create/append a file
  97. 1700 ke=val(ke$):if ke=2 and x=0 then 1300
  98. 1705 print"[147]"tab(12)"[205]ake a [215]ord [198]ile":printtab(12)"[150][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  99. 1707 if ke=2 then 1720
  100. 1710 print"    [153][206]ame of file:";:ln=15:gosub 200:if wd$="" then 2100
  101. 1715 fl$=wd$+left$(nl$,16-len(wd$)):f=f+1:f$(f)=fl$:x=0:ke=2:goto 1705
  102. 1720 x=x+1:print""tab(10)"[158][198]ile:";fl$
  103. 1725 printtab(7)"[158][206]umber of words so far:";x-1
  104. 1730 print"[153]    [198]irst, enter the [197]nglish[153] word at"
  105. 1735 print"   the prompt, then enter the [211]panish."
  106. 1740 print"[155] [197]nglish word: ";:ln=17:gosub 200:en$(x)=wd$:if wd$="" then 1763
  107. 1745 print"[155] [211]panish word: ";:ln=17:gosub 200:sp$(x)=wd$:if wd$="" then 1763
  108. 1750 print"[158] [201]s this correct ([217][158] or [206][158])? ";
  109. 1755 get ke$:if ke$="n" then print"[206]":goto 1705
  110. 1760 if ke$<>"y" then 1755
  111. 1763 if wd$="" then print"[144]":x=x-1
  112. 1765 print"[217]":print"[158][197]nter another word ([217][158] or [206][158])? ";
  113. 1770 get ke$:if ke$="y" then print"[217]":goto 1705
  114. 1775 if ke$<>"n" then 1770
  115. 1780 print"[206]":open15,8,15:if ke=2 then print#15,"s0:"+fl$:gosub 1200
  116. 1785 if fl then close 15:gosub 1000:goto 2100
  117. 1790 open2,8,2,"0:"+fl$+",s,w":gosub 1200:if fl then close 2:goto 1785
  118. 1791 print#2,x:for s=1 to x:print#2,en$(s):print#2,sp$(s):next:gosub 1200
  119. 1792 if fl then close 2:goto 1785
  120. 1793 print"[147][153]"tab(14)"[198]ile saved."
  121. 1794 close2:close15:gosub1000:goto 2100
  122. 1800 if x=0 then gosub 300:goto 2100
  123. 1810 s=1:fl=1:print"[147]"tab(15)"[197]dit a [198]ile"
  124. 1815 printtab(15)"[150][163][163][163][163][163][163][163][163][163][163][163]"
  125. 1820 print"[158] [198]ile: ";fl$;spc(17-len(fl$))"[158]# of words:";x
  126. 1825 print"[150][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183]"
  127. 1830 print"[153] [207]n word:    [157][157][157][157]";s
  128. 1835 print"[155]  [197]nglish word: ";en$(s);left$(sc$,22-len(en$(s))):print
  129. 1840 print"[155]  [211]panish word: ";sp$(s);left$(sc$,22-len(sp$(s))):print
  130. 1845 print"[158][[197][158]] to [197]dit[158] words"
  131. 1850 print"[[195][158]] to [195]ontinue[158] listing"
  132. 1855 print"[[209][158]] to [209]uit[158] to [207]ptions[158] menu"
  133. 1860 get ke$:if ke$="" then1860
  134. 1865 on -(ke$="e")-2*(ke$="c")-3*(ke$="q")goto1890,1870,1880:goto1860
  135. 1870 s=s+1:if s < (x+1) then1830
  136. 1875 s=1:goto1830
  137. 1880 if fl then 2100
  138. 1885 ke=2:print"[144]":goto 1780
  139. 1890 print""tab(16);"";:poke19,65:inputte$:poke19,0:print
  140. 1891 print""tab(16);"";:poke19,65:inputts$:poke19,0:print
  141. 1892 if te$<>en$(s) or ts$<>sp$(s) then en$(s)=te$:sp$(s)=ts$:fl=0
  142. 1893 goto 1830
  143. 2100 print"[147]"tab(9)"[211]panish [214]ocabulary [209]uiz"
  144. 2105 printtab(9)"[150][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  145. 2110 printtab(16)"[153][207]ptions":printtab(16)"[163][163][163][163][163][163][163]"
  146.