home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 32 / 032.d81 / born.us (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  4KB  |  137 lines

  1. 5 ifx=0thenpoke56,64:clr:x=1:load"born.lnk",8,1
  2. 10 :
  3. 20 nq=35:dimq%(nq),q$(nq),a$(nq),ab$(nq),ar$(nq),aw$(nq),qs%(nq),as%(nq)
  4. 21 dim p%(29,1)
  5. 30 :
  6. 40 q=6
  7. 50 :
  8. 90 :
  9. 100 open2,8,2,"born.xy":forp=1to29:input#2,p%(p,0),p%(p,1):next:close2
  10. 101 open2,8,2,"born.questions":input#2,dd:forp=1tonq
  11. 102 input#2,q$(p),a$(p),ab$(p),ar$(p),aw$(p),qs%(p),as%(p):gosub10000:next:close2
  12. 103 sys50759,"press a key",14*8,24*8
  13. 104 :
  14. 105 gosub11000
  15. 108 poke198,0:wait198,1:getk$
  16. 109 gosub 940
  17. 110 gosub750:c=0
  18. 130 gosub940
  19. 140 forqx=1tonq:qu=q%(qx)
  20. 150 gosub940:remplotusa
  21. 160 ag=99:ifqs%(qu)<>0thengosub13000:remplotquestionshape
  22. 165 gosub740
  23. 170 ag=99
  24. 172 if ab$(qu)="cap"thensys50759,"what is the capital of",2*8,21*8
  25. 173 sys50759,q$(qu),2*8,22*8
  26. 180 gosub950:gosub910:remgetanswer
  27. 190 gosub20000:remprocessanswer
  28. 191 ifa$=""ora$=" "thensys50759,"**** be realistic... ****",8*8,24*8:goto170
  29. 192 ifxr=2thenif(len(a$)<3ora$=a$(qu)ora$=ab$(qu))then200
  30. 194 ifxr>.5thensys50759,"that's close.  try again.",8*8,24*8:goto170
  31. 200 ifa$=a$(qu)ora$=ab$(qu)thengosub15000:remshowrightanswerresponse
  32. 205 ifa$<>a$(qu)thenifa$<>ab$(qu)thengosub16000:remshowwronganswerresponse
  33. 210 ifas%(qu)<>0thengosub14000:remshowanswershape
  34. 215 gosub1082:gosub940
  35. 500 nextqx:qx=nq
  36. 600 print"[147][158]"
  37. 602 sys51459
  38. 604 print"[217]ou have correctly answered":print:printc"questions out of"qx"."
  39. 606 print"[212]hat's"int((c/qx)*100)"[157]%":print:print:print
  40. 610 goto1090
  41. 740 return
  42. 750 rem *** sound effect ***
  43. 760 return
  44. 890 rem *** sound effect ***
  45. 900 rem *** sound effect ***
  46. 910 ifa$="quit"thensys51459:print"[147][212]hank you for playing...":goto1090
  47. 920 return
  48. 930 poke249,224:poke250,204:poke251,0:poke252,64
  49. 932 poke253,p%(p,0):poke254,p%(p,1)
  50. 934 poke255,p-1:sys51462
  51. 936 return
  52. 938 :
  53. 940 h=0:v=0:p=1:gosub930:return
  54. 945 :
  55. 950 a$=""
  56. 960 xp=2:yp=23
  57. 962 getk$:ifk$<>""then970
  58. 965 ifcr$="("thencr$=")":goto967
  59. 966 cr$="("
  60. 967 sys50759,cr$,xp*8,yp*8:goto962
  61. 970 ifk$=chr$(13)then1010
  62. 975 ifk$<>"[157]"andk$<>""then980
  63. 976 ifxp>2thenxp=xp-1:sys50759,"  ",xp*8,yp*8:a$=left$(a$,len(a$)-1):goto962
  64. 980 if(k$>"z"ork$<"a")andk$<>" "andk$<>"."then962
  65. 981 ifxp=38then962
  66. 982 sys50759,k$,xp*8,yp*8:xp=xp+1
  67. 985 a$=a$+k$
  68. 990 goto962
  69. 1010 gosub1060:return
  70. 1020 iflen(a$)<2thena$="":goto1040
  71. 1030 a$=left$(a$,len(a$)-1)
  72. 1040 ht=1:printa$" "b$;:k$=""
  73. 1050 return
  74. 1060 iflen(a$)<1ora$=" "thenreturn
  75. 1070 ifright$(a$,1)=" "thena$=left$(a$,len(a$)-1):goto1060
  76. 1075 ifleft$(a$,1)=" "thena$=mid$(a$,2):goto1060
  77. 1080 return
  78. 1082 sys50759,"       press a key ( 'q' to quit )",0,24*8
  79. 1083 poke198,0:wait198,1:getk$:ifk$="q"then600
  80. 1084 return
  81. 1090 vt=21:poke53281,1:print"[144][196]o you want to try again? ([217]/[206])";
  82. 1100 poke198,0:wait198,1:getk$
  83. 1110 ifk$="y"thenrestore:print:print"[207][203][193][217].  [202]ust a second...":gosub11000
  84. 1112 ifk$="y"thensys51459:goto110
  85. 1120 ifk$<>"[206]"thenifk$<>"n"thengosub900:goto1090
  86. 1130 :
  87. 1140 print"[147]":open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
  88. 1142 ifer<>63thenend
  89. 1145 load"hello connect",8
  90. 1150 end
  91. 10000 return
  92. 10005 ifab$(p)<>"cap"thenreturn
  93. 10010 ar$(p)="you are right! the capital of "
  94. 10012 iflen(ar$(p))<40thenar$(p)=ar$(p)+" ":poke53280,rnd(1)*15:  goto10012
  95. 10014 ar$(p)=ar$(p)+q$(p)+" is "+a$(p)+"."
  96. 10020 aw$(p)="sorry! the capital of "
  97. 10022 iflen(aw$(p))<40thenaw$(p)=aw$(p)+" ":poke53280,rnd(1)*15:  goto10022
  98. 10024 aw$(p)=aw$(p)+q$(p)+" is "+a$(p)+"."
  99. 10030 q$(p)="what is the capital of this state?"
  100. 10040 ab$(p)=a$(p)
  101. 10050 return
  102. 11000 forp=1tonq:q%(p)=p:next:forp=1tonq:gosub11010:next:return
  103. 11010 qd=rnd(1)*nq+1
  104. 11020 t=q%(p):q%(p)=q%(qd):q%(qd)=t
  105. 11050 return
  106. 13000 p=qs%(qu):gosub930:return
  107. 14000 forcz=1toq:gosub940:p=as%(qu):gosub930:next:return
  108. 15000 c=c+1:gosub890
  109. 15005 remifas%(qu)=0then15015
  110. 15010 remforcz=1toq:gosub940:p=as%(qu):gosub930:next
  111. 15012 sys50759,"                                   ",2*8,21*8
  112. 15015 sys50759,"     that's absolutely right!!     ",2*8,22*8
  113. 15017 sys50759,"                                   ",2*8,23*8
  114. 15018 sys50759,"                                   ",2*8,24*8
  115. 15019 fordl=1to1000:next
  116. 15020 return
  117. 16000 p=1:gosub 930
  118. 16001 gosub900:a$="nope, that's not it!":sys50759,a$,int(20-len(a$)/2)*8,21*8
  119. 16002 if ab$(qu)<>"cap"then16007
  120. 16003 p=qs%(qu):gosub 930
  121. 16004 a$="the capital of "+q$(qu):sys50759,a$,int(20-len(a$)/2)*8,22*8
  122. 16005 a$="is "+a$(qu):sys50759,a$,int(20-len(a$)/2)*8,23*8:goto16010
  123. 16007 a$="the correct answer is -":sys50759,a$,int(20-len(a$)/2)*8,22*8
  124. 16008 sys50759,a$(qu),int(20-len(a$(qu))/2)*8,23*8
  125. 16009 fordl=1to1000:next
  126. 16010 return
  127. 20000 iflen(a$)<3thenxr=2:return:remifabbrevmustberight
  128. 20010 x0=0:xl=len(a$):iflen(a$(qu))<xlthenxl=len(a$(qu))
  129. 20012 forx1=1toxl
  130. 20020 ifmid$(a$,x1,1)=mid$(a$(qu),x1,1)thenx0=x0+1
  131. 20030 next
  132. 20040 forx1=len(a$(qu))tolen(a$(qu))-xl+1step-1
  133. 20050 ifmid$(a$,x1,1)=mid$(a$(qu),x1,1)thenx0=x0+1
  134. 20060 next
  135. 20070 xr=x0/len(a$(qu))
  136. 20080 return
  137.