A program that simulate the stuck in the mud game

Assignment Help Computer Engineering
Reference no: EM132206080

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.

• Add voice to the game to report the details of the game for the player. o Pre-recorded computer voices, computerVoices.zip, can be downloaded from moodle. 

o If you have a mic, you can also record your own voice using the Windows Sound Recorder. o MATLAB can play any WMA, MP3, MPEG-4 AAC, WAV, FLAC audio files. [y,Fs] = audioread('fileName.mp3'); % read sound file sound(y,Fs); % play sound file o Additional sound effects are welcome.

• Add voice to greet the player.

• Add voice to ask the player to enter the number of rounds to play.

• Add voice to announce the current round number (i.e., round 1, round 2, and so on...).

• Add voice to announce the current turn (i.e. the player is rolling or the computer is rolling).

• Add voice to announce the current roll number (i.e. roll 1, roll 2, and so on...).

• Add voice to announce each dice rolled.

• Add voice to announce the sum of the score for the current turn after each throw.

• Add voice to announce the number of dice stuck after each throw.

• After one side played, add voice to announce the current total score for the side. For example, 35 points can be announced as three-five.

• After all the rounds are played, add voice to announce the winner or tie.

• Add pause as needed between sentences to ensure one sentence is finished before the next sentence starts.

• Use at least one user-defined function in the program to reduce code repetition.

Reference no: EM132206080

Questions Cloud

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.
Calculate the surface area and volume for cubes : Calculate the surface area and volume for cubes with side lengths of 1, 2, 3, 4, and 5 cm.
Write a matlab program that allows a single player : Write a MATLAB program that allows a single player (the user) to play a simple dice game of chance against "The Odds".
Write a matlab function which uses the gaussian elimination : Write a Matlab function "x = my_ GE(a, b)" which uses the Gaussian Elimination method described in decks to solve Ax = b.

Reviews

Write a Review

Computer Engineering Questions & Answers

  What is the dissimilatries between rfp and rfq

What is the dissimilatries between an RFP and an RFQ? Are they different, or the same? How does RFI associated to them

  Discuss current issues regarding hipaa and sox

Find an article that discusses current issues regarding HIPAA, SOX or other regulations that IT departments need to be aware of in regards to setting.

  Create data objects to store the data to disk

Create data objects to store the data to disk, we chose this method in order to simulate a data access layer in our application.

  Write methods need to implement a deque in a circular array

Write the methods needed to implement a deque in a circular array. Consider the class Deque as derived from the class Queue.

  Write a constructor that initializes these values

Design a class named Person with fields for holding a persons name - Write a constructor that initializes all of these values, and mutator and accessor methods for every field. Next, design a class named Customer, which inherits from the Person cla..

  Describe how a sequential file is searched

suppose a sequential file contains 20,000 records and 2 seconds are required to interrogate an entry. How long will we wait when retrieving a record from the middle of the file?

  Describe the majority of the website visitors

Create three Personas that describe the majority of the website visitors. Persona constraints are listed in the user research document components.

  Questionnbsppart 1-the goal is to design a memory system to

questionnbsppart 1-the goal is to design a memory system to support a small amount of data storage outside of the

  Write report using term switch assessment and requirement

The university presently uses an analog phone system and the administration is looking to deploy voice over IP solution. Before they move forward, they want to ensure that the environment can support the technology.

  Discuss possible motivations for changing data structure

Discuss some possible motivations for changing the tree data structure presented in Discuss whether the change of data structure requires a change of algorithm.

  Define an n-node complete binary tree t

define an n-node complete binary tree T, where n=2^d - 1 for some d. Each node v of T is labeled with a real number x_v. You may assume that the real numbers labeling the nodes are all distinct.

  Create a program that takes in the a year from the user

Extend either the array-based implementation or the linked-list based implmentation of the queue to include a public String toString() method .

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