Q and A

Date: 198x
Type: Program
Platform(s): TS 2068

Allows the user to generate question and answer cards.

Appears on

Library tape of the Indiana Sinclair Timex User’s Group.

Source Code

   10 REM  INITIALIZATION 
   20 REM     RUN 430
   30 LET s=0: LET x=m: LET b$="---------------"
   40 FOR n=1 TO m: LET y(n)=n: NEXT n
   50 GO SUB 340: CLS : FOR n=1 TO m: PRINT AT 10,8;a$(n): PAUSE 50: CLS : NEXT n
   60 REM  MAIN PROGRAM 
   70 LET z=INT (RND*x+1): LET q=y(z)
   80 LET x=x-1
   90 FOR n=z TO x: LET y(n)=y(n+1): NEXT n
  100 CLS : LET t=2
  110 PRINT ''''c$(q): INPUT i$
  120 IF i$<>a$(q)( TO l(q)) THEN GO TO 230
  130 LET s=s+t: GO TO 200
  140 GO SUB 350: CLS 
  150 IF x>0 THEN GO TO 70
  160 REM  FINAL SCORE 
  170 PRINT AT 5,0;"Your score was ";s;" out of ";m*2
  180 STOP 
  190 REM  PRAISE 
  200 PRINT AT 7,0;"Well done, ";i$;" was right.";AT 9,15,,
  210 GO TO 140
  220 REM  WRONG ANSWER 
  230 IF i$="" THEN GO TO 260
  240 PRINT AT 7,0;i$;" was wrong.",,AT 9,0,,
  250 GO SUB 350
  260 IF t=2 THEN GO TO 300
  270 PRINT AT 7,0;"The right answer was:",,AT 9,15;a$(q)
  280 GO TO 140
  290 REM  HINT/SECOND TRY 
  300 LET t=1
  310 PRINT AT 7,0;"Here is a hint:",,AT 21,0,,
  320 PRINT AT 9,15;a$(q,1)+b$(1 TO l(q)-2)+a$(q,l(q))
  330 GO TO 110
  340 REM  ENTER TO CONTINUE 
  350 PRINT AT 21,0;"Press ENTER to continue."
  360 GO SUB 400
  370 IF CODE k$=13 THEN RETURN 
  380 GO TO 360
  390 REM  SINGLE KEY INPUT  
  400 IF INKEY$<>"" THEN GO TO 400
  410 IF INKEY$="" THEN GO TO 410
  420 LET k$=INKEY$: RETURN 
  430 REM ENTER QUESTIONS/ANSWERS
  440 CLS : PRINT "How many questions?": INPUT m
  450 DIM c$(m,64): DIM a$(m,15): DIM l(m): DIM y(m)
  460 FOR q=1 TO m
  470 CLS : PRINT "Question ";q''
  480 PRINT "Type in the question or clue.": INPUT c$(q)
  490 PRINT 'c$(q)''"Type in the answer.": INPUT i$
  500 PRINT 'i$;AT 20,0;"If satisfactory, type s.","  To delete, type d."
  510 GO SUB 400
  520 IF k$="d" THEN GO TO 470
  530 IF k$<>"s" THEN GO TO 510
  540 LET l(q)=LEN i$: LET a$(q)=i$
  550 NEXT q
  560 REM SAVE AND RUN 
  570 CLS : INPUT "What is the program name?";p$
  580 SAVE p$ LINE 20
  590 SAVE "QUEST&ANSW" LINE 430

People

No people associated with this content.

Scroll to Top