To begin here is my game embedded.
The most valuable thing I learned from this assignment is probably how to organize a programming project. I was able to set up the game structurally first then iteratively run the program adding elements as I thought through the project. I got the game loop down, and made a way for the player to keep playing. What I didn’t spend enough time on was considering how I would ‘flesh out’ the elements of the game. I tried fruitlessly to write a function that would select a card at random from the cards.csv module and put it into the list that represented the players hand. If could have written a deal_cards function then I would have been able to continue to deal two initial cards to the dealer and write a logical statement that would run to allow for more cards to be dealt until the dealer’s hand was greater than 16. Then I would have written code to print statements about the end result of the game, whether the player won or lost.
I think that now that I have considered this project I am better prepared to begin the final project.
The milestones that I initially developed for this project are below,
-
This is what a completed milestone will look like :)
- Make dictionary for cards
- Deal dealer cards
- Store player cards
- Create loop for round
- Determine “Bust”, “Tie - Loss”, and “Win” animations
I realize now that these are not the milestones that I actually used in working on my Blackjack game. There were many more in the beginning that I had to nail down before I could continue to more advanced milestones. These paint a broad picture of the assignment without meaninfully informing my process. For the final assignment I think that it would be useful to more carefully maintain and update a list of milestones. An updated list of milestones for this project might look like this,
- Create a cards.csv module
- Prompt the user for actions ‘Hit’ and ‘Stay’
- Make list for the users hand
- Write a function for dealing cards
- Create a function that displays the sum of the users hand
- Write a function for the dealer’s action
- Create loop for each round with the option of continuing after the endgame
- Determine “Bust”, “Tie - Loss”, and “Win”