Task

Create a data structure and the associated methods to define and manipulate a deck of   playing cards.

The deck should contain 52 unique cards.

The methods must include the ability to:

   make a new deck
   shuffle (randomize) the deck
   deal from the deck
   print the current contents of a deck 
Each card must have a pip value and a suit value which constitute the unique value of the card.

Related tasks:

 Card shuffles
 Deal cards_for_FreeCell
 War Card_Game
 Poker hand_analyser
 Go Fish


suite$ = "C,D,H,S"                      ' Club, Diamond, Heart, Spade
card$  = "A,2,3,4,5,6,7,8,9,T,J,Q,K"    ' Cards Ace to King
 
dim n(55)                               ' make ordered deck 
for i = 1 to 52                         '  of 52 cards
 n(i) 	= i
next i
 
for i = 1 to 52 * 3                     ' shuffle deck 3 times
  i1    = int(rnd(1)*52) + 1
  i2    = int(rnd(1)*52) + 1
  h2    = n(i1)
  n(i1) = n(i2)
  n(i2) = h2
next i
 
for hand = 1 to 4                       ' 4 hands 
for deal = 1 to 13			' deal each 13 cards
 card = card + 1                        ' next card in deck
    s    = (n(card) mod 4)  + 1         ' determine suite
    c    = (n(card) mod 13) + 1         ' determine card
    print word$(card$,c,",");word$(suite$,s,",");" ";  ' show the card
  next deal
print
next hand