Your documentation should specify the type and function of the input parameters and output. Make sure that each function is well documented.java files in /home/submit/cs110-s07/username. Turn in a hard copy in class and place a copy of all of your. Complete and submit your working code.Note, if the users both have the same hand, or if neither has a winning hand, they should each get back their original bets. The method will compare the two ThreeDice objects and return a value to indicate the winner. ![]() You should consider implementing a method in ThreeDice that takes a ThreeDice object and a parameter. You will also need to implement a piece of code to compare two hands. Make sure to end the game if the user runs out of credits.įor part 3, you will need to use two instances of ThreeDice to keep track of each user's hand. You will continue to execute those three steps until the user chooses to quit.įor part 2, you will modify your main logic such that it keeps track of the number of credits the user has remaining. Generally, the main logic will be as follows: (1) roll (2) ask the user to specify which dice to reroll and reroll those dice (3) determine and print the hand. You will also implement a Driver that contains the main logic of the program. The three possible hands are pair, three of a kind, and straight. getHand - The getHand method will take no input and will return a value to represent the hand represented by the die data members.display - The display method will take no input and will display the values of the three die data members.The method will reroll the die objects indicated. If the first value is true, the user wishes to reroll die 1, and so on. reroll - The reroll method takes as input three boolean values.Hint: you may want to sort the die objects after you roll all three. roll - The roll method takes no input and will roll each of the die data members.ThreeDice will have (at minimum) the following methods: A straight beats a three of a kind and a three of a kind beats a pair.įor part 1, you will use the Die class from the text book and you will also implement a ThreeDice class that contains three instances of the Die class as its data members. The player with the winning hand will win all of the credits bet. Then, each will roll three dice and then reroll 0-3 of the dice. Each round, both players bet 1-3 credits before the roll. For part 3, you will allow two players to play the game. For a straight, he/she will win 3 credits. ![]() For a three of a kind, he/she will win 2 credits. ![]() If the user does not get a pair, three of a kind, or straight, he/she loses the credit. For part 2, you will give the user 100 credits to begin with. You will then print the user's hand (either pair, three of a kind, or straight). Allow the user to continue to play until he/she says that he/she does not want to play another round.įor part 1, you will allow the user to roll all three dice and then reroll 0, 1, 2, or 3 of the dice. The object of the game is to get a pair (two dice show the same number), three of a kind (all three dice show the same number), or a straight (the numbers showing are in sequence, i.e., 1,2,3). For this project, you will implement a dice poker game. The goal of this project is to give you experience with Java classes, conditionals, and iteration. Project 4 - Dice Poker Project 4 - Dice Poker Due - Monday, April 23, 2007
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |