Pangolins

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

Animal guessing game with only 4 creatures.

Appears on

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

Source Code

    5 REM pangolins
    7 CLS : POKE 23658,8
   10 LET nq=100: REM number of questions and animals
   15 DIM q$(nq,50): DIM a(nq,2): DIM r$(1)
   20 LET qf=8
   30 FOR n=1 TO qf/2-1
   40 READ q$(n): READ a(n,1): READ a(n,2)
   50 NEXT n
   60 FOR n=n TO qf-1
   70 READ q$(n): NEXT n
  100 REM start playing
  110 PRINT "THINK OF AN ANIMAL"';#1;"Press any key to continue"
  120 PAUSE 0
  130 LET c=1: REM start with first question
  140 IF a(c,1)=0 THEN GO TO 300
  150 LET p$=q$(c): GO SUB 910
  160 PRINT "?": GO SUB 1000
  170 LET in=1: IF r$="y" THEN GO TO 210
  180 IF r$="Y" THEN GO TO 210
  190 LET in=2: IF r$="n" THEN GO TO 210
  200 IF r$<>"N" THEN GO TO 150
  210 LET c=a(c,in): GO TO 140
  300 REM animal
  310 PRINT "ARE YOU THINKING OF"
  320 LET P$=Q$(C): GO SUB 900: PRINT "?"'
  330 GO SUB 1000
  340 IF r$="y" THEN GO TO 400
  350 IF r$="Y" THEN GO TO 400
  360 IF r$="n" THEN GO TO 500
  370 IF r$="N" THEN GO TO 500
  380 PRINT "ANSWER ME PROPERLY WHEN I'M","TALKING TO YOU.": GO TO 300
  400 REM guessed it
  410 PRINT "I THOUGHT AS MUCH.": GO TO 800
  500 REM new animal
  510 IF qf>nq-1 THEN PRINT "I'M SURE YOUR ANIMAL IS VERY","INTERESTING, BUT I DON'T HAVE","ROOM FOR IT JUST NOW.": GO TO 800
  520 LET q$(qf)=q$(c): REM move oldanimal
  530 PRINT '"WHAT IS IT THEN?": INPUT q$(qf+1)
  540 PRINT '"TELL ME A QUESTION WHICH","DISTINGUEISHES BETWEEN "
  550 LET p$=q$(qf): GO SUB 900: PRINT " AND"
  560 LET p$=q$(qf+1): GO SUB 900: PRINT ""
  570 INPUT s$: LET b=LEN s$
  580 IF s$(b)="?" THEN LET b=b-1
  590 LET q$(c)=s$( TO b): REM insert question
  600 PRINT '"WHAT IS THE ANSWER FOR"
  610 LET p$=q$(qf+1): GO SUB 900: PRINT "?"
  620 GO SUB 1000
  630 LET in=1: LET io=2: REM answers for old and new animals
  650 IF r$="Y" THEN GO TO 700
  660 LET in=2: LET io=1
  680 IF r$="N" THEN GO TO 700
  690 PRINT "THAT'S NO GOOD.": GO TO 600
  700 REM update answers
  710 LET a(c,in)=qf+1: LET a(c,io)=qf
  720 LET qf=qf+2: REM next free animal space
  730 PRINT "THAT FOOLED ME."
  800 REM again?
  810 PRINT '"Do you want another go?": GO SUB 1000
  830 IF r$="Y" THEN CLS : IF r$="Y" THEN GO TO 100
  840 STOP 
  900 REM print without trailing spaces
  905 PRINT " ";
  910 FOR n=50 TO 1 STEP -1
  920 IF p$(n)<>" " THEN GO TO 940
  930 NEXT n
  940 PRINT p$( TO n);: RETURN 
 1000 REM get reply
 1010 INPUT r$: IF r$="" THEN RETURN 
 1020 LET r$=r$(1): RETURN 
 2000 REM initial animals
 2010 DATA "DOES IT LIVE IN THE SEA",4,2
 2020 DATA "IS IT SCALY",3,5
 2030 DATA "DOES IT EAT ANTS",6,7
 2040 DATA "A WHALE","A BLANCMANGE","A PANGOLIN","AN ANT"
 3000 SAVE "pangolins" LINE 0

People

No people associated with this content.

Scroll to Top