Class OOPig

java.lang.Object
  extended by OOPig

public class OOPig
extends java.lang.Object

OOPig is the main console class for the Pig application. It is typically executed within a terminal (shell) window. Pig is a folk jeopardy dice game with simple rules: Two players race to reach 100 points. Each turn, a player repeatedly rolls a die until either a 1 ("pig") is rolled or the player holds and scores the sum of the rolls (i.e. the turn total). At any time during a player's turn, the player is faced with two decisions:


This is a text-based implementation of a game of Pig where the user plays against a "hold at 20 or goal" computer player that rolls until a 1 ("pig") is rolled, or the turn total is greater than or equal to 20, or the score plus the turn total is greater than or equal to 100. The first player is chosen randomly.


Constructor Summary
OOPig()
           
 
Method Summary
static void main(java.lang.String[] args)
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OOPig

public OOPig()
Method Detail

main

public static void main(java.lang.String[] args)
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.
Output format:

Parameters:
args - a String[] value (unused)