Question
The purpose of this Hands-On is to incorporate all the programing concepts we have covered so far into one Python program. Concepts covered includes: Sequences,
The purpose of this Hands-On is to incorporate all the programing concepts we have covered so far into one Python program. Concepts covered includes: Sequences, Input, Output, Modules, Passing and returning variables, Decisions and Loops.
Task: Design pseudo code and a program for a High/Low Game.
High/Low Game Who has the higher number, computer or user?
User versus Computer
User can play as long as they want to do so (many rounds)
Each round the
Computer will randomly pick a number between 1 and 100 for the User
Computer will inform User that number
Computer will then pick its own random number between 1 and 100, but not tell the User
User must guess if their number is higher or lower the Computers number
User guesses correctly
User gets a point
the round continues the User and the Computer gets a new number
the User is told how many points they and the computer earned
User guesses incorrectly
Computer gets a point
the round continues the User and the Computer gets a new number
the User is told how many points they and the computer earned
Make it the first one to reach 10 the winner of each round
10 correct guesses by the User, the User wins
10 incorrect guesses by the User, the Computer wins
Tally each number of rounds the User and Computer won
Display the overall score after each Win and if the User wants to end play
Rounds won by User
Rounds won by Computer
You will need the import at the start of your code and use the random generator in your program just like you did in RPS.
# import the random module
import random
#generate random num between (inclusive) 1 & 100
comp_choice = random.randint(1, 100)
Remember to test all the scenarios of the game:
High guess is correct
High guess is incorrect
Low guess is correct
Low guess is incorrect
User gets 1 guess correct
User gets multiple guesses correct
User plays only once
User plays more than once
Add your pseudo code, processing, inputs/outputs and modules/functions with variables in/out below
Please help with simpliest code for beginner.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started