Count

Developer(s): Thomas B. Woods
Date: 1982
Type: Program
Platform(s): ZX81, TS 1000
Tags: Education

RUN draws from one to ten copies of one of five shapes made of graphic characters and asks HOW MANY?. A right answer flashes **** RIGHT **** and a new set appears; a wrong one prints *WRONG* and asks again. It fits in 1K.

Line 35 checks only the first character of the answer, so any answer that starts with a digit is accepted for checking.

Published in Syntax August 1982 (Teach Kids to Count with the ZX81).

Image Gallery

Source Code

   1 LET A=INT (RND*10)+1
   5 GOTO 100*(INT (RND*5)+1)
   7 FOR X=0 TO A-1
  10 PRINT AT 9,X*3+1;A$
  15 PRINT AT 10,X*3+1;B$
  20 NEXT X
  25 PRINT AT 0,0;"HOW MANY?"
  30 INPUT D$
  35 IF CODE D$>37 OR CODE D$<28 THEN GOTO 45
  40 IF VAL D$=A THEN GOTO 55
  45 PRINT D$;"*WRONG*"
  50 GOTO 30
  55 PRINT AT 20,6;"**** RIGHT ****"
  60 PAUSE 100
  65 CLS
  70 GOTO 1
 100 LET A$="▚▞"
 105 LET B$="▞▚"
 110 GOTO 7
 200 LET A$="▐▓▌"
 205 LET B$="▐▓▌"
 210 GOTO 7
 300 LET A$="▜▛"
 305 LET B$="▟▙"
 310 GOTO 7
 400 LET A$="▙▙▌"
 405 LET B$="▛▛▌"
 410 GOTO 7
 500 LET A$="▙▞"
 505 LET B$="▛▚"
 510 GOTO 7

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.