Firstly you'll need a deck of cards.
A deck of 52 playing cards is split into four suits of 13 cards (Ace to King); this seems a complicated structure but we can think of the entire deck as numbered cards from 0 to 51 and write a formula to take care of the suits and card values.
Our first formula will work out the face value of any card in the deck...
Quote: "
n = card number
card value = n - int(n/13)*13
"
This formula cuts out the excess, from having multiple suits stacked on top of each other, and leaves us with the bare bones value of the card.
The next formula is to find which suit the card lies in...
Quote: "
n = card number
card suit = int(n/13)
"
This formula is similar to the first, but we don't inflate the suit value and remove it from the deck because we only wanted the suit value anyway.
It would have been more helpful to give these formulas the other way round but I can't cut and paste on here so meh.
Now you have to work out how to avoid duplicating the cards.
The Universe has been erased by a mod because it was larger
than 240x80 pixels.