anchor.diff:      end.
   
   generate_deck() ->
  -    [ {X, Y} ||
  -      X <- lists:seq(2, 14),
  -      Y <- [club, heart, diamond, spade] ].
  +    Deck = lists:flatten(
  +             lists:duplicate(?NUM_DECKS, [{X, Y} ||
  +                                          X <- lists:seq(2, 14),
  +                                          Y <- [club, heart, diamond, spade]])),
  +    shuffle_deck(Deck).
   
   shuffle_deck(Deck) ->
  -    %% TBD
  -    Deck.
  +    Random = lists:sort(
  +               [{rand:uniform()*100*100*100, Y} || Y <- Deck]),
  +    [X || {_,X} <- Random].
  
positive.code: 
  deck() ->
      ct:pal("I'm alive!"),
      Deck= lists:flatten(lists:duplicate(8, generate_deck())),
  
      loop(shuffle_deck(Deck)).
  
  loop(Deck) ->
      receive
  
negative.code:     end.
  
  shuffle(Pid) ->
      Pid ! {self(), shuffle},
  
      receive
          ok ->
              ok;
          _ ->
              ct:pal("Received unexpected response in shuffle()"),
              error
      after 100 ->
                timeout
  