public class Yahtzee extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
isFiveOfAKind(List<Die> dice)
Returns
true if the list contains a five of a kind. |
static boolean |
isFourOfAKind(List<Die> dice)
Returns
true if the list contains a four of a kind. |
static boolean |
isFullHouse(List<Die> dice)
Returns
true if the list contains a full house. |
static boolean |
isLargeStraight(List<Die> dice)
Returns
true if the list contains a large straight. |
static boolean |
isSmallStraight(List<Die> dice)
Returns
true if the list contains a small straight. |
static boolean |
isThreeOfAKind(List<Die> dice)
Returns
true if the list contains a three of a kind. |
public static boolean isThreeOfAKind(List<Die> dice)
true
if the list contains a three of a kind.
A three of a kind is defined as at least three dice having the same value.
The list is guaranteed to remain unchanged.
dice
- list of dicedice.size() == 5
true
if the list contains a three of a kindpublic static boolean isFourOfAKind(List<Die> dice)
true
if the list contains a four of a kind.
A four of a kind is defined as at least four dice having the same value.
The list is guaranteed to remain unchanged.
dice
- list of dicedice.size() == 5
true
if the list contains a four of a kindpublic static boolean isFiveOfAKind(List<Die> dice)
true
if the list contains a five of a kind.
A five of a kind is defined as all five dice having the same value.
The list is guaranteed to remain unchanged.
dice
- list of dicedice.size() == 5
true
if the list contains a five of a kindpublic static boolean isFullHouse(List<Die> dice)
true
if the list contains a full house.
A full house is defined as having two dice of the
same value and three dice of the same value.
The list is guaranteed to remain unchanged.
dice
- list of dicedice.size() == 5
true
if the list contains a full housepublic static boolean isSmallStraight(List<Die> dice)
true
if the list contains a small straight.
A small straight is defined as at least four dice in sequential order.
The list is guaranteed to remain unchanged.
dice
- list of dicedice.size() == 5
true
if the list contains a small straightpublic static boolean isLargeStraight(List<Die> dice)
true
if the list contains a large straight.
A large straight is defined as five dice in sequential order.
The list is guaranteed to remain unchanged.
dice
- list of dicedice.size() == 5
true
if the list contains a large straight