Trailing-Edge
-
PDP-10 Archives
-
decus_20tap2_198111
-
decus/20-0028/bridge.lst
There is 1 other file named bridge.lst in the archive. Click here to see a list.
SNOBOL4 (VERSION 3.4.3, JAN. 16, 1971)
DIGITAL EQUIPMENT CORP., PDP-10
1 DATA('CARD(NUM,NEXT)')
*
2 OUTPUT('TITLE',6,'(14H1THIS IS HAND ,22A5)')
3 OUTPUT('DEALER',6,'(11H DEALER IS ,22A5)')
4 OUTPUT('SKIP',6,'(A1)')
*
*
* FUNCTIONS
*
5 DEFINE('INSERT(LIST,CARD)TEMP') :(INSERTEND)
*
6 INSERT $LIST = IDENT($LIST) CARD(NUM(CARD),NULL) :S(RETURN)
7 $LIST = GT(NUM(CARD),NUM($LIST)) CARD(NUM(CARD),$LIST)
7 . :S(RETURN)
8 TEMP = $LIST
9 INS1 IDENT(NEXT(TEMP)) :S(INS2)
10 NEXT(TEMP) = GT(NUM(CARD),NUM(NEXT(TEMP)))
10 . CARD(NUM(CARD),NEXT(TEMP)) :S(RETURN)
11 TEMP = NEXT(TEMP) :(INS1)
12 INS2 NEXT(TEMP) = CARD(NUM(CARD),NULL) :(RETURN)
13 INSERTEND
*
*
14 DEFINE('LINE(STR1,COL1,STR2,COL2)BL1,BL2') :(LINEEND)
*
15 LINE BL LEN(COL1 - 1) . BL1
16 IDENT(STR2) :S(LINE1)
17 BL LEN(COL2 - (COL1 + SIZE(STR1))) . BL2
18 LINE1 LINE = BL1 STR1 BL2 STR2 :(RETURN)
19 LINEEND
*
*
20 DEFINE('NTH(LIST,NUM)TEMP') :(NTHEND)
*
21 NTH NTH = EQ(NUM,0) $LIST :F(NTH1)
22 $LIST = NEXT($LIST) :(RETURN)
23 NTH1 TEMP = $LIST
24 NTH2 NUM = NUM - 1
25 NTH = EQ(NUM,0) NEXT(TEMP) :S(NTH3)
26 TEMP = NEXT(TEMP) :(NTH2)
27 NTH3 NEXT(TEMP) = NEXT(NEXT(TEMP)) :(RETURN)
28 NTHEND
*
*
29 DEFINE('RANDOM(N)') :(RANDOMEND)
30 RANDOM RAN.VAR = RAN.VAR * 1061 + 3251
31 RAN.VAR ARB RPOS(5) =
32 RANDOM = (RAN.VAR * N) / 100000 :(RETURN)
33 RANDOMEND
*
*
34 DEFINE('SUITL(HAND,SUIT)') :(SUITLEND)
*
35 SUITL SUITL = SUIT ' '
36 SUITL1 GT(NUM($HAND),$SUIT) :F(RETURN)
37 SUITL = SUITL $(NUM($HAND) - $SUIT)
38 $HAND = DIFFER(NEXT($HAND)) NEXT($HAND) :S(SUITL1)F(RETURN)
39 SUITLEND
*
*
* CONSTANTS
*
40 BL = ' '
40 . ' '
41 S = 39
42 H = 26
43 D = 13
44 C = 0
45 $1 = 2
46 $2 = 3
47 $3 = 4
48 $4 = 5
49 $5 = 6
50 $6 = 7
51 $7 = 8
52 $8 = 9
53 $9 = 10
54 $10 = 'J'
55 $11 = 'Q'
56 $12 = 'K'
57 $13 = 'A'
58 DEALSEQ = 'NORTH,EAST,SOUTH,WEST,NORTH,'
59 RAN.VAR = 157
60 DEALMAX = 3
61 NTHDEAL =
62 DEAL = 'WEST'
63 NEWDEAL NTHDEAL = LT(NTHDEAL,DEALMAX) NTHDEAL + 1 :F(END)
64 N = 1
65 NORTH =
66 EAST =
67 SOUTH =
68 WEST =
69 DECK =
70 DLOOP DECK = CARD(N,DECK)
71 N = LT(N,52) N + 1 :S(DLOOP)
72 DEALSEQ DEAL ',' BREAK(',') . DEAL :F(ERR)
73 HAND = DEAL
74 N = 52
75 NLOOP DEALSEQ HAND ',' BREAK(',') . HAND :F(ERR)
76 INSERT(HAND,NTH('DECK',RANDOM(N)))
77 N = GT(N,1) N - 1 :S(NLOOP)
*
*
* OUTPUT OF HAND
*
78 TITLE = NTHDEAL
79 DEALER = DEAL
80 SKIP = ' '
81 OUTPUT = LINE('NORTH',40)
82 OUTPUT =
83 OUTPUT = LINE(SUITL('NORTH','S'),40)
84 OUTPUT = LINE(SUITL('NORTH','H'),40)
85 OUTPUT = LINE(SUITL('NORTH','D'),40)
86 OUTPUT = LINE(SUITL('NORTH','C'),40)
87 SKIP = ' '
88 OUTPUT = LINE('WEST',20,'EAST',60)
89 OUTPUT =
90 OUTPUT = LINE(SUITL('WEST','S'),20,
90 . SUITL('EAST','S'),60)
91 OUTPUT = LINE(SUITL('WEST','H'),20,
91 . SUITL('EAST','H'),60)
92 OUTPUT = LINE(SUITL('WEST','D'),20,
92 . SUITL('EAST','D'),60)
93 OUTPUT = LINE(SUITL('WEST','C'),20,
93 . SUITL('EAST','C'),60)
94 SKIP = ' '
95 OUTPUT = LINE('SOUTH',40)
96 OUTPUT =
97 OUTPUT = LINE(SUITL('SOUTH','S'),40)
98 OUTPUT = LINE(SUITL('SOUTH','H'),40)
99 OUTPUT = LINE(SUITL('SOUTH','D'),40)
100 OUTPUT = LINE(SUITL('SOUTH','C'),40)
100 . :(NEWDEAL)
101 END
NO ERRORS DETECTED IN SOURCE PROGRAM
THIS IS HAND 1
DEALER IS NORTH
NORTH
S A64
H K762
D Q98
C A98
WEST EAST
S KQJ872 S 105
H AQ9 H 85
D J6 D AK542
C 52 C QJ74
SOUTH
S 93
H J1043
D 1073
C K1063
THIS IS HAND 2
DEALER IS EAST
NORTH
S 93
H AJ1073
D AJ5
C KQJ
WEST EAST
S KQ1052 S A64
H 6 H K984
D 98743 D 1062
C 103 C 976
SOUTH
S J87
H Q52
D KQ
C A8542
THIS IS HAND 3
DEALER IS SOUTH
NORTH
S J8643
H 63
D 42
C J1082
WEST EAST
S K1097 S A2
H 2 H K985
D AQ1053 D KJ86
C A63 C Q75
SOUTH
S Q5
H AQJ1074
D 97
C K94
NORMAL TERMINATION AT LEVEL 0
LAST STATEMENT EXECUTED WAS 63
SNOBOL4 STATISTICS SUMMARY-
2046 MS. COMPILATION TIME
5081 MS. EXECUTION TIME
10527 STATEMENTS EXECUTED, 3211 FAILED
3368 ARITHMETIC OPERATIONS PERFORMED
375 PATTERN MATCHES PERFORMED
11 REGENERATIONS OF DYNAMIC STORAGE
0 READS PERFORMED
69 WRITES PERFORMED
40 K CORE USED, 4535 FREE WORDS LEFT
0.48 MS. AVERAGE PER STATEMENT EXECUTED