home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nibble Magazine
/
nib28b.dsk
/
BRIDGE.HANDS.bas
< prev
next >
Wrap
BASIC Source File
|
2023-02-26
|
1KB
|
32 lines
10 REM **********************
20 REM * BRIDGE.HANDS *
30 REM * BY LOREN WRIGHT *
40 REM * COPYRIGHT (C) 1986 *
50 REM * BY MICROSPARC, INC *
60 REM * CONCORD, MA 01742 *
70 REM **********************
80 PRINT CHR$(4)"BRUN SUPER.SORT"
90 C$ = "AKQJT98765432":S$ = "SHDC"
100 DIM DL(52),D%(52),VP(3),HP(3)
110 FOR I = 0 TO 3: READ VP(I),HP(I): NEXT
120 REM CREATE RANDOM DECK
130 FOR I = 1 TO 52:DL(I) = RND(1):D%(I) = I: NEXT
140 REM SORT FP ARRAY WITH INT TAGALONGS
150 & DL,1,52,D%
160 REM SORT EACH HAND
170 FOR H = 0 TO 3:F = 13 *H +1:L = F +12: & D%,F,L: NEXT
180 REM DISPLAY FOUR HANDS
190 GOSUB 310
200 FOR H = 0 TO 3
210 SL = 0
220 VTAB VP(H): HTAB HP(H)
230 FOR C = 1 TO 13
240 X = D%(13 *H +C)
250 S = INT((X -1)/13): IF S < >SL THEN VTAB VP(H) +S: HTAB HP(H):SL = S
260 PRINT MID$ (C$,X -13 *S,1);
270 NEXT C: PRINT : NEXT H
280 INPUT "ANOTHER? ";YN$: IF YN$ = "Y" THEN 130
290 END
300 REM PRINT SUIT LETTERS
310 HOME : FOR H = 0 TO 3: VTAB VP(H): FOR S = 1 TO 4: HTAB HP(H) -2: PRINT MID$ (S$,S,1): NEXT S,H: RETURN
320 DATA 1,15,9,3,9,28,18,15