Print any stuck in the mud dice values on screen

Assignment Help Computer Engineering
Reference no: EM132206083

Assignment

Write a MATLAB program to simulate the Stuck in the Mud game that can:

1. Use five (5) 6-sided dice to play the Stuck in the Mud game for any player, from rolling five (5) dice to all five (5) dice stuck in the mud.

2. Generate five (5) random integers between 1 and 6 to represent the face value of rolling five dice.

3. Print the five (5) dice values on screen.

4. Check for 2s and 5s from this roll. If the roll contains any 2 or 5, no points for this throw.

5. If there is no 2s or 5s, add up the total dice value to be the score of this roll.

6. Set aside any 2s and 5s.

7. Print any stuck in the mud dice values on screen.

8. Print the game score on screen.

9. Print the number of dice stuck in the mod on screen for tracking.

10. Throw the remaining dice.

11. Print the remaining dice values on screen.

12. If the remaining dice contain any 2s or 5s, no score for this throw.

13. Throws without 2s and 5s are added to the previous score.

14. Set aside any new 2s and 5s with the existing 2s and 5s.

15. Print all the currently stuck in the mud dice values on screen.

16. Print the game score on screen.

17. Print the number of dice stuck on screen.

18. Repeat steps 10 through 17 until all five (5) dice are stuck in the mud.

19. Add code to track the number of rolls automatically played for the player.

20. Add a print statement to indicate when a throw happens with the roll number.

The finished program can look like the following example. Extra components are always welcome.

ROLL 1
Rolling: 4 4 3 1 2
Stuck in the mud: 2
Game score: 0
Number of dice stuck: 1
ROLL 2
Rolling: 4 6 6 4
Stuck in the mud: 2
Game score: 20
Number of dice stuck: 1
ROLL 3
Rolling: 5 2 1 1
Stuck in the mud: 5 2 2
Game score: 20
Number of dice stuck: 3
ROLL 4
Rolling: 4 3
Stuck in the mud: 5 2 2
Game score: 27
Number of dice stuck: 3
ROLL 5
Rolling: 1 6
Stuck in the mud: 5 2 2
Game score: 34
Number of dice stuck: 3
ROLL 6
Rolling: 6 4
Stuck in the mud: 5 2 2
Game score: 44
Number of dice stuck: 3
ROLL 7
Rolling: 3 5
Stuck in the mud: 5 2 5 2
Game score: 44
Number of dice stuck: 4
ROLL 8
Rolling: 1
Stuck in the mud: 5 2 5 2
Game score: 45
Number of dice stuck: 4
ROLL 9
Rolling: 5
Stuck in the mud: 5 2 5 5 2
Game score: 45
Number of dice stuck: 5

Reference no: EM132206083

Questions Cloud

Write a matlab script utilizing an if-else statement : Write a MATLAB script utilizing an IF-ELSE statement that asks for the user to enter a whole number.
Write a matlab script file to perform the task : Name your file Midterm.m and submit to the Midterm dropbox on E360 when complete. Define a vector V=rand(1, 100).
Calculate and print out the squares of all the even integers : Write the MATLAB program using loops required to calculate and print out the squares of all the even integers between 0 and 50.
Write a method which will accept two parameters : Write a method which will accept 2 parameters. Each parameter is an array of doubles. The arrays are of equal length.
Print any stuck in the mud dice values on screen : Use five (5) 6-sided dice to play the Stuck in the Mud game for any player, from rolling five (5) dice to all five (5) dice stuck in the mud.
Take an array of strings and a target string and returns : Write a method countStrings that takes an array of Strings and a target String and returns the number of occurrences target appears in the array.
Design parameters obtained by running the matlab program : For each type of antenna provide the Matlab program and the design parameters obtained by running the Matlab program.
A program that simulate the stuck in the mud game : The program should accurately play the number of rounds specified by the user. The player and the computer play in turns for each round.
Determine the minimum and maximum value of an array : Write a MATLAB program that will determine the minimum and maximum value of an array along with the index of the minimum and m aximum values.

Reviews

Write a Review

Computer Engineering Questions & Answers

  An algorithm to print different ways of arranging 8 rooks

Write an algorithm to print different ways of arranging 8 rooks on a chess board, so that none of them share the same row or column.

  Difference between a canned report and an ad hoc reporting

What is the difference between a canned report and an ad hoc reporting? List and discuss the key areas where businesses are leveraging data mining.

  What can we add to the package table so we know

What can we add to the Package table so we know which PostOffice it's in?

  Determine heat transfer rate from the can surface

A can of engine oil with a length of 150 mm and a diameter of 100 mm is placed vertically in the trunk of a car.

  What is your understanding of the term computer

What is your understanding of the term "computer"? Why do we call it computer? Is that what it does? The response must be typed.

  How many parts are in the warehouse at the end of february

At the end of June your checkbook balance is $356. During July you wrote $503 in checks and deposited $120. What is your balance (accumulation).

  What languages should a developer be able to use

In addition to HTML, what languages should a developer be able to use (through knowledge or through tools) in order to create dynamic and interactive websites?

  How many bits would the tag field be in this case

Assume 64-bit addresses and the layout from chapter 4. How many bits would the tag field be in this case?

  Write a program that takes as input a fully parenthesized

Write a program that takes as input a fully parenthesized, arithmetic expression and converts it to a binary expression tree.

  Draw the first seven rooted fibonacci trees

How many vertices, leaves, and internal vertices does the rooted Fibonacci tree T_n have, where n is a positive integer? What is its height?

  Discuss the steps that should be tried when experiencing a

1. discuss the steps that should be tried when experiencing a network connection problem2. explain what a broadcast

  Program for generate 100 random integer numbers ranging

Store these numbers in a data structure of your choice and display the data on the screen. DO NOT SORT THIS DATA STRUCTURE.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd