

Game is simple but for those who don't know nothing about cards let me explain: A card deck for solitaire consists of 52 cards.
Cards are "numbered" from 1 to 13(actually A,2,3,4,5,6,7,8,9,10,J,Q,K but the symbolism doesn't matter) and each card has 4 different kinds of either spades,hearts,clubs diamonds. So we have the following 52 cards:
1♠, 2♠, 3♠, 4♠, 5♠, 6♠, 7♠, 8♠, 9♠, 10♠, 11♠, 12♠, 13♠
1♥, 2♥, 3♥, 4♥, 5♥, 6♥, 7♥, 8♥, 9♥, 10♥, 11♥, 12♥, 13♥
1♦, 2♦, 3♦, 4♦, 5♦, 6♦, 7♦, 8♦, 9♦, 10♦, 11♦, 12♦, 13♦
1♣, 2♣, 3♣, 4♣, 5♣, 6♣, 7♣, 8♣, 9♣, 10♣, 11♣, 12♣, 13♣
My main problem (i have more) is that i can't see how to give in every (of the 52) card a double property. That of the number (1,2,3,...,13) and that of the kind(♥,♦,♣,♠). I'm trying with arrays but i can't.
For example i want to have an array e.g a[52] that will contain all the deck cards, e.g to have a[0]=1♦, a[2]=8♠, a[3]= 5♥, etc.
Of course the 4 symbols would be represented by numerical values so it would be handy each value of a[] to correspond to a 1x2 array with each of the 2 elements to contain the arithmetic value of the card and the second element to represent the kind, e.g like a[0] = [1,4](for A♠) , a[30]=[9,3], a[31]=[10,3], a[32]=[12,4], a[40]=[6,2], a[51]=[8,1], etc....
So i could compare them easily. For this solitaire game comparison has to be in order to know if the card dealt is the next or the previous one of a specific card, for example we want to compare 4♠ to 7♠ or 8♣ to 9♦ if they are near each other(obviously they aren't) by just comparing their arithmetic number (the difference should obviously be 1) and their kind where their difference should be 0, as they are of the same kind, e.g a[4]=[8,3] (for 8♣) and a[5]=[9,4] (for 9♦) give 9-8=1 correctly(meaning the one is the successor of the other like we want) and 4-3 = 1 != 0 so they are not of the same kind (♣ versus ♦).
But i can't do it. Can anyone tell me a way? Please no tricks but only a general way, for being able to handle for example the case where the property of a card is triple or generally N, example if we want to connect each a[] element to a 1xN array like a[1]=[12,3,5,8,...,N]. Because i found a trick for doing that for the cards(for a N=2, 1x2 array like in cards) by doing e.g a[1] = 1.1 or a[1]=4.2 or a[1]=12.2 or a[1]=8.3 and the integer number to represent the arithmetic of the card while the decimal to represent the card kind (spades, hearts etc). But as you see this method sucks.
Does it need structures? Or it can be with another way, only with array use for example?
In fact i would be very thankful if anyone could solve the whole (small and quick) problem for me. In C code only as it's the only one i know of.

Here is the description of the solitaire game i'm trying to find the probability to got solved:
•You start with all 52 cards in a pack upside down and start dealing them 3 by 3 in the main stack where we are dealing cards from our deck, and we are dealing them with the face looking above(of course).
•The upper card of the first 3-group, if it's an Ace or King(1 or 13 in the code) it is removed and placed in a new stack.
•If the revealed card of the now 2-group cards that remained is Ace or King it is also placed into a new stack. If it's a Queen of the same kind of the King that we have already placed, it is placed above the King.
•If no match is made then we continue dealing 3 by 3 the cards in the main stack.
•We progress like that until we are out of cards in our deck. A round is completed.
•Then our main stack will be full, so we take these cards and start dealing again.
•We win if all cards will be dealt into the 8 stacks that will be created(4 starting with Aces and 4 starting with Kings obviously). While of course we lose if after we deal one round, no card gets out to be placed on an available stack(of the 8).
It's actually simpler than it looks.

So what i'm trying to make is a C code that runs this game and put it on e.g a for loop with thousands or millions of repetitions in order to count the win-loss ratio.
An animated GIF about how this game is played in order to help for better understanding:

Many thanks in advance.
I want to thank Mr Hyatt for answering in the other forum but his answer did not help me too much since what he proposes is not a general solution and i want something general to be able to apply it in other cases also where there are more than 2 "groups" of things i want to store.