Simulate the stuck in the mud game with additional features

Assignment Help Computer Engineering
Reference no: EM132138054

Stuck in the mud is a popular dice game in UK. The game uses five (5) 6-sided dice to play. The players play in turns.

Choose one player to start the game. The player will roll all five (5) dice. If the player rolled any 2s or 5s, the player does not score any points for this throw.

The player can only score on a roll which does not include the number 2 and 5. Any dice with a 2 or a 5 becomes stuck in the mud. If this throw does not contain any 2s or 5s, the score is incremented by the sum of the dice values.

The player needs to set aside any 2s and 5s and throw the remaining dice. Again, if any 2s or 5s are rolled, the score will not be incremented for this throw.

Throws without 2s and 5s are added to the previous total score. Continue in this way until all the dice are stuck. Save the score and pass the dice to the next player.

Players can agree a total number of rounds to play in advance. Total up the score. The player with the highest score wins the game. The following link contains the detail game description

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

• Use five (5) 6-sided dice to automatically play the Stuck in the Mud game against a player.

• Greet the player when the game starts.

• Let the player to choose the number of rounds to play. Take care of the user input to ensure the program will not crash with inputs like 0, 1.2, -1, 999, and so on...

• The program should not play if the user enters a 0 or any negative value.

• The program should accurately play the number of rounds specified by the user. The player and the computer play in turns for each round.

• The program can always pick one side to start the game first, either the player side or the computer side. Randomly pick a side to start the rotation is optional.

• Print the current round number clearly in the command window.

• If the player side starts first, the program will automatically roll all five (5) dice for the player. If the player rolled any 2s or 5s, the player does not score any points for this throw.

The player can only score on a roll which does not include the number 2 and 5. Any dice with a 2 or a 5 becomes stuck in the mud. If this throw does not contain any 2s or 5s, the score is incremented by the sum of the dice values. The player needs to set aside any 2s and 5s and throw the remaining dice. Again, if any 2s or 5s are rolled, the score will not be incremented for this throw. Throws without 2s and 5s are added to the previous total score. Continue in this way until all the dice are stuck.

• The dice rolled for the player, the stuck dice, and the scores during the process should clearly be printed in the command window.

• The program then automatically roll all five (5) dice for the computer. Follow the game rules until all five (5) dice are stuck.

• The dice rolled for the computer, the stuck dice, and the scores during the process should also be clearly printed in the command window.

• Accurately track the total scores for the player and the computer.

• After all the rounds have been played, select a winner based on the highest total score. It is also possible that the game ends in a tie.

Reference no: EM132138054

Questions Cloud

Create and print the detention code of each class : Create classes, methods, and design icons for their mobile device application using OOP language and GUI. The following must be included.
What is the difference between arrays and lists : What is the difference between arrays and lists? What are the pros and cons of storing data in arrays and/or lists?
What is the probability that a randomly selected car : What is the probability that a randomly selected car is violating the speed limit of 50 miles per hour?
What is the probability that 6 home runs : In a single? season, an average of 2.4 home runs were hit per game. Assume the number of home runs per game follows the Poisson distribution.
Simulate the stuck in the mud game with additional features : Write a MATLAB program to simulate the Stuck in the Mud game with additional features.
Find the probability that the number is more than 8 : Find the probability that the number is more than 8 (second answer listed below).
What is the probability that at least : If you select 31 customers, what is the probability that at least 25 of them have looked at their score in the past six months?
Write the above statements as formal statements : (i) Write the above statements as formal statements about the events A, B and C, either in terms of probabilities.
Generate a new matrix comp with the same number-matlab code : You are studying the number of defective parts produced each week by several machines to help adjust maintenance protocols.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Write a query to show the number of orders for each shipper

Write a query to show number of products in each product category. Your query should show Category name and number of products in that category.

  Describe concept of interaction design

One of your colleagues who is not familiar with Interaction Design. Explain and describe concept of Interaction design to him or her. Please add appropriate details and examples with applicable references in APA style.

  Linked list based linear search algorithm

Write down an algorithm or the code segment for searching a circular linked list for a given item. Write down a recursive version of the linked list based linear search algorithm.

  What is the cell reuse distance

What is the cell reuse distance for a 15 km cell radius with a k=6?

  Explain why pci compliance is so important

Explain why PCI Compliance is so important? What are the implications for companies that are are not PCI compliant?

  Sample size and sampling interval determination

Sample Size and Sampling Interval Determination: Monetary Unit Sampling. Blythe Drake is conducting an audit of Newman and is using MUS to select a sample.

  Define word and long word memories

Define word and long word memories in the MC68000 to include the hard alignment constraints by modifying the RTN on page 99.

  A word document with another office-type document

A compound document within Microsoft Office usually consists of a Word document with another office-type document (i.e. Excel, PowerPoint slideshow, etc.) within the Word document.

  Which model is designed to find the best solution

Expected values are computed by multiplying. Which model is designed to find the best solution from a large number of possible alternatives using a step-by-step process?

  Develop recommendations for the tims system architecture

Develop recommendations for the TIMS system architecture. Include an overall client/server design, number of tiers, and network topology.

  Analyze the general transition of us health laws based on

1.from the scenario differentiate between the concepts of criminal law antitrust and health care as they apply to

  Examine the concept of privacy and its legal protections

Examine the concept of privacy and its legal protections, Identify risk analysis and incident response procedures

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