ZX81/TS1000
TS1500
TS2068/Spectrum
Hi, my name is Joe C. Smith, Jr. I am the author of this new column which will contain product reviews, stories, and program listings for the T/S line of computers.
Now a little about myself. I have been using computers and writing computer programs since 1978. I am curently attending Central Arizona College and Emmaus Bible College, which are both located in Arizona. I am currently writing articles which appear in several computer magazines, covering Apple computers, T/S computers, Tandy computers, and hand held computers.
This month’s program is a game I call ‘SECRET NUMBER.’ The computer holds a secret number whose value is anywhere between 0 and 50. You have to guess that number by using messages as cross references. As you enter a guess (input a number) the computer gives you a clue as to the general area of the secret number.
Listing 1 is the program. (Compatable with TS1000/ZX81 and 2068.) Listing 2 is a sample run.
Listing 1
5 LET Y=0
10 LET Z=50
15 LET I=0
20 LET X=INT (RND*50)
30 LET I=I+1
40 PRINT Y;"/";Z;":";I
50 INPUT N
60 IF N=X THEN GOTO 100
70 IF N<X THEN IF N>Y THEN LET Y=N
80 IF N>X THEN IF N<Z THEN LET Z=N
90 GO TO 30
100 PRINT "YOU HIT IT IN:";I;"GUESSES."
Listing 2
Screen output: No. entered: 0/50:1 25 25/50:2 33 25/33:3 29 25/29:4 27 YOU HIT IN 4 GUESSES.
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.