Question
write a program to host a game of Three Questions. This game plays just like its big sibling, 20 Questions, but with a key (shocking!)
write a program to host a game of "Three Questions." This game plays just like its big sibling, "20 Questions," but with a key (shocking!) difference: 17 fewer questions.
Write a function called "play_game" that will use "prompt", "confirm", and/or "alert" to interact with the user and ask its questions
The game starts with the computer telling the human player to think of an item. The program will then ask a series of yes-or-no questions, culminating with a guess about what item the player has in mind. The series of questions should always make sense. If the player says their item is not alive, the program shouldn't follow up by asking if it's a mammal. Here's how the game might proceed:
Is it alive? > Yes
Is it an animal? > No
Is it broccoli? > Yes
Computer wins!
Is it alive? >
No Is it metal? >
Yes Is it a red 1966 Ford Mustang? > No
Computer loses...
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