Ch. 3 Acey-Deucy game contains error
[edit: I'm an idiot. The shuffle function only shuffles cards 0-51 in the array. Ignore this whole post please!]
So I just finished coding the Acey-Deucy game at the end of Chapter 3. On my first test of the game, I ended up receiving the "sentinel" card as one of my first two cards. Looking back through my code, I realized that in my main do...while loop for the game, I accidentally had it checking the previous 3 cards for the sentinel card instead of the next 3.
Problem solved, right? WRONG.
This highlights a critical error in the way this game works: the sentinel card gets shuffled in with the rest. As I understood from the description, the game should continue until the entire deck is used up, but with the way the sentinel card currently gets shuffled in, the game just ends as soon as the sentinel is in the next 3 cards. I can see how this would be a hard error to catch without having made an error in your code like I did originally, but really guys?
Obviously this can be solved a couple of different ways, one of which would be to modify the initialization of the card deck and a bit of the main code so that the sentinel card gets added after the deck is shuffled.
Last edited by tblank555; February 26th, 2013 at 02:01 AM..
Reason: Realized I was wrong.
|