Trailing-Edge
-
PDP-10 Archives
-
decuslib20-01
-
decus/20-0020/bridge.gam
There are 2 other files named bridge.gam in the archive. Click here to see a list.
100' NAME--BRIDGE
110'
120' DESCRIPTION--BRIDGE PRACTICE SESSION.
130'
140' SOURCE--UNKNOWN
150'
160' INSTRUCTIONS--TYPE "RUN" AND FOLLOW INSTRUCTIONS
170'
180'
190' * * * * * * MAIN PROGRAM * * * * * * * * * * * * *
200'
210 RANDOMIZE
220 MAT READ D$(4)
230 MAT READ B$(5)
240 DATA JACK,QUEEN,KING,ACE,CLUBS,DIAMONDS,HEARTS,SPADES,NO TRUMP
250 PRINT "WELCOME TO THE DIGITAL BRIDGE PRACTICE SESSION."
260 PRINT"IN MAKING BIDS TWO NUMBERS ARE TO BE TYPED."
270 PRINT"THE FIRST IS THE AMOUNT OF THE BID, THE SECOND REPRESENTS"
280 PRINT"THE SUIT BID; 1=CLUBS,2=DIAMONDS,3=HEARTS,4=SPADES,5=N.T."
290 PRINT"THUS, 4 HEARTS IS '4,3'. A PASS IS '0,0'."
300 DIM I(13,4)
310 GOTO 380
320 PRINT "DO YOU WANT TO CONTINUE";
330 INPUT Q$
340 IF Q$="NO" THEN 2310
350 IF Q$="YES" THEN 380
360 PRINT"INCORRECT ANSWER. TYPE 'YES' OR 'NO'";
370 GOTO 330
380 LET P=0
390 FOR S=1 TO 13
400 FOR T=0TO3
420 LET I(S,T)=-1
430 NEXT T
440 NEXT S
450 FOR T=0 TO 3
460 LET G(T)=1
470 NEXT T
480 LET N=52
490 PRINT
500PRINT
510 PRINT
520 DIM Z(100)
530 PRINT "CARDS DEALT"
540 PRINT
550 PRINT "CLUBS","DIAMONDS","HEARTS","SPADES"
560 FOR Z1=1 TO N
570 LET Z(Z1)=Z1
580 NEXT Z1
590 FOR Z1=1 TO 13
600 LET Z2=1+INT((N-Z1+1)*RND)
610 LET X=Z(Z2)
620 FOR Z3=Z2TON-Z1
630 LET Z(Z3)=Z(Z3+1)
640 NEXT Z3
650 LET C=INT(X/13)
660 LET D=X-C*13+2
670 IF C<>4 THEN 690
680 LET C=0
690 IF Z1>13 THEN 720
700 LET I(G(C),C)=D
710 LET G(C)=G(C)+1
720 NEXT Z1
730 FOR Z1=0 TO 3
740 FOR S=1TO13
750 FOR T=1TOS
760 IF I(S,Z1)<I(T,Z1) THEN 800
770 LET D=I(S,Z1)
780 LET I(S,Z1)=I(T,Z1)
790 LET I(T,Z1)=D
800 NEXT T
810 NEXT S
820 NEXT Z1
830 LET Z1=0
840 FOR N=0TO3
850 LET P(N)=0
860 NEXT N
870 FOR S=1 TO 13
880 PRINT
890 FOR N=0 TO 3
900 LET D=I(S,N)
910 IF D<>-1 THEN 940
920 PRINT " ",
930 GOTO 1020
940 LET Z1=Z1+1
950 IF D<=10 THEN 970
960 GOTO 990
970 PRINT D,
980 GOTO 1010
990 PRINT D$(D-10),
1000 LET P(N)=P(N)-10+D
1010 IF Z1>=13 THEN 1040
1020 NEXT N
1030 NEXT S
1040 LET P=P(0)+P(1)+P(2)+P(3)
1050 FOR N=0TO3
1060 LET Q(N)=G(N)-1
1070 IF Q(N)<>0 THEN 1090
1080 LET P=P+3
1090 IF Q(N)<>1 THEN 1110
1100 LET P=P+2
1110 IF Q(N)<>2 THEN 1130
1120 LET P=P+1
1130 NEXT N
1140 PRINT
1150 PRINT
1160 PRINT "COUNT THE POINTS, AND TYPE IT";
1170 INPUT P1
1180 IF P1 <> P THEN 1210
1190 PRINT "CORRECT"
1200 GO TO 1220
1210 PRINT "WRONG. BY THE OFFICIAL COUNT YOU HAVE";P;"POINTS."
1220 PRINT "PLEASE MAKE YOUR BID";
1230 INPUT L7, N7
1240 IF P >6 THEN 1280
1250 LET L6 = 0
1260 GOSUB 2180
1270 GOTO 2170
1280 REM
1290 IF P>10 THEN 1380
1300 FOR N=OTO3
1310 IF G(N)-1<7 THEN 1360
1320 LET N6 = N + 1
1330 LET L6 = 3
1340 GOSUB 2180
1350 GO TO 2170
1360 NEXT N
1370 GO TO 1250
1380 IF P>=14 THEN 1400
1390 GOTO 1250
1400 REM
1410 IF P<16 THEN 1630
1420 IF P>=19 THEN 1510
1430 FOR N=0 TO 3
1440 LET Q(N)=G(N)-1
1450 IF Q(N)+P(N)<5 THEN 1630
1460 NEXT N
1470 LET L6 = 1
1480 LET N6 = 5
1490 GOSUB 2180
1500 GOTO 2170
1510 IF P<22 THEN 1630
1520 IF P>=25 THEN 1590
1530 FOR N=0 TO 3
1540 LET Q(N)=G(N)-1
1550 IF Q(N)+P(N)<5 THEN 1630
1560 NEXT N
1570 LET L6 = 2
1580 GO TO 1480
1590 IF P>=28 THEN 1610
1600 GOTO 1940
1610 PRINT "SLAM PROBABLE. BID TWO, THEN PROCEED TO GAME OR SLAM TRY."
1620 GOTO 2170
1630 FOR N=0 TO 3
1640 LET Q(N)=G(N)-1
1650 NEXT N
1660 FOR I=0 TO 3
1670 LET S(I)=I
1680 NEXT I
1690 FOR N=0 TO 3
1700 FOR E=0 TO N
1710 IF Q(N)<Q(E) THEN 1780
1720 LET B1=Q(N)
1730 LET Q(N)=Q(E)
1740 LET Q(E)=B1
1750 LET X1=S(N)
1760 LET S(N)=S(E)
1770 LET S(E)=X1
1780 NEXT E
1790 NEXT N
1800 FOR I=0TO3
1810 LET N=S(I)
1820 IF Q(0)>Q(1) THEN 1850
1830 IF P(S(0))>P(S(1)) THEN 1850
1840 LET N=S(1)
1850 IF Q(I)<4 THEN 1910
1860 IF P(N)<3 THEN 1910
1870 LET N6 = N+1
1880 LET L6 = 1
1890 GOSUB 2180
1900 GO TO 2170
1910 NEXT I
1920 LET N6 = 1
1930 GO TO 1880
1940 FOR I= 0 TO 3
1950 LET S(I)=I
1960 NEXT I
1970 FOR N=0 TO 3
1980 FOR E=0 TO N
1990 IF Q(N)<Q(E) THEN 2060
2000 LET B1=Q(N)
2010 LET Q(N)=Q(E)
2020 LET Q(E)=B1
2030 LET X1=S(N)
2040 LET S(N)=S(E)
2050 LET S(E)=X1
2060 NEXT E
2070 NEXT N
2080 FOR I=0 TO 3
2090 LET N=S(I)
2100 IF Q(I)<4 THEN 2160
2110 IF P(N)<3 THEN 2160
2120 LET N6 = N+1
2130 LET L6 = 2
2140 GOSUB 2180
2150 GO TO 2170
2160 NEXT I
2170 GOTO 320
2180 IF L6 <> L7 THEN 2290
2190 IF L6 = 0 THEN 2210
2200 IF N7 <> N6 THEN 2290
2210 PRINT "CORRECT. ";
2220 PRINT "THE OFFICIAL BID IS";
2230 IF L6 <> 0 THEN 2260
2240 PRINT " PASS."
2250 RETURN
2260 PRINT L6;
2270 PRINT B$(N6);"."
2280 RETURN
2290 PRINT "WRONG. ";
2300 GO TO 2220
2310 END