Write a matlab program that allows a single player

Assignment Help Computer Engineering
Reference no: EM132206077

Write a MATLAB program that allows a single player (the user) to play a simple dice game of chance against "The Odds".

1)There is a simple player, with FOUR six sided die.

2)The sides of each die are labeled with the numbers from 1 to 6, we will call this the value of the die

3)A game is made up of round, a single round is played as such:

A)The player rolls their four dice- you may use randi()

B) The dice are displayed, in some reasonable format.

C)The user Is given the option to re-roll (up to two of their dice) and specify exactly with die they wish to re-roll

D)The dice are displayed, in some reasonable format.

E) A determination is made as to whether or not the player won the round, this determination is made via the following rules:

i) A quad is when all the dice have the same number on their top faces. If the player has any quad then they receive 108 "win"s

ii) A triple is when exactly three of the dice have the same number on their top faces. If the player has any triple then they receive 6 "win"s

iii) A two-Pair is when exactly two dice have the number n1 on their top faces, exactly two dice have the number n2 on their top faces, and n1 is not equal to n2. If the player has any teo-pair then they receive 4 "win"s

iv) A junker is then anything that is not listed above. If the player has any Junker then they receive 1 "lose"

4)The player is asked if they wish to play another round

5)Once the player indicates that they do not wish to play another round: Before exiting, the program displays a short report stating how many rounds were played, of those - how many were won and how many were lost.

NOTES: you will need to use the

<var> = randi ([1,6],1);

To assign <var> a random die roll value

Reference no: EM132206077

Questions Cloud

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.
Take a matrix as an input and returns a vector : Write a MATLAB function that takes a matrix as an input and returns a vector that contains the number of rows and columns in the matrix.
Implement the computer program : Create a computer program that allows a user to enter items that are able to be recycled into a machine. During the process the machine prompts the user
What would you to detect and remove the threat : Your system has been compromised. What would you to detect and remove the threat. This is a zero day attack, so there is no "commercial" solution.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Access a library card catalog using sql

Imagine that you must access a library card catalog using SQL. Write an SQL query that you would use to search for any book

  Use java to write the programs1 write a program that uses

use java to write the programs1. write a program that uses the brute-force approach to solve the 01 knapsack problem.

  What is a mission statement and what is a vision statement

What is a mission statement What is a vision statement What is a values statement Why are they important

  Write a simplified version of a http client and server

Write a simplified version of a HTTP client and server. The client program will use the HTTP protocol to download a file from the server using HTTP GET method.

  Compare the merits and demerits of atm to those of frame

atm and frame relay. please respond to the followingcompare the advantages and disadvantages of atm to those of frame

  Design a class to represent a playing card

Design a class to represent a playing card. Now design a class to represent a deck of cards. Using these two classes, implement a favorite card game.

  What type of sampling technique will you use and why

What type of sampling technique will you use and why? What may be the demographic characteristics of your sample? Identify potential data collection techniques and justify your choice.

  You are working on a new web site for cruzes inc the web

you are working on a new web site for cruzes inc. the web site is aimed at providing travel information to consumers

  How can technology be used for a greater social good

How can technology be used for a greater social good? Is technology inherently bad or good? Argue two points.

  What is the combined noise figure of the antenna

What is the combined noise figure of the antenna and first two stages of the radio? If the baseband processing of the radio requires an SNR of 9 dB in 5 kHz.

  Determine and plot the mean-square distortion

On the same figure that you plotted in Problem, plot the mean-square distortion when the quantization levels are taken to be the centroids of the quantization.

  What year produced the most pounds of fish

What year produced the most pounds of fish? What was the amount of fish in that year? Display the top 5 revenue producing industries (Herring, Cod, etc)?

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