Implement a game called Bunko-Poker. The gameplay is an easily programmed version of the popular game Yahtzee. Your program will make use of the supplied static functions Dice.roll() and, in cases where you might need the string ordered, Dice.ordered(String), to perform the operation of "throwing the dice". You will have to construct your code so that it will simulate a complete game of Bunko-Poker.
In the game of Bunko-Poker, you roll the dice first looking for ones. If one or more of the five dice are a one, then you add up the number of ones. This total is the initial "hand score". You then take the "hand" and look for poker-style hands (described in the table below). If you have any of the poker hands, you will modify the hand score by the appropriate value from the table below. The resulting score is your adjusted hand score for that particular roll of the dice. You roll again and if you get ones again, you repeat the procedure and add the adjusted hand score for this roll to the adjusted hand score from the prior roll to get your total score. If you do not get a one, then you move on to twos. You roll again and if you get twos, you add them up and then repeat the procedure to calculate the adjusted hand score. You keep rolling for a particular number until you roll the dice and do not get that number (the example run below will help clarify this). You keep repeating the procedure until you complete rolling for sixes.
Hand Name Sample Dice Roll Example Dice String Hand Score ModificationFive of a Kind 4 4 4 4 4 44444 + 100Straight 1 2 3 4 5 12345 + 80Small Straight 1 2 3 4 6 12346 + 70Four of a Kind 3 5 5 5 5 35555 + 60Full House 4 4 1 1 1 44111 + 50Three of a Kind 4 4 4 2 3 44423 + 30Two Pair 4 4 2 2 5 44225 + 20Pair 3 3 2 4 6 33246 + 10Nothing 1 2 3 5 6 12356 + High Card
You should make heavy use of methods in your program. All of your method definitions should follow the main method. Private boolean methods (each taking a String argument) should be used to defined and utilized to determine what poker hands you have:
- fiveOfAKind straight smallStraight fourOfAKind fullHouse threeOfAKind twoPair pair