Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

e can be reused to make things simpler. Where sensible , copy and paste the text from above so that it matches! ( Ware the

e can be reused to make things simpler.
Where sensible, copy and paste the text from above so that it matches! (Ware the spacing though - that's always one that can trip you up.)
You are guaranteed that the computer player has exactly 3 unique, valid cards (so if you're double counting or similar, that means there's a mistake in your code).
A full trace of a game
This is just a playthrough of a game, it has examples of most (hopefully all if I did it right) of the outcomes possible.
Welcome to Sleuth!
Would you like to:
1. Ask a question.
2. Guess a card.
Which option would you like? 1
Which question would you like to ask?
1. How many cards with a certain colour?
2. How many cards with a certain shape?
3. How many cards with a certain number?
4. How many cards with a certain colour and number?
5. How many cards with a certain shape and number?
6. How many cards with a certain colour and shape?
Which option would you like? 1
The colour options are:
1. RED
2. BLUE
3. GREEN
4. YELLOW
Which colour do you want? 1
The player has 3 cards with colour RED.
Would you like to:
1. Ask a question.
2. Guess a card.
Which option would you like? 1
Which question would you like to ask?
1. How many cards with a certain colour?
2. How many cards with a certain shape?
3. How many cards with a certain number?
4. How many cards with a certain colour and number?
5. How many cards with a certain shape and number?
6. How many cards with a certain colour and shape?
Which option would you like? 2
The shape options are:
1. HEXAGON
2. CIRCLE
3. DIAMOND
4. RHOMBUS
Which shape do you want? 1
The player has 3 cards with shape HEXAGON.
Would you like to:
1. Ask a question.
2. Guess a card.
Which option would you like? 1
Which question would you like to ask?
1. How many cards with a certain colour?
2. How many cards with a certain shape?
3. How many cards with a certain number?
4. How many cards with a certain colour and number?
5. How many cards with a certain shape and number?
6. How many cards with a certain colour and shape?
Which option would you like? 3
Enter a number from 1-4(inclusive): 1
The player has 1 cards with number 1.
Would you like to:
1. Ask a question.
2. Guess a card.
Which option would you like? 1
Which question would you like to ask?
1. How many cards with a certain colour?
2. How many cards with a certain shape?
3. How many cards with a certain number?
4. How many cards with a certain colour and number?
5. How many cards with a certain shape and number?
6. How many cards with a certain colour and shape?
Which option would you like? 4
The colour options are:
1. RED
2. BLUE
3. GREEN
4. YELLOW
Which colour do you want? 2
Enter a number from 1-4(inclusive): 4
The player has 0 cards with colour BLUE and number 4.
Would you like to:
1. Ask a question.
2. Guess a card.
Which option would you like? 1
Which question would you like to ask?
1. How many cards with a certain colour?
2. How many cards with a certain shape?
3. How many cards with a certain number?
4. How many cards with a certain colour and number?
5. How many cards with a certain shape and number?
6. How many cards with a certain colour and shape?
Which option would you like? 5
The shape options are:
1. HEXAGON
2. CIRCLE
3. DIAMOND
4. RHOMBUS
Which shape do you want? 2
Enter a number from 1-4(inclusive): 1
The player has 0 cards with shape CIRCLE and number 1.
Would you like to:
1. Ask a question.
2. Guess a card.
Which option would you like? 1
Which question would you like to ask?
1. How many cards with a certain colour?
2. How many cards with a certain shape?
3. How many cards with a certain number?
4. How many cards with a certain colour and number?
5. How many cards with a certain shape and number?
6. How many cards with a certain colour and shape?
Which option would you like? 6
The colour options are:
1. RED
2. BLUE
3. GREEN
4. YELLOW
Which colour do you want? 3
The shape options are:
1. HEXAGON
2. CIRCLE
3. DIAMOND
4. RHOMBUS
Which shape do you want? 2
The player has 0 cards with colour GREEN and shape CIRCLE.
Would you like to:
1. Ask a question.
2. Guess a card.
Which option would you like? 4
That is not an option, try again.
Would you like to:
1. Ask a question.
2. Guess a card.
Which option would you like? dfa
That is not an option, try again.
Would you like to:
1. Ask a question.
2. Guess a card.
Which option would you like? 2
The colour options are:
1. RED
2. BLUE
3. GREEN
4. YELLOW
Which colour do you want? 1
The shape options are:
1. HEXAGON
2. CIRCLE
3. DIAMOND
4. RHOMBUS
Which shape do you want? 1
Enter a number from 1-4(inclusive): 1
The player has the card (1, RED, HEXAGON).
Good guess!
Would you like to:
1. Ask a question.
2. Guess a card.
Which option would you like? 2
The colour options are:
1. RED
2. BLUE
3. GREEN
4. YELLOW
Which colour do you want? 1
The shape options are:
1. HEXAGON
2. CIRCLE
3. DIAMOND
4. RHOMBUS
Which shape do you want? 1
Enter a number from 1-4(inclusive): 1
The player has the card (1, RED, HEXAGON).codin PYHTON

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

Pro SQL Server Administration

Authors: Peter Carter

1st Edition

1484207106, 9781484207109

More Books

Students also viewed these Databases questions