Your task for this is to develop some of the functionality required to
help play the game of Yahtzee on a computer. you will finish off the
entire game so that you will have a fully playable version of computer
Yahtzee.
As such, you will be required to develop some functions to satisfy
specific requirements, and to develop a test harness that will allow
you to test and demonstrate the functions.
Your program should contain the following :
1. Arrays and Data Types :
a. Score_Category : an enumerated type which contains each of the 13
possible scoring categories along with items for the various bonus,
sub-total, and grand total categories.
b. An array of the scores achieved for each scoring category.
c. An array to determine which scoring categories have been used in
the current game.
d. An array to contain the values of the 5 dice thrown for a
particular roll of the dice.
2. Display_Score_Category : a function to display a meaningful
description for each item in the Score Category enum.
3. Display_Score_Board : a function to display the current score in
each scoring category (along with the various sub-totals and totals
for the current game), and the values of the 5 dice thrown for the
current turn. For example :
************************************************************
** Mike's Y A H T Z E E Challenge **
************************************************************
1. Ones 1 10. Small Straight 30
2. Twos 11. Large Straight 40
3. Threes 6 12. Yahtzee
4. Fours 13. Chance
5. Fives Bonus 0
6. Sixes 18 Upper Total 25
7. 3 of a Kind Lower Total 70
8. 4 of a Kind Grand Total 95
9. Full House
The 5 dice are :
1 2 3 4 5
----- ----- ----- ----- -----
| 1 | | 4 | | 4 | | 4 | | 4 |
----- ----- ----- ----- -----
4. Sum_All_5_Dice : a function to return the sum of the values of all
5 dice.
5. Calculate_Score : a function to calculate the score based on the
values of the 5 dice for the selected Scoring Category. This function
also calculates the various bonus, sub-totals, and grand total for the
current game. For this assignment, this function should assume that
the dice are sorted in ascending order.
In addition to the above, you should also develop a main program to
call the above functions (and any other relevant functions that you
develop) to provide a test harness so that you can thoroughly test and
demonstrate the above functions. Your main program should ensure that
the dice are sorted in ascending order before calling the
Calculate_Score function. (See "Test Harnesses" below for further
information).
All of this code should be brought together within a DOS standard or
EasyWin EXEcutable or Windows Console Project.
Note: Answer is needed 10 hours if u could do thid, otherwise pls do
not do this question, thanks |