10 '*** GUESSNUM -- VERSION 1.1 -- 3/21/84
20 Y%=-32767
30 N2=1
40 TRIES=0
50 N3=1
60 PRINT CHR$(26)			' CLEAR SCREEN
70 PRINT "     GUESSNUM: RANDOM NUMBER GUESSING GAME  ":PRINT:PRINT
80 PRINT "     (PRESS <RETURN> TO START) ":PRINT
90 Y%=Y%+1
100 IF Y%=32767	THEN Y%=-32767
110 A$=INKEY$:	IF LEN(A$)=0	THEN GOTO 90
120 RANDOMIZE Y%
130 PRINT:INPUT "*What is your guess (between 0 and 100)";GUESS%
140 NUM%=100*RND(1)
150 N%=1
160 IF  GUESS%=NUM%	THEN 220
170 IF GUESS%>NUM%  THEN PRINT "    Too **LARGE**":GOTO 190
180 PRINT "    too small"
190 INPUT "Next guess";GUESS%
200 N%=N%+1
210 GOTO 160
220 IF N%>6		THEN 250
230 PRINT "--- YOU GUESSED IT!  It took only";
240 GOTO 260
250 PRINT "--- You guessed it in";
260 PRINT N%;"tries.":PRINT
270 INPUT "*Do you want to try again (Y/N)";AGAIN$
280 PRINT:IF N3<>1	THEN 380
290 IF AGAIN$<>"Y" AND AGAIN$<>"y"  THEN 330
300 PRINT:PRINT "    Round 1 is now over.  Please specify the"
310 INPUT "    maximum no.of rounds you wish to play: ",N2
320 IF  N2<1 OR N2>20	THEN PRINT "MAX.NO.1-20 ONLY":GOTO 310
330 DIM A(N2)		'NUMBER MATRIX
340 DIM ANUM(N2)	'TRIES MATRIX
350 ANUM(1)=N%		'NO.OF TRIES
360 A(1)=GUESS%		'NUMBER
370 IF  N3=1		THEN 400
380 ANUM(N3)=N%
390 A(N3)=GUESS%
400 IF AGAIN$<>"Y" AND AGAIN$<>"y"  THEN GOTO 440
410 N3=N3+1
420 IF N3>N2  THEN PRINT CHR$(26);"  Maximum reached.":GOTO 450
430 GOTO 130
440 N2=N3
450 PRINT ,"-----------------------------------"
460 PRINT ,,"VALUE"TAB(39)"NO.OF TRIES"
470 PRINT ,"-----------------------------------"
480 FOR I=1 TO N2
490   PRINT ,I,A(I),ANUM(I)
500   TRIES=TRIES+ANUM(I)
510 NEXT I
520 PRINT ,"-----------------------------------"
530 PRINT TAB(28);"TOTAL TRIES:",TRIES
540 PRINT ,"-----------------------------------"
550 ATR=(INT(100*TRIES/N2))/100
560 PRINT TAB(28);"AVERAGE:",ATR
570 END

540 PRINT ,"-----------------------------------"
550 ATR=(