home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / games / trivia.zip / TRIVIA.ASC
Text File  |  1985-12-17  |  14KB  |  266 lines

  1. 10 '*********************************************************************
  2. 11 '*  NOTICE:  Although I have sent this program as a unit, before it  *
  3. 12 '*  can work you are going to have to do some modifying.  The reason *
  4. 13 '*  for this is, the game takes up so much memory with screen mode 5 *
  5. 14 '*  that there is not enough room for the whole program to reside in *
  6. 15 '*  a standard 128K machine and do its work.  Because of this, I     *
  7. 16 '*  have divided it into 4 (count 'em, four) separate programs which *
  8. 17 '*  MUST be saved separately on disk before you can use the program  *
  9. 18 '*  at all.  The first program (TRIVIA.BAS) is composed of all lines *
  10. 19 '*  between 100 and 460.  The second one begins listing at line 1000 *
  11. 20 '*  and continues through 1950.  The third one begins at line 5000   *
  12. 21 '*  and goes through 5290.  The last starts at line 9000.            *
  13. 22 '*  game, you will have to do the following:                         *
  14. 23 '*        (1)  DELETE lines 10-99 and SAVE "TRIV.BAS"                *
  15. 24 '*        (2)  DELETE lines 1000- and SAVE "TRIVIA.BAS"              *
  16. 25 '*        (3)  LOAD "TRIV.BAS", DELETE -460, DELETE 5000-, and       *
  17. 26 '*             SAVE "TRIVIAG.BAS"                                    *
  18. 27 '*        (4)  LOAD "TRIV.BAS", DELETE -5290, and SAVE "SCRN.BAS"    *
  19. 28 '*        (5)  LOAD "TRIV.BAS", DELETE -1950, DELETE 9000-, and      *
  20. 29 '*             SAVE "TRIVIAG.BAS"                                    *
  21. 30 '*  I would strongly recommend saving at least one version with all  *
  22. 31 '*  the comments, if only because they can tell you who to go to if  *
  23. 32 '*  you are having problems.                                         *
  24. 33 '*  One other thing:  Be sure to RUN "SCRN.BAS" before you run the   *
  25. 34 '*  actual trivia game itself.  In order to conserve memory space as *
  26. 35 '*  well as actual run time, this program draws its basic screen and *
  27. 36 '*  saves it as a separate file called "SCREEN.BAS"  (if you try to  *
  28. 37 '*  RUN "SCREEN.BAS" you'll get a "buffer overflow" message.)        *
  29. 38 '*  Concerning questions which the game asks, you can do one of two  *
  30. 39 '*  things:  The EDIT.BAS program is there to let you type your own  *
  31. 40 '*  questions in.  I didn't send MY question file because I just     *
  32. 41 '*  didn't care to spend all that time on the phone long distance.   *
  33. 42 '*  If you use this program, note that it asks for questions from    *
  34. 43 '*  six different categories (just like a popular game) and you have *
  35. 44 '*  to give it all six questions first, then the answers.  There are *
  36. 45 '*  several good reasons for that, not the least of which is, it     *
  37. 46 '*  helps curb the advantage that the one doing the typing would     *
  38. 47 '*  have after typing all the questions in.  This way, there is a    *
  39. 48 '*  long enough period of time between when you type in the question *
  40. 49 '*  and when you type in the answer that you won't be as likely to   *
  41. 50 '*  associate them with each other.                                  *
  42. 51 '*  Another reason for this is that if you have question cards from  *
  43. 52 '*  any of the various "TRIVIA" games and want to type them in, this *
  44. 53 '*  method allows you to avoid a lot of page flipping as you go back *
  45. 54 '*  and forth between front and back sides of the card.              *
  46. 55 '*  Now if you are lazy, and just don't wanna type in those          *
  47. 56 '*  questions yourself, you can avoid all that work with a phone     *
  48. 57 '*  call to me, and I'll be glad to MODEM you off a copy of MY       *
  49. 58 '*  question file.  (It has over 1000 questions already in it, and   *
  50. 59 '*  it's getting bigger each time I have a little time to spare.)    *
  51. 60 '*  About limitations:  This program is not very limited at all.     *
  52. 61 '*  you can have as many questions as you like, provided you have    *
  53. 62 '*  the disk space for it.  Of course, you can always have several   *
  54. 63 '*  QUESTION disks, as many as you like, so long as each has a copy  *
  55. 64 '*  of "SCREEN.BAS" on it.                                           *
  56. 65 '*  HOW IT WORKS:  Once you have "SCREEN.BAS" on disk, and a         *
  57. 66 '*  QUESTION file, RUN "TRIVIA.BAS".  You will see the icons used by *
  58. 67 '*  the game being drawn and saved in the upper left corner of the   *
  59. 68 '*  screen.  After that, you will be prompted for the number of      *
  60. 69 '*  players and their first names.  Then the game will begin.  It's  *
  61. 70 '*  played a lot like "THE JOKER'S WILD"  if you ever saw that game  *
  62. 71 '*  on TV.  The categories spin around in what looks remotely like   *
  63. 72 '*  a Vegas slot machine (I've never been to Vegas, so don't blame   *
  64. 73 '*  me if it doesn't look right).  When they settle down, you are    *
  65. 74 '*  given a chance to pick which of the three (or less) categories   *
  66. 75 '*  you have to choose from.  If your spin results in a match, the   *
  67. 76 '*  number of points you can get for a correct answer doubles.  It   *
  68. 77 '*  triples for a three way match.  The categories you can choose    *
  69. 78 '*  will be displayed with a tiny arrow pointing to one of them.     *
  70. 79 '*  use your joystick to maneuver the arrow until it is pointing at  *
  71. 80 '*  the category you desire, then press the button.  Your question   *
  72. 81 '*  will be displayed, and a timer will be displayed at the bottom   *
  73. 82 '*  of the screen.  When the timer runs out, the answer will be      *
  74. 83 '*  displayed.  If you answer before it runs out, you can press the  *
  75. 84 '*  button to stop it, press it again to display the answer, and     *
  76. 85 '*  after the answer disappears, you have a chance to tell the com-  *
  77. 86 '*  puter how you did.  If you answered correctly, move the stick to *
  78. 87 '*  the top and press the button.  If not, move the stick to the     *
  79. 88 '*  bottom and press the button.  The scores will be updated, and    *
  80. 89 '*  the next player's turn will begin.  This continues until the     *
  81. 90 '*  "sand" in the hour-glass runs out, signalling the end of the     *
  82. 91 '*  round.  There are three rounds in a game, and at the end a winner*
  83. 92 '*  will be declared.                                                *
  84. 93 '*  If you have any problems running this game, I'll be glad to      *
  85. 94 '*  either solve it for you, or give you a reason why.  You can      *
  86. 95 '*  contact me by writing:  George A. McConnel / Box 272 / Calhoun,  *
  87. 96 '*  KY  42327 or call (502-273-5114) (office phone).                 *
  88. 97 '*  I hereby authorize unlimited free distribution of this software  *
  89. 98 '*  so that mankind can greatly profit from my efforts.  GAM.        *
  90. 99 '*********************************************************************
  91. 100 CLEAR ,,,32765:SCREEN 5:KEY OFF:CLS
  92. 110 GOSUB 370:GOSUB 440
  93. 120 DIM GEO(52),ENT(52),SCI(52),HIS(52),SPO(52),REL(52)
  94. 130 CLS:CIRCLE(7,7),7,1:PAINT(7,7),1,1
  95. 140 DRAW "bm2,2c10r2ne1d2nf1l2d2f2d1g2h1u4e2l2u1r3l2d7e1u2bm12,2g1r1d1bm12,6r1f1d1g1d1g1h1u1nh1u2e1d3d1u4r1d2c9bm6,14r3bm6,0r3"
  96. 150 GET (0,0)-(15,15),GEO
  97. 160 CLS:COLOR 14:PRINT CHR$(14);:COLOR 12:PRINT CHR$(1):COLOR 9:PRINT CHR$(2);:COLOR 10:PRINT CHR$(4)
  98. 170 GET (0,0)-(15,15),ENT
  99. 180 CLS:COLOR 15:PRINT CHR$(244);:COLOR 4:PRINT CHR$(236):COLOR 15:PRINT CHR$(245);:COLOR 14:PRINT CHR$(15)
  100. 190 GET (0,0)-(15,15),SCI
  101. 200 CLS:DRAW "c10bm0,4m7,0r1m15,4m0,4r2nu1r2u2f1g1r4u2f1nl2g1r2nu1r3d8nr2nl13l3nu8l3nu8l3nu8l3nu8l1d2r15u2d3l15u1
  102. 210 GET (0,0)-(15,15),HIS
  103. 220 CLS:DRAW "bm0,6c6u1f1r1c15h2u1c6f3r1h4r1f3r1h4r1f3r1h4r1f3u1c15h2r1c6f1u1
  104. 230 CIRCLE (12,4),3,15:PAINT (12,4),15,15:DRAW "bm10,1c8f1d4g1bm14,1g1d4f1bm0,15c12e3h1u1e2r1f2d1g2l1u1c1u1r2u1l1u1l1d1l1d1r1bm11,12c14e1f1g1u1
  105. 240 GET (0,0)-(15,15),SPO
  106. 250 CLS:DRAW "bm7,0c14d2l1d2r2u1l1u1c12d1bm6,6c9r2d5l2u4r1d3bm2,12c7r10g1l8r3d1r2bm1,0c15f2bm13,0g2bm1,7e2bm11,5f2
  107. 260 GET (0,0)-(15,15),REL
  108. 270 CLS
  109. 280 ROUND=1:TURN=1
  110. 290 VOL=8
  111. 300 INPUT "How many players";N
  112. 310 DIM NAM$(N):FOR I=1 TO N
  113. 320 PRINT"Name of player ";I;:INPUT NAM$(I)
  114. 330 NEXT
  115. 340 LOCATE 15,1
  116. 350 CHAIN "triviag",,ALL,DELETE 120-350
  117. 360 COLOR 15
  118. 370 FOR I=1 TO 6:READ CAT$(I):NEXT
  119. 380 DATA Geography,Sci & Nat,Ent'ment,Art & Lit,Spo & Leis,History
  120. 390 OPEN "questions" FOR INPUT AS #1
  121. 400 FOR I=1 TO 6:READ ID$(I):NEXT
  122. 410 DATA G,SN,E,AL,SL,H
  123. 420 PTS=50
  124. 430 RETURN
  125. 440 FOR I=1 TO 3:READ X(I),Y(I):NEXT
  126. 450 DATA 19,25,44,25,69,25
  127. 460 RETURN
  128. 1000 BLOAD "screen
  129. 1010 TIMER ON:ON TIMER(10) GOSUB 1390
  130. 1020 RN$=MID$(STR$(ROUND),2,1)
  131. 1030 LOCATE 8,4:PRINT"Round ";RN$
  132. 1040 SAND=8:TIME=52
  133. 1050 FOR I=1 TO 5:LINE(114+I,2+I)-(239-I,(N+3)*8+5-I),I+8,B:NEXT
  134. 1060 LOCATE 2,18:PRINT"Scoreboard:"
  135. 1070 FOR I=1 TO N:LOCATE 3+I,16:PRINT NAM$(I):LOCATE 3+I,23:PRINT USING "######,"; SCORE(I):NEXT
  136. 1080 GOSUB 1110:GOSUB 1830:GOSUB 1600
  137. 1090 TURN=TURN+1:IF TURN>N THEN TURN=1
  138. 1100 GOTO 1070
  139. 1110 FOR I=1 TO 3:W(I)=INT(RND*6)+1:NEXT:NOTE=3000
  140. 1120 GOSUB 1530
  141. 1130 LOCATE 11,1:PRINT SPACE$(15):LOCATE 11,1:PRINT NAM$(TURN);"'s turn"
  142. 1140 FOR I=1 TO 3:FOR K=1 TO 5
  143. 1150 FOR J=I TO 3:W(J)=W(J)+1:IF W(J)>6 THEN W(J)=1
  144. 1160 WN=J:GOSUB 1270
  145. 1170 SOUND NOTE,.003,VOL:NOTE=NOTE-50
  146. 1180 NEXT J,K:GOSUB 1280:NEXT:RETURN
  147. 1190 ON FIG GOSUB 1210,1220,1230,1240,1250,1260
  148. 1200 RETURN
  149. 1210 PUT (X,Y),GEO,PSET:RETURN
  150. 1220 PUT (X,Y),SCI,PSET:RETURN
  151. 1230 PUT (X,Y),ENT,PSET:RETURN
  152. 1240 PUT (X,Y),REL,PSET:RETURN
  153. 1250 PUT (X,Y),SPO,PSET:RETURN
  154. 1260 PUT (X,Y),HIS,PSET:RETURN
  155. 1270 X=X(WN):Y=Y(WN):FIG=W(WN):GOSUB 1190:RETURN
  156. 1280 R1=INT(RND*13)+1:R2=INT(RND*13)+1:R3=INT(RND*13)+1
  157. 1290 PAINT(27,16),R1,14:PAINT(52,16),R2,14:PAINT(77,16),R3,14
  158. 1300 RETURN
  159. 1310 FLG=0:LINE(0,191)-(319,199),11,BF
  160. 1320 X=319
  161. 1330 FOR I=1 TO ROUND*4:LINE(X,199)-(X,191),0
  162. 1340 X=X-1
  163. 1350 IF STRIG(0) THEN FLG=1:FOR I=1 TO 3:SOUND 3000,.001,VOL:GOSUB 1280:NEXT:GOTO 1380
  164. 1360 IF X>-1 THEN NEXT
  165. 1370 GOSUB 1280:IF X>-1 THEN 1330
  166. 1380 RETURN
  167. 1390 LINE(285-TIME/2,SAND)-(285+TIME/2,SAND),0
  168. 1400 LINE(285,63)-(285,133-SAND),14:LINE(285,63)-(285,133-SAND),0
  169. 1410 LINE(285-TIME/2,133-SAND)-(285+TIME/2,133-SAND)
  170. 1420 SAND=SAND+1:TIME=TIME-.440678*2
  171. 1430 IF TIME<1 THEN 1460
  172. 1440 ON TIMER(10)GOSUB 1390
  173. 1450 RETURN
  174. 1460 TIMER OFF:CLS
  175. 1470 PRINT"Well, that ends round"ROUND;"."
  176. 1480 PRINT"The scores stand at:":FOR I=1 TO N:PRINT NAM$(I),SCORE(I):NEXT
  177. 1490 IF ROUND =3 THEN HI=0:FOR I=1 TO N:IF SCORE(I)>HI THEN HI=SCORE:WIN=I:NEXT ELSE NEXT:PRINT:PRINT NAM$(WIN);"Wins the Game!":END
  178. 1500 PRINT"Press button to begin round"ROUND;"..."
  179. 1510 IF NOT STRIG(1) THEN 1510
  180. 1520 ROUND=ROUND+1:PTS=PTS*2:GOTO 1000
  181. 1530 GOSUB 1810
  182. 1540 LOCATE 13,10:PRINT"Categories:"
  183. 1550 RESTORE 1580:FOR FIG=1 TO 6:READ X,Y:GOSUB 1190:NEXT
  184. 1560 FOR I=1 TO 6:READ Y,X:LOCATE Y,X:PRINT CAT$(I):NEXT
  185. 1570 RETURN
  186. 1580 DATA 0,112,0,136,0,160,112,112,112,136,112,160
  187. 1590 DATA 15,4,18,4,21,4,15,18,18,18,21,18
  188. 1600 IF EOF(1) THEN CLOSE 1:OPEN "Questions" FOR INPUT AS #1
  189. 1610 INPUT #1,ID$,Q$,A$
  190. 1620 IF ID$<>ID$(CH) THEN 1600
  191. 1630 GOSUB 1810:LOCATE 16,1:PRINT"QUESTION:"
  192. 1640 SWAP M$,Q$:GOSUB 1750:PRINT"?"
  193. 1650 GOSUB 1310
  194. 1660 IF FLG THEN IF NOT STRIG(0) THEN 1660
  195. 1670 LOCATE 16,1:PRINT"ANSWER:  "
  196. 1680 SWAP M$,A$:GOSUB 1750:PRINT"."
  197. 1690 FOR I=1 TO 10:GOSUB 1280:NEXT:GOSUB 1820
  198. 1700 IF FLG=0 THEN RETURN
  199. 1710 GOSUB 1820:GOSUB 1810:LOCATE 14,1:PRINT"Push stick up for a":PRINT"correct answer.  Push stick":PRINT"down if you were wrong.":PRINT"Press button when ready..."
  200. 1720 IF NOT STRIG(0) THEN 1720
  201. 1730 CH=STICK(0):CH=INT(STICK(1)/60):IF CH=0 THEN SCORE(TURN)=SCORE(TURN)+POINTS
  202. 1740 RETURN
  203. 1750 GOSUB 1820
  204. 1760 LOCATE 19,1
  205. 1770 X=40:IF X>=LEN(M$) THEN 1800
  206. 1780 IF MID$(M$,X,1)<>" " THEN X=X-1:GOTO 1780
  207. 1790 PRINT LEFT$(M$,X):M$=RIGHT$(M$,LEN(M$)-X):GOTO 1770
  208. 1800 PRINT M$;:RETURN
  209. 1810 VIEW (0,95)-(224,199):CLS:VIEW:RETURN
  210. 1820 VIEW (0,144)-(319,199):CLS:VIEW:RETURN
  211. 1830 FOR I=1 TO 3:V(I)=PTS:NEXT
  212. 1840 FOR I=1 TO 3:FOR J=1 TO 3:IF J=I THEN 1860
  213. 1850 IF W(I)=W(J) THEN V(I)=V(I)+PTS
  214. 1860 NEXT J,I:GOSUB 1810
  215. 1870 RESTORE 1580:FOR I=1 TO 3:FIG=W(I):READ X,Y:GOSUB 1190:NEXT
  216. 1880 RESTORE 1590:FOR I=1 TO 3:READ Y,X:LOCATE Y,X:PRINT CAT$(W(I)),V(I):NEXT
  217. 1890 OCH=1
  218. 1900 CH=STICK(0):CH=INT(STICK(1)/45)+1
  219. 1910 IF CH>3 THEN 1900
  220. 1920 IF OCH<>CH THEN LOCATE 12+OCH*3,22:PRINT" ":LOCATE 12+CH*3,22:PRINT CHR$(27):OCH=CH
  221. 1930 IF NOT STRIG(1) THEN 1900
  222. 1940 POINTS=V(CH)
  223. 1950 CH=W(CH):RETURN
  224. 5000 KEY OFF:SCREEN 0:WIDTH 80:VIEW PRINT 1 TO 24:CLS
  225. 5010 GOSUB 5300
  226. 5020 PRINT"Trivia Question Editor":VIEW PRINT 2 TO 24
  227. 5090 OPEN "question" FOR APPEND AS #1
  228. 5100 CLS:PRINT"Type 'end' to quit":VIEW PRINT 3 TO 24
  229. 5110 FOR CAT=1 TO 6
  230. 5120 CLS:PRINT"Question Identification Code: ";ID$(CAT)
  231. 5130 INPUT "What is the question?";Q$(CAT)
  232. 5140 IF Q$(CAT)="end" THEN CLOSE:GOTO 5200
  233. 5150 NEXT:FOR CAT=1 TO 6:CLS:PRINT ID$(CAT):PRINT Q$(CAT)
  234. 5160 INPUT "And the answer is?";A$(CAT)
  235. 5170 NEXT
  236. 5180 FOR I=1 TO 6:PRINT#1,ID$(I):PRINT#1,Q$(I):PRINT#1,A$(I):NEXT
  237. 5190 GOTO 5110
  238. 5200 INPUT "Want to look over your file?";Y$
  239. 5210 IF INSTR("Yy",Y$) THEN 5230
  240. 5220 END
  241. 5230 OPEN FIL$ FOR INPUT AS #1
  242. 5240 IF EOF(1) THEN 5270
  243. 5250 INPUT#1, ID$,Q$,A$:PRINT ID$:PRINT:PRINT Q$:PRINT:PRINT A$:PRINT:PRINT
  244. 5260 GOTO 5240
  245. 5270 PRINT"That's all, folks!"
  246. 5280 CLOSE
  247. 5290 END
  248. 5300 DATA G,E,H,AL,SN,SL
  249. 5310 FOR I=1 TO 6:READ ID$(I):NEXT:RETURN
  250. 9000 CLEAR ,,,32768!:SCREEN 5
  251. 9010 CLS:KEY OFF
  252. 9020 COLOR 14
  253. 9030 DRAW "bm11,10c14d69r83u69h3l77g3"
  254. 9040 FOR I=27 TO 77 STEP 25:CIRCLE (I,16),4:NEXT
  255. 9050 FOR I=18 TO 68 STEP 25:LINE (I,24)-(I+18,42),,B:NEXT
  256. 9060 LINE (21,52)-(82,66),,B
  257. 9070 PAINT (21,50),2,14
  258. 9080 COLOR 6
  259. 9090 DRAW "bm251,0c6r68d2g1d2g1d120f1d2f1d2l68u2e1u2e1u120h1u2h1u2
  260. 9100 LINE (258,7)-(313,125),,B
  261. 9110 PAINT (253,3),6,6
  262. 9120 COLOR 7
  263. 9130 LINE (258,7)-(284,66):LINE -(258,125):LINE -(313,125):LINE -(286,66):LINE -(313,7):LINE -(258,7)
  264. 9140 PSET (285,66)
  265. 9150 PAINT (285,40),14,7
  266.