F. Discussion

During the final testing of the game, a few hands of Blackjack was played, where the game tester hit and the dealt card value was added to her initial hand value and she won, and another hand where she hit and busted. All parts of the game worked properly with no present errors. The very first step the team had to accomplish was to create a deck of cards as a matrix. Each card in the deck needed to be assigned a certain value since all of the face cards count as 10 and the aces can be 1 or 11 based on user input. Next, a “dealer” was made to deal out the starting hands to start the game. The player and the dealer each needed two initial cards, and the dealer needed one face up and the other face down. After the initial hands were dealt successfully, the part of the code that would allow the player to play out his hand by hitting or staying while adding the value of all of the cards in his hands together needed to be written. This step involved lots of user input functions and variables for the addition of the card values. The blackjack hands were then programmed, which consisted of a ten-value card and an ace which results in an instant win. Afterwards, busting had to be taken into account as well. Once the player’s hand was working properly, the dealer had to be programmed. This was done by making sure that the dealer hits whenever his hand is less than the player’s hand.  Once the game was working well, a for loop was added so that the user could continue to play for as long as he wishes. Betting was added to the game by allowing the user to type in any amount of money to bet and then win or lose depending how the hand played out.  The biggest obstacles involved programming aces to change value if the user wanted it to equal 11 instead of 1 and with the betting. The problem with the value of aces was fixed by using if statements to check for a dealt ace and then using an input and a series of sums to complete the user’s input. Betting was incorporated by creating a variable that was equal to the initial bet and another that represented a “running tab” of the player’s net earnings.