The Nim game is a turn-based strategy game where a human competes against a computer. Players take turns removing stones from a pile, and the goal is to avoid being the player who removes the last stone.
-
Turn-Based Gameplay:
- Human vs. computer gameplay.
- Classic Nim rules where players remove stones from a pile.
-
AI Computer Player:
- Implements a strategy to make intelligent moves.
-
Modular Design:
Game,Human, andComputerclasses are modular and follow object-oriented principles.
- Compile the Files:
javac Nim.java Game.java Computer.java Human.java
- Run the Game:
java Nim
Follow the on-screen prompts to play the game against the computer.
Nim.java: Test class for the Nim game (do not modify).Game.java: Core game logic.Computer.java: AI logic for the computer player.Human.java: Logic for the human player's interactions.README.txt: Explanation of design choices and instructions.