Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial And Temporal Databases 10th International Symposium Sstd 2007 Boston Ma Usa July 2007 Proceedings Lncs 4605

Authors: Dimitris Papadias ,Donghui Zhang ,George Kollios

2007th Edition

3540735399, 978-3540735397

More Books

Students also viewed these Databases questions

Question

1. Which is the most abundant gas presented in the atmosphere?

Answered: 1 week ago