5 KEY(10) ON:ON KEY(10) GOSUB 500:KEY(9) ON:ON KEY(9) GOSUB 600:DIM S(25):FOR I=1 TO 25:S(I)=I:NEXT I
10 CLS:LOCATE 1,34:COLOR 0,15:PRINT" IQ Builder ":COLOR 15,0
20 LOCATE 2,32:PRINT"Number Series 2":COLOR 7,0:GOSUB 59980
30 LOCATE 4,5:PRINT"There are 25 series to solve in this lesson.  You'll get three chances to"
40 PRINT"solve each one.  If you're having trouble, the computer will give you a hint."
50 FOR I=1 TO 100:SWAP S(INT(RND*25+1)),S(INT(RND*25+1)):NEXT I:XX=1:N=S(XX)
70 RESTORE
80 IF N>1 THEN FOR O=1 TO N-1:READ A,B,C,D,E,F,G,H,I,J,K,A$:NEXT O:Q=N-1
90 PRINT"Ok, here's your first series :
100 READ A,B,C,D,E,F,G,H,I,J,K,A$
110 T=T+1:Q=Q+1
120 PRINT:PRINT"Series" Q ":":PRINT"Type in the next two numbers in this series.  Put a comma between them."
130 GOSUB 3100
140 BEEP:INPUT "The next two numbers are: ",X,Y
145 Y1=CSRLIN:X1=POS(0)
150 IF (X=I)*(Y=J) THEN 300
160 Z=Z+1:IF Z=3 THEN 200
170 IF Z=2 THEN GOSUB 1000:GOTO 140
180 LOCATE 25,1:PRINT SPC(79);:PLAY "mbn50n25":LOCATE 25,1:PRINT"No!  Try again.";:TIMEOUT=3:GOSUB 59950:LOCATE 25,1:PRINT SPC(79);:LOCATE Y1-1,X1:GOTO 140
200 PLAY "n50n25":PRINT:PRINT"No!  The answer is:  " I "," J;:GOTO 350
300 IF Z=0 THEN R=R+1
310 LOCATE 25,1:PRINT SPC(79);:PLAY "mbc16c16c16ge8g":LOCATE 25,1:PRINT"Right!";:TIMEOUT=3:GOSUB 59950:LOCATE 25,1:PRINT SPC(79);:LOCATE Y1,X1
350 Z=0
360 XX=XX+1:IF XX<26 THEN 410
370 GOSUB 7000:PRINT"You did" T "number series and answered " R "right on your first try."
380 PRINT:IF R/T>=.9000001 THEN PRINT"That's terrific!"
390 IF (R/T>.75)*(R/T<.9000001) THEN PRINT"Very Good!"
400 IF R/T<.75 THEN PRINT"Maybe you should try this lesson again!"
405 PRINT:PRINT"Press ENTER to proceed to the next lesson or R to repeat this lesson."
407 GOSUB 59990:IF IKEY$="r" OR IKEY$="R" THEN RUN ELSE IF IKEY$=CHR$(13) THEN 600 ELSE 407
410 GOSUB 7000:N=S(XX)
430 RESTORE
440 IF N>1 THEN FOR O=1 TO N-1:READ A,B,C,D,E,F,G,H,I,J,K,A$:NEXT O:Q=N-1
450 GOTO 100
500 RUN "iqbuild"
600 CHAIN MERGE "num3",5
1000 PLAY "mbn50n25":LOCATE 25,1:PRINT"No!  Hint:";:TIMEOUT=3:GOSUB 59950
1010 LOCATE 25,1:PRINT SPC(79);:LOCATE 25,1:BEEP
1020 IF K=1 THEN PRINT"The numbers change by thr rule " A$;
1030 IF K=2 THEN PRINT"Look for more than one rule.  One rule is " A$;
1040 IF K=3 THEN PRINT"The amount of change gets " A$ " each time.";
1050 IF K=4 THEN PRINT"Alternating series.  One rule is " A$;
1060 IF K=5 THEN PRINT"Look for groups of " A$ " numbers.";
1070 TIMEOUT=3:GOSUB 59950:LOCATE 25,1:PRINT SPC(79);:LOCATE Y1-1,X1:RETURN
3100 PRINT:PRINT TAB(10) "?" STRING$(35,"?") "?"
3110 PRINT TAB(10) "?";:COLOR 15:PRINT A B C D E F G H;:COLOR 7:PRINT TAB(46) "?"
3120 PRINT TAB(10) "?" STRING$(35,"?") "?":PRINT:RETURN
5500 DATA 5,10,15,20,25,30,35,40,45,50,1,+5
5510 DATA 3,5,7,9,11,13,15,17,19,21,1,+2
5520 DATA 6,11,10,15,14,19,18,23,22,27,2,-1
5530 DATA 10,13,16,19,22,25,28,31,34,37,1,+3
5540 DATA 4,5,5,6,7,7,8,9,9,10,2,+0
5550 DATA 29,6,27,7,25,8,23,9,21,10,4,-2
5560 DATA 36,32,28,24,20,16,12,8,4,0,1,-4
5570 DATA 5,6,8,9,11,12,14,15,17,18,12,+2
5580 DATA 16,8,15,9,14,10,13,11,12,12,4,-1
5590 DATA 6,10,9,11,12,12,15,13,18,14,4,+3
5600 DATA 15,18,14,17,13,16,12,15,11,14,4,-1
5610 DATA 9,9,11,15,15,12,21,21,13,27,4,+6
5620 DATA 3,5,9,11,15,17,21,23,27,29,2,+2
5630 DATA 11,16,21,26,31,36,41,46,51,56,1,+5
5640 DATA 30,28,26,24,22,20,18,16,14,12,1,-2
5650 DATA 9,14,18,23,27,32,36,41,45,50,2,+4
5660 DATA 3,4,10,5,6,10,7,8,10,9,4,+0
5670 DATA 5,9,10,14,15,19,20,24,25,29,2,+4
5680 DATA 2,8,9,2,10,11,2,12,13,2,4,+1
5690 DATA 12,17,22,22,32,27,42,32,52,37,4,+5
5700 DATA 1,4,7,10,13,16,19,22,25,28,1,+3
5710 DATA 35,12,35,13,34,14,34,15,33,16,4,+1
5720 DATA 8,14,10,13,12,12,14,11,16,10,4,+2
5730 DATA 4,8,10,14,16,20,22,26,28,32,2,+4
5740 DATA 11,5,9,7,7,9,5,11,3,13,4,-2
7000 FOR Y=4 TO 24:LOCATE Y,1:PRINT SPC(79);:NEXT Y:LOCATE 4,1:RETURN
59950 TIMEOUT$=TIME$:TIME2=VAL(LEFT$(TIMEOUT$,2))*120+VAL(MID$(TIMEOUT$,4,2))*60+VAL(RIGHT$(TIMEOUT$,2))
59960 TIMEOUT$=TIME$:TIME3=VAL(LEFT$(TIMEOUT$,2))*120+VAL(MID$(TIMEOUT$,4,2))*60+VAL(RIGHT$(TIMEOUT$,2))
59970 IF TIMEOUT > TIME3 - TIME2 THEN 59960 ELSE RETURN
59980 RNDTIME$=TIME$:RNDVAL=VAL(LEFT$(RNDTIME$,2))*120+VAL(MID$(RNDTIME$,4,2))*60+VAL(RIGHT$(RNDTIME$,2)):RANDOMIZE RNDVAL:RETURN
59990 IKEY$=INKEY$:IF IKEY$="" THEN 59990 ELSE RETURN