D G H I M N O P U

D

Die - Class in <Unnamed>
Die - an n-sided die with given integer values.
Die(int[]) - Constructor for class Die
Creates a new Die instance with the given integer outcomes.
Die(int, int) - Constructor for class Die
Creates a new Die with a given number of sides and an incremental sequence of values beginning with a given minimum value.
Die() - Constructor for class Die
Creates a new Die instance with the default values: 1, 2, 3, 4, 5, 6.

G

GOAL_SCORE - Static variable in class PigGame
GOAL_SCORE - the goal score of Pig (usually 100).

H

HoldAt20PigPlayer - Class in <Unnamed>
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.
HoldAt20PigPlayer() - Constructor for class HoldAt20PigPlayer
 

I

isRolling(int, int, int) - Method in class HoldAt20PigPlayer
isRolling - return whether or not the player rolls, given the current game state.
isRolling(int, int, int) - Method in interface PigPlayer
isRolling - return whether or not the player rolls, given the current game state.
isRolling(int, int, int) - Method in class UserPigPlayer
isRolling - return whether or not the player rolls, given the current game state.

M

main(String[]) - Static method in class OOPig
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.

N

nextRoll() - Method in class Die
nextRoll - return one of the die values at random.

O

OOPig - Class in <Unnamed>
OOPig is the main console class for the Pig application.
OOPig() - Constructor for class OOPig
 

P

PigGame - Class in <Unnamed>
PigGame here - play a game of Pig with the given players
Output format: Before each turn, prints a line with "Player 1 score: " and player 1's score.
PigGame() - Constructor for class PigGame
Creates a new PigGame instance with two UserPigPlayer instances.
PigGame(PigPlayer, PigPlayer) - Constructor for class PigGame
Creates a new PigGame instance with the given first and second players.
PigPlayer - Interface in <Unnamed>
interface PigPlayer provides a minimal interface between the PigGame and various PigPlayer classes.
play() - Method in class PigGame
play - runs a game of Pig between the given players.

U

UserPigPlayer - Class in <Unnamed>
UserPigPlayer - text interface to query user for roll/hold decisions
UserPigPlayer() - Constructor for class UserPigPlayer
Creates a new UserPigPlayer instance to allow user play via standard input
Output format: Print an instruction line "Enter nothing to roll; enter anything to hold."

D G H I M N O P U