If what you want to do is knowing what is the card you have, don't forget that just the number 0 to 51 can represent it, 'cause a deck of classical card is just a grid. you have color (spades (?), hearts (?), diamonds (?) and clubs (?)), on the rows and values (1,2,...,Q,K,A) on the columns
So basically if you choose to order things like in your animation in the Card sprite :
for colors
- 0 = clubs
- 1 = diamond
- 2 = hearts
- 3 = spades
for values
- 0 = 2 (ok it's a bit counter intuitive but heh...)
- 1 = 3
- ...
- 12 = K
- 12 = A
so you have a grid with 4 rows and 13 columns
the number 0 = the 2 of clubs
the number 51 = the Ace of spades
So basically you don't need any 3 dimensionnal array, all the informations are in the number representing the card
You just have to extract it as I did for placing cards
CardDeck.At(DeckCardNumber) is the number
to get the value it's like the X calculation
value = CardDeck.At(DeckCardNumber)%13
color is like the Y calculation
color = floor(CardDeck.At(DeckCardNumber)/13)
then you have your card (:
let's try the number 16
value = 16%13 = 3 it's a 4
color = floor(16/13) = 1 it's a diamond
16 = 4 of diamonds
easy peasy :D