Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-01 - decus/20-0020/digits.gam
There are 2 other files named digits.gam in the archive. Click here to see a list.
100'  NAME--DIGITS
110'
120'  DESCRIPTION--GUESSES A SEQUENCE OF NUMBERS.
130'
140'  SOURCE--UNKNOWN
150'
160'  INSTRUCTIONS--TYPE "RUN" AND FOLLOW DIRECTIONS.
170'
180'
190'  *  *  *  *  *  *   MAIN PROGRAM  *  *  *  *  *  *  *  *  *  *
200'
210 PRINT"THIS IS A GAME OF GUESSING."
220 PRINT "FOR INSTRUCTIONS, TYPE '1', ELSE TYPE '0'";
230 INPUT E
240 IF E=0 THEN 360
250 PRINT
260 PRINT "PLEASE TAKE A PIECE OF PAPER AND WRITE DOWN"
270 PRINT "THE DIGITS '0', '1', OR '2' THIRTY TIMES AT RANDOM."
280 PRINT "ARRANGE THEM IN THREE LINES OF TEN DIGITS."
290 PRINT "I'LL ASK FOR THEM 10 AT A TIME."
300 PRINT "I WILL ALWAYS GUESS FIRST, AND THEN LOOK AT YOUR"
310 PRINT "NEXT NUMBER TO SEE IF I WAS RIGHT. BY PURE LUCK I"
320 PRINT "OUGHT TO BE RIGHT 10 TIMES. BUT I HOPE TO DO BETTER"
330 PRINT "THAN THAT****"
340 PRINT
350 PRINT
360 READ A,B,C
370 DATA 0,1,3
380 DIM M(26,2)
390 DIM K(2,2), L(8,2)
400 MAT M = CON
410 MAT K = CON
420 MAT K = (9)*K
430 MAT L = CON
440 MAT L = (3)*L
450 LET L(0,0) = 2
460 LET L(4,1) = 2
470 LET L(8,2) = 2
480 LET Z = 26
490 LET Z1 = 8
500 LET Z2 = 2
510 LET X = 0
520 FOR T = 1 TO 3
530 PRINT
540 PRINT "TEN NUMBERS PLEASE";
550 INPUT N(1), N(2), N(3),N(4),N(5),N(6),N(7),N(8),N(9),N(10)
560 FOR I = 1 TO 10
570 LET W = N(I) - 1
580 IF W = SGN(W) THEN 620
590 PRINT "USE ONLY THE DIGITS '0', '1', OR '2'."
600 PRINT "LET'S TRY AGAIN."
610 GOTO 530
620 NEXT I
630 PRINT
640 PRINT "MY GUESS", "YOUR NO.", "RESULT", "NO. RIGHT"
650 PRINT
660 FOR U = 1 TO 10
670 LET N = N(U)
680 LET S = 0
690 FOR J = 0 TO 2
700 LET S1 = A*K(Z2,J) + B*L(Z1,J) + C*M(Z,J)
710 IF S > S1 THEN 760
720 IF S < S1 THEN 740
730 IF RND<.5 THEN 760
740 LET S=S1
750 LET G=J
760 NEXT J
770 PRINT G, N(U),
780 IF G=N(U) THEN 810
790 PRINT "WRONG", X
800 GOTO 830
810 LET X = X+1
820 PRINT "RIGHT", X
830 LET M(Z,N) = M(Z,N)+1
840 LET L(Z1,N) = L(Z1,N)+1
850 LET K(Z2,N) = K(Z2,N)+1
860 LET Z = Z - INT(Z/9)*9
870 LET Z = 3*Z+N(U)
880 LET Z1 = Z-INT(Z/9)*9
890 LET Z2 = N(U)
900 NEXT U
910 NEXT T
920 PRINT
930 IF X>10 THEN 980
940 IF X<10 THEN 1010
950 PRINT "I GUESSED EXACTLY 1/3 OF YOUR NUMBERS."
960 PRINT "IT IS A TIE GAME."
970 GOTO 1030
980 PRINT "I GUESSED MORE THAN 1/3 OF YOUR NUMBERS."
990 PRINT "I WIN."
1000 GOTO 1030
1010 PRINT "I GUESSED LESS THAN 1/3 OF YOUR NUMBERS."
1020 PRINT "YOU BEAT ME. CONGRATULATIONS***"
1030 PRINT
1040 PRINT "DO YOU WANT TO TRY AGAIN?"
1050 PRINT "IF YES, TYPE '1';   IF NO, TYPE '0'";
1060 INPUT X
1070 IF X =1 THEN 400
1080 PRINT "THANKS FOR THE GAME."
1090 END