home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1985 Winter / rerun-1985-winter.d64 / ultraquiz (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  4KB  |  158 lines

  1. 5 bo=53280:ba=53281
  2. 10 dimaa$(101),bb$(101),c$(101):goto37
  3. 20 fori=1to80:print" [146]";:next:return
  4. 30 poke781,r:poke782,c:poke783,peek(783)and254:sys65520:return
  5. 35 rem ***** main menu *****
  6. 37 pokebo,12:pokeba,12:print"[147][144]"
  7. 40 print"[144]":gosub20:print"       1-exit    2-load    3-save       ";
  8. 45 gosub20:print"    4-edit  5-clear  6-print  7-quiz    ";:gosub20
  9. 50 geta$:ifa$=""then50
  10. 55 a=asc(a$)-48:ifa<1ora>7then50
  11. 60 onagoto65,380,330,119,440,458,625
  12. 65 r=10:c=5:gosub30:print"     are you sure ? (y/n)"
  13. 70 geta$:ifa$=""then70
  14. 75 ifa$="y"thenprint"[147]":end
  15. 80 goto37
  16. 118 rem ### edit menu ###
  17. 119 pokebo,1:pokeba,1:print"[147]":gosub20
  18. 120 print"   1-exit  2-enter  3-list  4-modify    ";:gosub20
  19. 130 geta$:ifa$=""then130
  20. 140 a=asc(a$)-48:ifa<1ora>4then130
  21. 150 onagoto37,155,230,1000
  22. 151 rem #### input q+a ####
  23. 155 z=x:pokebo,1:pokeba,1
  24. 160 print"[147]":gosub20:print"  1-exit  2-enter question and answer   ";:gosub20
  25. 170 r=9:c=0:gosub30
  26. 171 geta$:ifa$=""then171
  27. 172 ifa$="1"then119
  28. 173 ifa$="2"then175
  29. 174 goto171
  30. 175 z=z+1:x=x+1:ifx>101thenx=101:z=101:goto200
  31. 180 poke19,64:print"question #"z:inputaa$(z):poke19,0
  32. 185 ifaa$(z)=""thenz=z-1:x=x-1:goto160
  33. 190 poke19,64:print:print"answer #"z:inputbb$(z):poke19,0
  34. 195 ifbb$(z)=""thenz=z-1:x=x-1:goto160
  35. 199 goto160
  36. 200 print"buffer full":fori=1to1500:next:goto119
  37. 210 goto160
  38. 215 rem ### list ###
  39. 230 pokebo,1:pokeba,1:print"[147][144]":r=24:c=0:gosub30
  40. 240 forz=1tox
  41. 245 printz;aa$(z):wait653,1,1
  42. 250 printz;bb$(z):wait653,1,1
  43. 252 fori=1to150:nexti:nextz
  44. 260 print"          hit return to exit           ";
  45. 270 ifpeek(197)=1thenpoke198,0:goto119
  46. 275 goto270
  47. 328 rem ##### save #####
  48. 330 print"[147][151]"
  49. 335 gosub20:print"      1-exit     2-tape     3-disk      ";:gosub20
  50. 337 print"                  save                  [146]";
  51. 340 geta$:ifa$=""then340
  52. 342 ifa$="1"thengoto37
  53. 345 r=10:c=0:gosub30:poke19,64:input"file name ";n$:print:poke19,0
  54. 350 ifa$="2"thenopen2,1,1,n$:goto360
  55. 355 open2,8,2,"@0:q"+n$+",s,w"
  56. 360 fori=1tox
  57. 365 print#2,aa$(i)
  58. 370 print#2,bb$(i)
  59. 375 next:print#2,"qq":close2:print"[147]":goto40
  60. 377 rem ##### load #####
  61. 380 print"[147]"
  62. 385 gosub20:print"      1-exit     2-tape     3-disk      ";:gosub20
  63. 387 print"                  load                  [146]";
  64. 390 geta$:ifa$=""then390
  65. 392 ifa$="1"thengoto37
  66. 395 r=10:c=0:gosub30:poke19,64:input"file name ";n$:poke19,0:ifx<>0thenx=x+1
  67. 397 ifx=0thenx=1
  68. 398 i=x
  69. 400 ifa$="2"thenopen2,1,0,n$:goto415
  70. 405 open2,8,2,"0:q"+n$+",s,r"
  71. 415 input#2,a$
  72. 417 ifa$="qq"thenclose2:x=x-1:print"[147]":goto40
  73. 418 aa$(i)=a$
  74. 420 input#2,b$
  75. 422 ifb$="qq"thenclose2:x=x-1:print"[147]":goto40
  76. 423 bb$(i)=b$
  77. 425 i=i+1:x=i:ifx>101thenx=101:close2:print"[147]":goto40
  78. 430 goto415
  79. 435 rem ###### clear ######
  80. 440 r=10:c=0:gosub30:print"are you sure you want to clear? (y/n)"
  81. 445 geta$:ifa$=""then445
  82. 450 ifa$="n"then37
  83. 455 clr:goto10
  84. 456 rem ###### print ######
  85. 458 pokebo,3:pokeba,3:print"[147][144]"
  86. 460 gosub20:print"    1-exit   2-questions and answers    ";
  87. 465 print"                                        ";
  88. 470 print"   3-questions only    4-answers only   ";:gosub20
  89. 475 geta$:ifa$=""then475
  90. 480 ifa$="1"then35
  91. 485 r=10:c=0:gosub30:poke19,64:print"how many copys? ";:inputb:open4,4
  92. 490 ifa$="3"thenfort=1tob:goto560
  93. 495 ifa$="4"thenfort=1tob:goto590
  94. 500 ifa$="2"thenfort=1tob:goto520
  95. 510 goto475
  96. 520 l=2:fori=1tox
  97. 530 print#4,"q. ";aa$(i)
  98. 535 print#4
  99. 540 print#4,"a. ";bb$(i)
  100. 545 print#4:l=l+4
  101. 547 ifl>64thenforr=1to3:print#4:nextr:l=2
  102. 550 nexti:forr=lto67:print#4:nextr:l=2:nextt:close4:goto458
  103. 560 l=2:fori=1tox
  104. 570 print#4,i". ";aa$(i)
  105. 575 print#4:print#4:l=l+3
  106. 577 ifl>64thenforr=1to3:print#4:nextr:l=2
  107. 580 nexti:forr=lto67:print#4:nextr:l=2:nextt:close4:goto458
  108. 590 l=2:fori=1tox
  109. 600 print#4,i". ";bb$(i)
  110. 605 print#4:l=l+2
  111. 607 ifl>64thenforr=1to3:print#4:nextr:l=2
  112. 610 nexti:forr=lto67:print#4:nextr:l=2:nextt:close4:goto458
  113. 620 rem ##### quiz #####
  114. 625 fort=1tox:c$(t)="1":next:z=1:l=0:w=0
  115. 630 poke53280,1:poke53281,1:print"[147]"
  116. 640 gosub20:print"              ultraquiz 64              ";:gosub20
  117. 650 r=10:c=0:gosub30:ifz>xthen730
  118. 660 k=int(rnd(1)*x)+1
  119. 670 ifc$(k)=""then660
  120. 680 c$(k)="":r=10:c=0:gosub30
  121. 690 printz;aa$(k):z=z+1
  122. 700 print:poke19,64:inputa$:poke19,0
  123. 710 ifa$=bb$(k)thenprint:print"correct":l=l+1:fori=1to500:next:goto630
  124. 720 print:print"wrong answer, the correct answer is ":printbb$(k):w=w+1
  125. 722 print" hit any key to continue"
  126. 723 getl$:ifl$=""then723
  127. 724 goto630
  128. 730 print"you got"l"right and"w"wrong."
  129. 735 s=l/(l+w)*100
  130. 740 print:print"your score is"s
  131. 750 print:print"try again (y/n)?"
  132. 760 geta$:ifa$=""then760
  133. 770 ifa$="y"then625
  134. 780 goto37
  135. 999 rem **** modify ****
  136. 1000 print:printtab(13)"1":poke19,64
  137. 1010 print"[145][145]":input"modify from  ";z:poke19,0:print"":goto1035
  138. 1015 print""
  139. 1020 print"[147]":gosub20:print"    1-exit  2-modify text  3-skip       ";:gosub20
  140. 1030 r=9:c=0:gosub30:return
  141. 1035 ifz>xthen119
  142. 1040 gosub1015:print"[144]question #"z:printaa$(z)
  143. 1050 geta$:ifa$=""then1050
  144. 1060 ifa$="1"then119
  145. 1070 ifa$="2"then1100
  146. 1080 ifa$="3"then1120
  147. 1090 goto1050
  148. 1100 poke19,64:r=9:c=19:gosub30:print" enter new question ":inputa$:poke19,0
  149. 1110 aa$(z)=a$
  150. 1120 gosub1015:print"[144]answer #"z:printbb$(z)
  151. 1130 geta$:ifa$=""then1130
  152. 1140 ifa$="1"then119
  153. 1150 ifa$="2"then1200
  154. 1160 ifa$="3"thenz=z+1:goto1035
  155. 1170 goto1130
  156. 1200 poke19,64:r=9:c=19:gosub30:print"  enter new answer  ":inputa$:poke19,0
  157. 1210 bb$(z)=a$:z=z+1:goto1035
  158.