3 ms·
> Not quite. The rightmost one initially has 6 closed cards and 1 revealed card which can be a king, so you can put 12 more cards on top of it, for a total of 6
by steve_taylor 2mo ago
> Not quite. The rightmost one initially has 6 closed cards and 1 revealed card which can be a king, so you can put 12 more cards on top of it, for a total of 6+13 = 19 cards. So I'd make 7 arrays for 20 cards each, just to be safe. Or just use 52-long arrays for every table slot, that too is an option.
You're right. And I hadn't considered tracking the index of the first revealed card.
Anyway, my point is that you can map out the memory allocation quite easily and it's static and small, so you don't have to worry about malloc and free.