Skip to content

ahmedabouelnaga/Nim-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nim Game

Table of Contents


Overview

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.


Features

  1. Turn-Based Gameplay:

    • Human vs. computer gameplay.
    • Classic Nim rules where players remove stones from a pile.
  2. AI Computer Player:

    • Implements a strategy to make intelligent moves.
  3. Modular Design:

    • Game, Human, and Computer classes are modular and follow object-oriented principles.

How to Run

  1. Compile the Files:
    javac Nim.java Game.java Computer.java Human.java

Run the Game

  1. Run the Game:
    java Nim

Follow the on-screen prompts to play the game against the computer.

Files in the Repository

  1. Nim.java: Test class for the Nim game (do not modify).
  2. Game.java: Core game logic.
  3. Computer.java: AI logic for the computer player.
  4. Human.java: Logic for the human player's interactions.
  5. README.txt: Explanation of design choices and instructions.

About

A strategic showdown between human intuition and artificial intelligence. This implementation of the classic Nim game challenges players to outthink a cunning AI opponent in a battle of wits. Every move matters—calculate carefully, plan ahead, and avoid being the player who takes the last stone.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages