|Published (Last):||26 December 2015|
|PDF File Size:||14.98 Mb|
|ePub File Size:||13.76 Mb|
|Price:||Free* [*Free Regsitration Required]|
Because this assignment is meant to teach arrays it uses them heavily. Thus create arrays to hold the values of the last roll of dice, to hold the categories which have already been used, and to hold to total and the sub scores. Because they are needed in several methods create them as instance variables. The dice array is filled with each first roll thus it can be initialized with the declaration.
The others are instancialized and thus reset starting a new game. The array holding the used categories differs from the others as it is two dimensional where the rows represent the player and the columns the selected category. The game itself consists of a fixed number of rounds which equals the number of scoring categories.
In every round each player has a fixed number of rolls where the first one differs slightly from the following as all dice have to be rolled. For this category the score needs to be calculated and displayed at the correct position. Depending on the category the upper or lower score has to be updated as well as the total. At the same time add up the face values and check if the given number of a kind has been reached.
For a full house the newly created array needs to be looped, to check if one of the values equals 2 and another one 3.
Tag: assignment #3
cs193p – Assignment #1 Task #5
CS193P ASSIGNMENT 0 PDF