A star-counting game for the ZX80. As assistant navigation officer of the starship Stellar Voyager, you press NEWLINE to scan the starfield: the screen fills with a random pattern of stars, and you enter your estimate of how many there are. The program prints the true count and your accuracy in percent, and from the second scan on your running average. Five scans make a duty watch.
Press NEWLINE for each new scan, or any key and NEWLINE to stop. The article sets 85 percent as the standard to aim for.
Published in Syntax August 1981 (Star Count).
Source Code
10 PRINT ,"STAR COUNT"
20 CLEAR
30 LET R=0
40 LET W=0
45 FOR P=1 TO 5
50 INPUT B$
55 IF B$>"" THEN GO TO 300
60 CLS
70 LET S=0
80 FOR I=1 TO 429
100 GO TO 128+RND(16)*2
145 PRINT CHR$(128);
146 NEXT I
148 PRINT CHR$(142);
149 LET S=S+2
159 NEXT I
160 PRINT CHR$(155);
161 LET S=S+1
167 NEXT I
170 PRINT
179 PRINT "YOUR ESTIMATE..?";
180 INPUT A
185 PRINT A
190 PRINT
200 PRINT ," TRUE STAR COUNT= ";S
210 IF A=S THEN GO TO 250
220 LET R=100-(100*(ABS(S-A))/S)
222 PRINT "ACCURACY= ";R;" PERCENT"
223 IF P=1 THEN LET W=R
224 IF P>1 THEN LET W=(W+R)/2
225 IF P>1 THEN PRINT "RATE= ";W;" SCANS= ";P
227 IF P=5 THEN GO TO 10
230 PRINT "NL FOR NEXT SCAN"
240 NEXT P
245 GO TO 300
250 PRINT " **** EUREKA...100 PERCENT ****"
300 STOPNote: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

