RESHUF: Refactoring SHUFFL

LIST
  10 DIM N$(17)
  20 FOR I=0 TO 17\ READ N$(I)\ NEXT I
  30 DATA "A","2","3","4","5","6","7","8","9","T","J","Q","K"
  40 DATA "C","D","H","S","**"
  50
  60 DIM D(52)
  70 RANDOMIZE
  80 FOR I=52 TO 0 STEP -1
  90  J=INT((I+1)*RND(1))
 100  R=D(J)\ S=D(I)
 110  IF S<>0 THEN 120\ S=I+1
 120  D(J)=S
 130  IF R<>0 THEN 140\ R=J+1
 140  R=R-1\ S=INT(R/13)\ R=R-S*13
 150  IF S=4 THEN 160\ PRINT N$(R);
 160  PRINT N$(S+13);" ";
 170 NEXT I
 180 END


READY

RUN

QD QS KD 6H 2D 9S AD 3S 6S QC 2S 4D 5D KS 4S JD 5C QH AS 6D 8S 2C 8D 4C
6C 7D 5S AC 7S 3H 9H 9C JS TD KH 3C 7H AH 7C 9D 8H 4H KC 8C TH JH 5H TS
** TC 2H JC 3D

READY

RUN

5H 2D 8D 4D 5D 9C 3S 6H KS KC 8S ** 7D 4S AS 6S KD JC 9D 7C 5S 7S QH 3D
5C TS 4C AH 2C TC QC 6D JD 8C 2H 3C AD 4H 3H KH QD 9H TH AC JH 7H 8H TD
QS 9S 2S JS 6C

READY