Deck Parameters

Top  Previous  Next

A deck parameter lists out all 52 cards in a standard set of cards, in a fixed order.

 

$d=deck()

 

$d will now contain

 

A♠ 2♠ 3♠ 4♠ 5♠ 6♠ 7♠ 8♠ 9♠ 10♠ J♠ Q♠ K♠ A♥ 2♥ 3♥ 4♥ 5♥ 6♥ 7♥ 8♥ 9♥ 10♥ J♥ Q♥ K♥

A♣ 2♣ 3♣ 4♣ 5♣ 6♣ 7♣ 8♣ 9♣ 10♣ J♣ Q♣ K♣ A♦ 2♦ 3♦ 4♦ 5♦ 6♦ 7♦ 8♦ 9♦ 10♦ J♦ Q♦ K♦

 

This order does not change so $d[15] will always be the two of hearts.

 

Decks are not normally used on their own. Typically they are combined with a shuffle command or used with a selectfrom parameter which are discussed later.