Star Count

Author(s): Otis Imboden
Publication: Syntax
Pub Details: Syntax/Syntax ZX80 v2 n8 (Volume 2, Issue 8)
Date: August 1981
Pages: 12-13

Your assignment: assistant Navigation Officer on the starship Stellar Voyager, now en route to distant galaxies. As a backup to the ship’s computer, you have been trained to make a rapid visual survey of the star patterns projected on the ship’s viewscreen. After each complete scan of the starfield, you must make an estimate of the total number of stars visible on the view screen.

Naturally, the ship’s computer has already made a meticulous star-by-star count, but your visual estimate is expected to tally within 85% of the total reported by computer sensors. Less than a 70% score may mean that either you or the sensors need replacing.

LOAD program and use RUN (NL) to begin your first duty watch. When a prompt appears, use NL to begin the star scan. ZX80 will show a schematic view of star patterns ahead of the ship, stopping to request your estimate of the number of stars visible to the naked eye. Enter the number of your star count estimate and NL. ZX80 will report the true star count and your accuracy in percent on this scan. NL again for a new scan; press any key and NL to exit. On subsequent scans (up to 5), ZX80 also reports your running accuracy. If you can get into the 90% bracket, you’re on your way to a brilliant career as interstellar navigator.

  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 STOP
Syntactic Sum: -20490, 4K

[Editor’s note: line 190 is printed PRINT with CLS lettered in by hand; the printed Syntactic Sum matches PRINT.]

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