home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 116 / 116.d81 / japanese (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  9KB  |  244 lines

  1. 10 poke56,56:clr: a%=0 :ad=49152: rem a% must be the 1st variable!
  2. 20 dv=peek(186):if dv<8 then dv=8
  3. 30 poke 53280,0:poke 53281,0
  4. 50 rem load modules
  5. 60 sys 57812"toolbox c000",dv,0:poke780,0:poke781,0:poke782,192:sys65493
  6. 70 sys ad+30,"japan-font",dv,14336
  7. 80 rem sys ad+30,"obj.japan",dv,16384
  8. 90 rem preparation
  9. 100 print chr$(142):poke53272,30: rem no alt char set:show cust chars
  10. 200 rem table screen
  11. 210 print"[147][146][159]   a   i   u   e   o
  12. 220 [153]"
  13. 230 print"   [192]   [193]   [194]   [195]   [196]
  14. 240 [153]"open    a   i   u   e   o
  15. 250 print"[159]k  [197]   [198]   [199]   [200]   [201]     [197][187] [198][187] [199][187] [200][187] [201][187]"
  16. 260 print"[159]    ka  ki  ku  ke  ko    ga gi gu ge go";
  17. 270 print"[159]s  [202]   [203]   [204]   [205]   [206]     [202][187] [203][187] [204][187] [205][187] [206][187]
  18. 280 [153]"open    sa  shi su  se  so    za ji zu ze zo";
  19. 290 [153]"opent  (NULL)   (NULL)   (NULL)   (NULL)   (NULL)     (NULL)rnd (NULL)rnd (NULL)rnd (NULL)rnd (NULL)rnd
  20. 300 print"[159]    ta  chi tsu te  to    da ji zu de do";
  21. 310 print"[159]n  [212]   [213]   [214]   [215]   [216]
  22. 320 [153]"open    na  ni  nu  ne  no   (NULL)rnd (NULL)rnd (NULL)rnd (NULL)rnd (NULL)rnd
  23. 330 print"[159]h  [217]   [218]   [219]   [220]   [221]      [159]ba bi bu be bo";
  24. 340 print"[159]    ha  hi  fu  he  ho   [217][188] [218][188] [219][188] [220][188] [221][188]
  25. 350 [153]"openm  (NULL)   (NULL)   tab(   to   fn      openpa pi pu pe po";
  26. 360 [153]"open    ma  mi  mu  me  mo
  27. 370 print"[159]y  [166]       [167]       [168]
  28. 380 [153]"open    ya      yu      yo
  29. 390 print"[159]r  [169]   [170]   [171]   [172]   [173]
  30. 400 [153]"open    ra  ri  ru  re  ro
  31. 410 print"[159]w  [174]       [175]       [176]
  32. 420 [153]"open    wa      n       o"
  33. 430 [158]ad[170]27,24,"setting up..."
  34. 450 :
  35. 500 [143] read in words
  36. 510 [134] a$(133),b$(133),a(92),b(92):[129] i[178]1 [164] 130:[135] a$(i),b$(i):[130]
  37. 600 [143] highlight locs
  38. 610 r[178][171]4:[129] i[178]29 [164] 60:r[178](r[170]4)[172][171](r[179]16):a(i)[178]r[170]3:b(i)[178][181]((i[171]24)[173]5)[172]2:[130]
  39. 620 r[178][171]4:[129]i[178]0[164]13:r[178](r[170]4)[172][171](r[179]16)[172][171](i[179][177]6):a(i)[178]r[170]3:b(i)[178][181]((i[170]39)[173]5)[172]2:[130]
  40. 630 a(0)[178]11:b(0)[178]14:a(1)[178]15:b(1)[178]14:a(2)[178]19:b(2)[178]14:a(3)[178]3:b(3)[178]16
  41. 640 a(4)[178]11:b(4)[178]16:a(5)[178]19:b(5)[178]16:a(14)[178]3:b(14)[178]20:a(15)[178]11:b(15)[178]20
  42. 650 a(16)[178]19:b(16)[178]20:a(92)[178]3:b(92)[178]14:a(11)[178]3:a(12)[178]11:a(13)[178]19
  43. 660 :
  44. 670 [151]781,24:[158]59903:[158]ad[170]18,208
  45. 680 [151]646,1:[158]ad[170]24,3,24,"f sys- opentoggle font   space sys- opencontinue
  46. 681 sysad+45,"f ":onf%goto682,710
  47. 682 sysad+57,16640,18688,14336:goto681
  48. 710 poke 53280,7:print"[147]"
  49. 720 wait 203,64:rem make sure no key is being pressed
  50. 730 poke 655,74:poke 656,64: rem input key-catcher
  51. 800 rem main display
  52. 810 sys ad+15,0,19,0,24,255,1+128
  53. 820 sys ad+24,6,3,"[177] [179][181] [183][185]": rem "japanese" in japanese
  54. 830 sys ad+24,6,4,"[178] [180][182] [184][186]"
  55. 840 sys ad+24,27,3,"[146]english"
  56. 850 :
  57. 860 sys ad+24,21,11,"[154][146]enter translation"
  58. 870 :
  59. 880 sys ad+24,23,17,"[156]f1 - table"
  60. 890 sys ad+24,23,18,"f3 - show answer"
  61. 900 sys ad+24,23,19,"f5 - quit"
  62. 910 :
  63. 920 sys ad+15,20,20,0,24,0,7: rem dividing-line
  64. 930 :
  65. 940 sys ad+24,12,23,"< = >  ": rem "correct" in japanese
  66. 950 sys ad+24,30,23,"[146][153]correct"
  67. 960 :
  68. 970 sys ad+18,224:rem save plain screen in 224
  69. 990 rem loop
  70. 1000 sys 16384:rem randomize
  71. 1010 for s=0to24:poke 54272+s,0:next:rem clear sid chip
  72. 1100 for i=1 to 130:n=peek(20480+i):ta=0
  73. 1200 rem sound
  74. 1210 poke 54272,46: rem  freq low 1
  75. 1220 poke 54273,253:rem  freq high 1
  76. 1230 poke 54286,30: rem  freq low 3
  77. 1240 poke 54287,134:rem  freq high 3
  78. 1250 poke 54277,10: rem  att/dec 1
  79. 1260 poke 54278,74: rem  sus/rel 1
  80. 1270 poke 54276,16+4: rem  wave 1 = tri+ring mod
  81. 1280 poke 54290,17: rem wave 3
  82. 1290 poke 54296,15+128: rem vol+3 off
  83. 1300 :
  84. 1310 sys ad+21,224: rem display plain screen
  85. 1400 rem numbers
  86. 1410 x=i:gosub 11000: rem 11000 = numeral conversion subroutine
  87. 1420 sys ad+24,0,0,""+i$+"     "
  88. 1430 sys ad+24,21,0,"[146][159]"+str$(x)+""
  89. 1440 sys ad+24,0,12,"                    "
  90. 1450 sys ad+24,0,12,""
  91. 1460 sp=10-(len(a$(n))/2)
  92. 1470 sys ad+24,sp,12,a$(n)
  93. 1480 :
  94. 1490 x=c:gosub 11000
  95. 1500 sys ad+24,2,23,right$("          "+i$,7)
  96. 1510 sys ad+24,24,23,"[146]"+right$("          [153]"+str$(x)+"",6)
  97. 1520 sys ad+24,21,13,"[146]                   "
  98. 1600 rem get guess
  99. 2000 sys ad+24,21,13,""
  100. 2010 wait 203,64:poke 198,0:a%=0: rem prepare for custom input
  101. 2020 input n$:poke212,0
  102. 2030 sys ad+18,232: rem save screen w/any input letters in 232
  103. 2040 if a%=3 then gosub 13000:on f% goto 40000,2000: rem quit?
  104. 2050 on a% goto 4000,5000: rem table or show answer
  105. 2100 rem check
  106. 3000 if n$=b$(n) then poke 54276,21:c=c+1:poke 54276,20:goto 6000: rem correct
  107. 3010 :
  108. 3020 sys ad+15,12,29,4,10,160,6
  109. 3030 sys ad+24,14,7,"that is not it"
  110. 3040 sys ad+15,13,28,5,9,255,14+128
  111. 3050 :
  112. 3060 sys ad+15,4,36,16,20,160,5
  113. 3070 sys ad+24,6,17,"c - continue  s - show answer"
  114. 3080 sys ad+24,5,19,"  q - quit       r - retry   "
  115. 3090 sys ad+15,5,35,17,19,255,13+128
  116. 3100 :
  117. 3200 poke212,0:sys ad+45,"cqsr":on f% goto 6000,3300,5000,4500
  118. 3210 :
  119. 3300 gosub 13000: on f% goto 40000,3200: rem quit?
  120. 3400 rem table
  121. 4000 poke53280,0:if ta then sys ad+21,216:goto 4400: rem already highlighted
  122. 4010 sys ad+21,208: rem plain table
  123. 4020 for g=1 to len(a$(n)): rem a$(n) is the current japanese word
  124. 4030 h=asc(right$(a$(n),g))-163
  125. 4040 :
  126. 4050 if h<0 or h=26 then next :rem long vowel or space
  127. 4060 if hh then 4200 :rem maru or nigori mark was present
  128. 4070 if h=24 or h=25 then hh=h:next :rem maru or nigori
  129. 4080 :
  130. 4090 a=a(h):goto 4300: rem no maru or nigori
  131. 4100 :
  132. 4200 if h>53 then if h<59 then gg=(hh=24)-(hh=25): rem"h-line
  133. 4210 a[178][181](a(h)[172].75[170]23): [143] column offset
  134. 4220 :
  135. 4300 [158] ad[170]15,a,a[170]2[171](hh[178]0),b(h)[170]gg,b(h)[170]1[170]gg,0,13[170]128
  136. 4310 gg[178]0:hh[178]0:[130]
  137. 4320 [158] ad[170]18,216:ta[178]1: [143] save highlighted table in 216:ta is a flag
  138. 4330 :
  139. 4400 [151] 198,0:[146] 198,1:[151] 53280,7
  140. 4500 [158] ad[170]21,232:[137] 2000: [143] put back previous screen
  141. 4900 [143] show word
  142. 5000 [151]212,0:[158] ad[170]21,232: [143] block out any other windows
  143. 5010 [158] ad[170]15,12,28,5,11,160,6
  144. 5020 [158] ad[170]24,14,7,"this word is:"
  145. 5030 [158] ad[170]24,14,9,b$(n)
  146. 5040 [158] ad[170]15,13,27,6,10,255,14[170]128
  147. 5050 :
  148. 5100 [158] ad[170]15,13,27,16,20,160,5
  149. 5110 [158] ad[170]24,14,17," press space "
  150. 5120 [158] ad[170]24,14,18,"             "
  151. 5130 [158] ad[170]24,14,19,"  q -- quit  "
  152. 5140 [158] ad[170]15,14,26,17,19,255,13[170]128
  153. 5150 :
  154. 5200 [158] ad[170]45," q":[139] f%[178]1 [167] 6000: [143] next word if "c"
  155. 5300 [141] 13000:[145] f% [137] 40000,6000: [143] quit?
  156. 5400 [143] next word
  157. 5410 :
  158. 6000 [130]
  159. 6010 :
  160. 6100 [143] end loop
  161. 6110 x[178]c:[141] 11000:c[178]0
  162. 6120 [158] ad[170]24,2,23,""[170][201]("          "[170]i$,7)
  163. 6130 [158] ad[170]24,24,23,"wait"[170][201]("          print"[170][196](x)[170]"",6)
  164. 6140 [158] ad[170]24,21,13,"wait                   "
  165. 6150 [158] ad[170]15,11,28,6,19,160,15
  166. 6160 [158] ad[170]72,13,25,9,17
  167. 6170 [158] ad[170]15,14,26,8,16,160,0
  168. 6180 [158] ad[170]24,16,10,"finished."
  169. 6190 [158] ad[170]24,16,12,"restart?"
  170. 6200 [158] ad[170]24,16,14,"  y/n   "
  171. 6210 [158] ad[170]15,15,25,9,15,160,10[170]128
  172. 6220 :
  173. 6300 [158] ad[170]45,"yn":[145] f% [137] 1000,40000
  174. 10000 [159]15,8,15,"s0:japanese":[160]15:[148]"japanese",8:[128]
  175. 11000 i1[178][181](x[173]100):i2[178][181]((x[171]i1[172]100)[173]10):i3[178]x[171]100[172]i1[171]10[172]i2:i$[178]""
  176. 11010 [139] i3 [167] i$[178][196](i3)
  177. 11020 [139] i2 [167] i$[178]" 0"[170]i$:[139] i2[177]1 [167] i$[178][196](i2)[170]i$
  178. 11030 [139] i1 [167] i$[178]" cos"[170]i$:[139] i1[177]1 [167] i$[178][196](i1)[170]i$
  179. 11040 [142]
  180. 11900 [143] nippon number
  181. 12000 [143] quit query
  182. 13000 [158] ad[170]18,240: [143] save screen w/o "quit?" in 240
  183. 13010 [158] ad[170]15,11,27,8,16,160,2
  184. 13020 [158] ad[170]24,13,10,"   q u i t"
  185. 13030 [158] ad[170]24,13,12,"are you sure?"
  186. 13040 [158] ad[170]24,13,14,"    y / n"
  187. 13050 [158] ad[170]15