The user can choose whether to be dealt a card (a number between 1 and 8) or ‘fold’ and quit the game. Each number they are dealt adds up to their total. If the total goes over 21 then they lose. The aim of this game is to get as close to 20 as you think luck will let you, in the most number of hands.
- Think about the type of loop that you need.
- What variables will you need?
- Remember to use an input, what will you ask the user? How will you use their response?
- Remember to use ‘import random’ and rand.randint(your range) to create a random number.
- What outputs do you need ad when? What should you display… After each hand? At the beginning? At the end?
For the scenario above you will need to include (with screenshots where appropriate):
- An introduction to explain the Purpose of your program.
- A List of Requirements for a successful program.
- You could create a Flowchart first to help you plan it.
- Screenshots of your code (with comments in your code to show understanding).
- Testing – Create a plan to show how you will test your program and then explanations of any errors that you found and how they were fixed.
- An Evaluation of what worked, what didn’t and how you met each of your requirements from your original list. Also, discuss further improvements that you could make to your program.