|
||||||||
PREV NEXT | FRAMES NO FRAMES |
Die
- an n-sided die with given integer values.Die
instance with the given integer outcomes.
Die
with a given number of sides and an incremental sequence of values beginning with a given minimum value.
Die
instance with the default values: 1, 2, 3, 4, 5, 6.
GOAL_SCORE
- the goal score of Pig (usually 100).
HoldAt20PigPlayer
- a Pig player that rolls as long as the turn total is less than 20 and the player's score plus the turn total is less than the goal score PigGame.GOAL_SCORE
.isRolling
- return whether or not the player rolls, given the current game state.
isRolling
- return whether or not the player rolls, given the current game state.
isRolling
- return whether or not the player rolls, given the current game state.
main
- randomly selects whether the user goes first or not, prints which player the user will be, creates a new game with the user and a hold-at-20 player, and starts the game.
nextRoll
- return one of the die values at random.
OOPig
is the main console class for the Pig application.PigGame
here - play a game of Pig with the given players
PigGame
instance with two UserPigPlayer
instances.
PigGame
instance with the given first and second players.
PigPlayer
provides a minimal interface between the PigGame and various PigPlayer classes.play
- runs a game of Pig between the given players.
UserPigPlayer
- text interface to query user for roll/hold decisionsUserPigPlayer
instance to allow user play via standard input
|
||||||||
PREV NEXT | FRAMES NO FRAMES |