Write a matlab program to simulate the stuck in the mud game

Assignment Help Computer Engineering
Reference no: EM132206481

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: 1 3 1 2 1
Stuck in the mud: 2
Game score: 0
Number of dice stuck: 1
ROLL 2
Rolling: 1 2 2 1
Stuck in the mud: 2 2 2
Game score: 0
Number of dice stuck: 3
ROLL 3
Rolling: 5 3
Stuck in the mud: 5 2 2 2
Game score: 0
Number of dice stuck: 4
ROLL 4
Rolling: 5
Stuck in the mud: 5 2 2 2 5
Game score: 0
Number of dice stuck: 5

Reference no: EM132206481

Questions Cloud

Define barriers to collecting a comprehensive health history : What are the barriers you face to collecting a comprehensive health history so that you can give culturally-competent care?
Prepare a statement of cash flows for 2008 : How much will each deposit have to be if you want to meet your financial goals - prepare a statement of cash flows for 2008. Assume that there were no changes
Calculate OCFs for this project : Project X involves a new type of graphite composition in-line skate wheel. Calculate OCFs for this project. What is the project's IRR
Evaluate community demographic and environmental data : Evaluate community demographic, epidemiological, and environmental data. Describe the major community health concerns suggested by the data.
Write a matlab program to simulate the stuck in the mud game : 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.
Prepare the managerial accounting : For this Finance and Managerial Accounting assignment also required Executive Summary and conclusion - prepare the Managerial Accounting Q1 part(i), Q1 Part
What is the required rate of return on dodger corp : You have just been given the following information on Dodger Corp and the S&P 500. What is the required rate of return on Dodger Corp
Write a code to count how many elements are less than : Write a MATLAB script file to perform the task described below. Name your file Midterm.m and submit to the Midterm dropbox on E360 when complete.
Write a code to count how many elements are greater : Write a MATLAB script file to perform the task described below. Name your file Midterm.m and submit to the Midterm dropbox on E360 when complete.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Explain how heat transfer from heat sink will be affected

Consider a heat sink with optimum fin spacing. Explain how heat transfer from this heat sink will be affected by removing some of the fins on the heat sink.

  Write a mips assembly language program

The program should enforce the rule that the two entered integers must be in the interval [50, 500]. If the entered integer is not in the specified range, prompt again the user to enter an integer in the specified range.

  Calculate an average of the five running times

Display five running times measured for both sorting methods. Calculate an average of the five running times for both and display them.

  Determine how far a car may be driven based on the capacity

Develop a process that will determine how far a car may be driven based on the capacity of the gas tank in gallons and the fuel economy.

  Point out the physical memory location corresponding to the

a computer system with 16k of memory a memory management unit with a page size of 2000 and the following page

  Nbspthe last stop boutique is having a five-day sale each

nbspthe last stop boutique is having a five-day sale. each day startingnbspon monday the price will drop 10 of the

  Write a short performance requirement for the application

Write a short performance requirement for the application. Explain why it is important to write a good performance requirement and what constitutes good.

  Give an example of a useful class

Visual Basic.NET allows you to make your own classes. Provide an example of a useful class you could create. What methods and properties would you include? Show an example of a method declaration for your class.

  Identify the state actors and non-state actors

Identify the state actors and non-state actors that pose the greatest cyber threat to the United States and justify your selections

  Why is a queue of books a better choice than a stack

A grade book application stores a collection of quizzes. Why is a queue of books a better choice than a stack for organizing your required reading?

  Write a program that can be used by a concert hall

Write a program that can be used by a concert hall to sell tickets for performances. The auditorium has 15 rows of seats, with 30 seats in each row.

  Create a sum called s2 that adds up all the terms

Program a FOR loop for the index i varying from 2 to n to create a sum called s1 that adds up all the terms in the form of 1/i^d.

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