Question: 1. NimGame class // Main for the misre NIM game o public static void main(String]) / Program main 2. TheNim class // Class for the

 1. NimGame class // Main for the misre NIM game o

1. NimGame class // Main for the misre NIM game o public static void main(String]) / Program main 2. TheNim class // Class for the game o private Pile pileA // First pile o private Pile pileB// Second pile private Pile pileC // Third pile o private Random nd // Random number generator o private Scanner input // Scanner for all user input o public Nim) // Default constructor, constructs the three piles o public boolean PlayerMovel) // All the rules to handle user input o private void com andomMove) // Computer move if done randomly, is computerMove) in non-bonus version o public void computerMove)// All the rules to handle computer move public boolean done) // Is the game done? o public void printPiles) / Print the current state of the piles 3. Piles class // Class to handle ONE pile o private int size // The current size of pile o public Pile) // Default constructor (Non-bonus version) o public Pile(int) // Initial constructor (Bonus version) o public int getSizel) // get current size of pile o public void remove(int) / remove the amount from pile 1. NimGame class // Main for the misre NIM game o public static void main(String]) / Program main 2. TheNim class // Class for the game o private Pile pileA // First pile o private Pile pileB// Second pile private Pile pileC // Third pile o private Random nd // Random number generator o private Scanner input // Scanner for all user input o public Nim) // Default constructor, constructs the three piles o public boolean PlayerMovel) // All the rules to handle user input o private void com andomMove) // Computer move if done randomly, is computerMove) in non-bonus version o public void computerMove)// All the rules to handle computer move public boolean done) // Is the game done? o public void printPiles) / Print the current state of the piles 3. Piles class // Class to handle ONE pile o private int size // The current size of pile o public Pile) // Default constructor (Non-bonus version) o public Pile(int) // Initial constructor (Bonus version) o public int getSizel) // get current size of pile o public void remove(int) / remove the amount from pile

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!