gets one row of cards and converts numbers into the symbols
A,2,3,4,5,6,7,8,9,T,J,Q,K
PROGRAM DESIGN OUTLINE
1. Declare arrays, pick up 'tokens' and place 52 numbers in array card.
2. Shuffle cards.
3. Split into 4 hands and sort each.
4. OPEN screen window.
5. Fix the screen layout.
6. Print the four hands.
7. CLOSE the screen window.
100 DIM card(52),sort(13),tok$(4,2)
110 FOR k = 1 TO 4 : READ tok$(k)
120 FOR k = 1 TO 52 : LET card(k) = k
130 shuffle
140 split
150 OPEN #6,scr_440x220a35x15
160 layout
170 printem
180 CLOSE #6
190 DEFine PROCedure shuffle
200 FOR c = 52 TO 3 STEP -1
210 LET ran = RND(1 to c-1)
220 LET temp = card(c)
230 LET card(c) = card(ran)
240 LET card(ran) = temp
250 END FOR c
260 END DEFine
270 DEFine PROCedure split
280 FOR h = 1 TO 4
290 FOR c = 1 TO 13
300 LET sort(c) = card((h-1)*13+c)
310 END FOR c
320 sortem
330 FOR c = 1 TO 13
340 LET card((h-1)*13+c) = sort(c)
350 END FOR c
360 END FOR h
370 END DEFine
380 DEFine PROCedure sortem
390 FOR item = 2 TO 13
400 LET dart = item
410 LET comp = sort(dart)
420 LET sort(0) = comp