10 REM parrot university 20 RANDOMIZE TIMER 30 DIM d(20) 40 CLS 50 INPUT "what's you're name"; y$ 60 FOR x = 1 TO 8 70 READ a$: p$(x) = a$: NEXT x 80 FOR x = 1 TO 4 90 NEXT x 100 REM teach parrots 110 CLS 120 PRINT "welcome to parrot university" 130 PRINT "professor"; y$ 140 FOR x = 1 TO 8 150 PRINT "parrot number"; x; "is a"; p$(x) 160 PRINT "what do you want to teach it to say?" 170 INPUT s$ 180 FOR z = 1 TO 8 190 IF s$ <> t$(z) THEN 220 200 PRINT "sorry,already used" 210 GOTO 150 220 NEXT z 230 p = INT(RND(1) * 3) + 1 240 IF p = 1 THEN 290 250 CLS : n = INT(RND(1) * 4) + 1 260 PRINT "parrot number"; x; "says,"; n$(n) 270 PRINT "try again, professor"; y$ 280 GOTO 150 290 CLS 300 PRINT "parrot number"; x; "says,"; s$ 310 t$(x) = s$ 320 NEXT x 330 CLS 340 FOR x = 1 TO 8 350 PRINT "the"; p$(x); "says"; t$(x) 360 q$(x) = t$(x) 370 GOSUB 890 380 IF f = 1 THEN 370 390 t(x) = r 400 GOSUB 890 410 IF f = 1 THEN 400 420 q(x) = r 430 NEXT x 440 INPUT "hit return to continue"; x$ 450 FOR x = 1 TO 16: d(x) = 1: NEXT x 460 CLS 470 PRINT : PRINT "now each parrot will teach a new parrot his phrase" 480 PRINT "can you find the matching parrots?" 490 FOR x = 1 TO 16 500 IF d(x) = 0 THEN PRINT "": GOTO 520 510 PRINT x 520 NEXT x 530 PRINT : INPUT "pick a parrot"; a$ 540 a = VAL(a$): IF a < 1 OR a > 16 THEN 530 550 IF d(a) = 0 THEN 530 560 GOSUB 960 570 c$ = b$: c = a 580 CLS 590 FOR x = 1 TO 16 600 IF x = c THEN PRINT x; ""; c$: GOTO 630 610 IF d(x) = 0 THEN PRINT "": GOTO 630 620 PRINT x 630 NEXT x 640 PRINT : INPUT "pick another parrot"; a$ 650 a = VAL(a$): IF a < 1 OR a > 16 THEN 640 660 IF d(a) = 0 THEN 640 670 GOSUB 960 680 CLS : b = a 690 FOR x = 1 TO 16 700 IF d(x) = 0 THEN PRINT "": GOTO 740 710 IF x = b THEN PRINT x; ""; b$: GOTO 740 720 IF x = c THEN PRINT x; ""; c$: GOTO 740 730 PRINT x 740 NEXT x 750 IF b$ = c$ THEN PRINT : PRINT "a match!": d(b) = 0: d(c) = 0 760 FOR x = 1 TO 16: IF d(x) <> 0 THEN 790 770 IF x = 16 THEN 820 780 NEXT x 790 FOR de = 1 TO 3000: NEXT de 800 t = t + 1 810 CLS : GOTO 490 820 CLS : PRINT "you matched the parrots" 830 PRINT "in"; t; "turns" 840 END 850 DATA horned parrot,african grey parrot,blue crowned hanging parrot 860 DATA yellow winged amazon,orange bellied brown headed parrot 870 DATA macaw,cockatoo 880 DATA swquack!,frack!,creech!,skreet! 890 r = INT(RND(1) * 16) + 1 900 f = 0 910 FOR z = 1 TO 8 920 IF r = q(z) THEN f = 1 930 IF r = t(z) THEN f = 1 940 NEXT z 950 RETURN 960 FOR x = 1 TO 8 970 IF t(x) = a THEN b$ = t$(x) 980 IF q(x) = a THEN b$ = q$(x) 990 NEXT x 1000 RETURN END