Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

how it should look like write a code that can play this game automatically (computer chooses numbers rather than the user), goal is for computer

image text in transcribed

how it should look like

image text in transcribed

image text in transcribed

write a code that can play this game automatically (computer chooses numbers rather than the user), goal is for computer to cross out as many numbers as he can

Write a MATLAB program to simulate the Shut the Box game that can: 1. 2. 3. Use two (2) 6-sided dice to interactively play the Shut the Box game for one player Print a number strip from 1 through 12 in the command window Generate two (2) random integers between 1 and 6 to represent the face value of rolling two dice 4. Print the two (2) dice values on screen 5. Sum the dice value and print the sum on screen for the player 6. ask the computer to decide which numbers to cross out. the computer can decide to cross out multiple number as long as the sum of the numbers equals sum of dice 7. Print all the crossed out number(s) on screen 8. Print all the open numbers on screen. 9. The game should keep rolling dice, printing the dice, summing the dice, printing the sum, asking the player to cross out number(s), printing all the crossed numbers, and printing all the open numbers on screen, until the player can no longer cross out any number to create a sum as same as the sum of the dice. 10. If the player cannot cross out any number, the player simply presses the Enter key without providing any number 11. When the player presses the Enter key without any number, the game should end. 12. If the numbers above six are all closed, the game should automatically roll only 13. After the game ends, compute the player's score by summing all the open 14. Print the score for the player in the command window one of the dice numbers together

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

Database Design Query Formulation And Administration Using Oracle And PostgreSQL

Authors: Michael Mannino

8th Edition

1948426951, 978-1948426954

More Books

Students also viewed these Databases questions

Question

Organizing Your Speech Points

Answered: 1 week ago