I'm trying to create a Blackjack simulator so I can test out (and maybe genetically evolve) some various play-charts, betting-strategies, and card-counting-charts.
Before I dive into it, I wanted to outline the structure in detail, since the game has these caveats that make it less trivial to code than a game like poker. (like splitting)
My basic design so far is this:
-deck: composed of a vector or list of cards
-card: composed of a value (like 10 for 10's, Jacks, Queens, etc.), a name and a suit
-hand: composed of a bet, a list of cards, and two hands (potential left split and right split)
-player: composed of a balance and a hand
-shuffling: i'm going to shuffle by sucking cards, randomly, out of the deck and creating a new deck, in order
1. Should I use a vector or a list for the cards? I'm thinking:
vector: O(1) for lookup, O(n/4) for removal (average cases)
list: O(n/4) for lookup, O(1) for removal (average cases)
2. How do I deal with Aces? Is the best way to just have some conditional code whenever dealing with cards to see if a card is an Ace to check for soft 17's and the like?