Recitation Class ix
Recitation Class IX
Content Style Pointer
Content n Style n Pointer
Style Some examples in Yahtzee Graphies Yindow ☒ File Edit Help Roll Dice Categories 1 2 Ones Twos Threes Fours Fives Sixs Upper Score Upper Bonus (35) Three of a Kind Four of a Kind Full House (25) Small Straight (30) Large Straight(40) Yahtzee!(50) ? Chance Lower Score TOTAL 1's turn!Click"Roll Dice"button to roll the dice
Style n Some examples in Yahtzee
#include <vg101class.h> Example 1 #include“assignment6,h“ using namespace std: /Constant definition * #define MAX_PLAYER 4 #define江加13 #define SELECTABLE -1 #define MAX_DICE 5 #define ITEMS 17 #define YAHTZEE_POINT 50 #define LARGE_STRAIGHT_POINT 40 #define SMALL_STRAIGHT_POINT 30 #define FULL HOUSE_POINT 25 #define FOUR OF A KIND 4 #define THREE OF A红D3 #define YAHTZEE 5 #define FIRST_DICE 0 #define SECOND_DICE 1 #define MIDDLE DICE 2 #define FOURTH DICE 3 #define FIFTH DICE 4 #define LARGE STRAIGHT 5 #define SMALL_STRAIGHT 4 #define DICE MAX 6 #define MINIMIZE_BONUS_POINT 63 #define BONUS POINT 35 #define RECORD_NUMBER 10 #define NAME_LONGEST 10 #define TITLE_POINT 18 #define LIST POINT 15 #define NUMBER LLX 1 #define HALF 2 #define NAME LLX 2 #define SCORE_LLX 5 #define TITLE_LLY 3.5 #define LIST LLY START 3 #define LIST_LLY_BETWEEN 0.25 /Put your function prototype here * /global data obiects defined for vou
Example 1
KandomT randlice: Example 1 //RandomT randDice(0): YahtzeeGraphicsAppT gameWindow (7.0,4.5): /Main Function //getInfo()is used to get the information static void getInfo(string name[],int AnPlayer): //rollDice is used to get the random points of five dices static void rollDice(int diceArray[]): /*initial(bool....)is used to turn all players'boolen of all categories to false *and this would bu useful to prevent user to choose a category whitch has been chosen 米 static void initial (bool blnCategory[][13]): /*initial(int....)is used to innitialize all scores to 0*/ static void initial(int score[][17]); /*reRoll is used to reRoll the categories chosen by user*/ static void reRoll(bool blnFixedDice[],int diceArray[]): /*getScoreO is used to get the score of a certain category*/ static int getScore(int diceArray[],categoryT category): //getScoreUp O is used in the function getScore.It is used to return the Upper scores static int getScoreUp (int diceArray[],categoryT category): //getScoreDown()is used in the function getScore.It is used to return the Lower scores static int getScoreDown(int diceArray[]): /*the following 4 functions are used to simplify the play0 function. *the play()function has been divided into 5 major parts. *these functions are signed by "G"at last. static void rollDiceG(int player,string name[],int diceArray[],bool blnFixedDice[]): static void checkCategoryG(int player,categoryT &category,bool blnCategory[][13]): static void UpdateScorecardG(int player,categoryT &category,int diceArray[],int score[][17]): static void doBonusG(int score[][17],int nPlayer): static void showResult (int score[][17],string name[]): woid main (void) gameWindow.initGraphics ( gamewindow.play 0:
Example 1