Develop and implement an interactive two-player yahtzee game

Assignment Help C/C++ Programming
Reference no: EM132107385

Programing for C++

Develop and implement an interactive two-player Yahtzee game. Yahtzee is a dice game that was invented by Milton Bradley and Edwin S. Lowe in 1956.

The challenge of the game is to outduel the other player by scoring the most points. Points are obtained by rolling five 6-sided die across thirteen rounds. During each round, each player may roll the dice up to three times to make one of the possible scoring combinations.

Once a combination has been achieved by the player, it may not be used again in future rounds, except for the Yahtzee combination may be used as many times as the player makes the combination. Each scoring combination has different point totals. Some of these totals are achieved through the accumulation of points across rolls and some are obtained as fixed sequences of values.

The Rules of Yahtzee:

The scorecard used for Yahtzee is composed of two sections. A upper section and a lower section. A total of thirteen boxes or thirteen scoring combinations are divided amongst the sections. The upper section consists of boxes that are scored by summing the value of the dice matching the faces of the box.

If a player rolls four 3's, then the score placed in the 3's box is the sum of the dice which is 12. Once a player has chosen to score a box, it may not be changed and the combination is no longer in play for future rounds.

If the sum of the scores in the upper section is greater than or equal to 63, then 35 more points are added to the players overall score as a bonus. The lower section contains a number of poker like combinations. See the table provided below:

Name

Combination

Score

Three-of-a-kind

Three dice with the same face

Sum of all face values on the 5 dice

Four-of-a-kind

Four dice with the same face

Sum of all face values on the 5 dice

Full house

One pair and a three-of-a-kind

25

Small straight

A sequence of four dice

30

Large straight

A sequence of five dice

40

Yahtzee (think five-of-a-kind)

Five dice with the same face

50

Chance

May be used for any sequence of dice; this is the catch all combination

Sum of all face values on the 5 dice

What is required for this assignment?

You may design the Yahtzee game with functions that you see fit. I recommend that you start with a structure chart and determine sub-problems and functions accordingly. You must also take advantage of applying pointers, output parameters, and/or arrays! Your Yahtzee game must also implement the following algorithm:

(1) Print a game menu for Yahtzee with the following options:

            1. Print game rules

            2. Start a game of Yahtzee

            3. Exit

(2) Get a menu option from the user; clear the screen

(3) If option 1 is entered, then print the game rules stated above and repeat step (1)

     otherwise if option 2 is entered, then continue on to step (4); player 1 starts the game

     otherwise if option 3 is entered, then print a goodbye message and quit the program

     otherwise repeat step (1)

(4) Ask the player to hit any key to continue on to roll the five dice

(5) Roll the five dice and display the face values of each die; enumerate each die with

     a number 1 - 5; add 1 to the total number of rolls for this round

(6)  If the total number of rolls for this round is less than three,

         then ask the player (Y/N) if he/she wants to use the roll for one of the game combinations

     otherwise a combination must be selected.

            1. Sum of 1's        7. Three-of-a-kind

            2. Sum of 2's        8. Four-of-a-kind

            3. Sum of 3's        9. Full house

            4. Sum of 4's        10. Small straight

            5. Sum of 5's        11. Large straight

            6. Sum of 6's        12. Yahtzee

                        13. Chance

(7) If the number of rolls is three or "yes" is entered, then save the combination and it may not be selected again in the future

          (Note: The selection of the combination must be verified. If the user selects full house, but does not have one, then your

           must assign 0 points for the combination);

          continue on to step (8); clear the screen

     otherwise if "no" is entered, ask the user which dice to re-roll (1 - 5); re-roll the selected die or dice; clear the screen;

         repeat step (6)

     otherwise repeat step (6)

(8) Alternate players

(9) If each player has rolled for the round, then increment the round number

         if the round number is equal to 14, then continue on to step (10)

         otherwise repeat step (4)

     otherwise repeat step (4)

(10) If the total score in the upper section is greater than or equal to 63 for a player, then add 35 points to the total score

(11) Print the scores for both players and print the winner

(12) Repeat step (1)

-Your project must contain one header file (a .h file), two C source files (which must be .c files), and project workspace.

Reference no: EM132107385

Questions Cloud

Number of dots on the uppermost faces : A pair of dice is tossed and the number of dots on the uppermost faces are observed. Let X denote the random variable defined as the larger of the two numbers.
Create a person gui where the application read person file : Create a Person GUI where the application read your Person file when launching the interface.
A program to write the graph information to the screen : The first line of the file contains two integers n and m, which indicates the number of vertices and the number of edges on the graph, respectively.
What does this tell you about the shape of this distribution : The mean of this data was found to be 42, while the median was 37. What does this tell you about the shape of this distribution
Develop and implement an interactive two-player yahtzee game : Develop and implement an interactive two-player Yahtzee game. Yahtzee is a dice game that was invented by Milton Bradley and Edwin S. Lowe in 1956.
What is the monthly reach of people 13 of facebook : The U.S. population of people 13 + is 252,904,000. Expressed as a percentage, what is the monthly reach of people 13 + of Facebook?
What is combined reach : You are advertising on two television programs that achieve the reach percentages listed. What is their combined reach?
To accept numbers of integers entered at command line : This is an imcomplete code of a C# program which is supposed to accept any numbers of integers entered at the command line and display their sum.
Using line residuals are calculated : Using Line #1, residuals are calculated and they do not sum to 0. Using Line #2, residuals are calculated and they do sum to 0.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Help process applicants for a graduate degree in engineering

In this project, you will build a program used by an admissions office to help process applicants for a graduate degree in engineering.

  Research paper on arrays and use single dimension arrays

Create codes for the following problem/s. Compile, test run, and edit them if necessary. Include your original .cpp and related file(s) (if any) in a single folder. Compress (zip) the folder and submit the single zipped folder.

  Design and code a swing gui to translate text

Design and code a Swing GUI to translate text that is input in English into Pig Latin. You can assume that the sentence contains no punctuation.

  Determine an appropriate functional decomposition

Create structure charts for a problem and determine an appropriate functional decomposition or top-down design from a structure chart

  Write a program to create 100 real random numbers

Write a program to create 100 real random numbers and store it into a 1-D array. Find the value 1413 from the stored data and print out the value 1413 and the index of the array to the screen

  Write a program that reads numbers from the keyboard

Write a program that reads numbers from the keyboard into an array of type int []. You may assume that there will be 50 or fewer entries in the array.

  By a minimal interpretation that makes a formula

By a minimal interpretation that makes a formula true, we mean that if one atom is removed from the interpretation then the resulting interpretation does no longer make the formula true.

  Deadlock recovery system for transactions

Assume you are responsible for architecting a deadlock recovery system for transactions. In the case that there is some dependency cycle that has produced a deadlock with n >= 2 transactions, how will your recovery system determine which transacti..

  Determine how long the match goes on

Determine how long the match goes on (it might be just N bytes long, or it might extend past the first N matching bytes to be many bytes longer).

  Calculate the task start and finish times

Using the chart given in the attachment(Personnel_Shortfall.docx), with durations shown in weeks, if there are 16 total people available for the project (assume all 16 are qualified to work on any of the tasks and assume all tasks start and finish..

  Write a function that will take in an array of integers

Write a function that will take in an array of integers, sum up all the values in the array, and return the result to the calling function.

  Perform ticket bookings for various flights

The development team of SoftSols Inc. analyzes the source code of the existing software and notes the following observations: The software contains a private class, named bookTickets, that contains the methods used to perform ticket bookings for va..

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