Skip to content

JuaniV2002/nim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nim Game

A web-based implementation of the classic Nim strategy game, ported from a Haskell codebase.

🎮 Play Online

About

This project ports the logic of a Haskell Nim AI (using the Minimax algorithm) to modern JavaScript, allowing it to be played directly in the browser.

Features

  • 🤖 Unbeatable AI: Uses a Minimax algorithm to play optimally.
  • 🎨 Modern UI: Clean, dark-themed interface with responsive design.
  • Lightweight: Pure HTML/CSS/JS, no heavy frameworks.

How to Play

  1. Select the initial number of stones.
  2. Take turns removing 1, 3, or 4 stones.
  3. The player who takes the last stone wins!

Development

  • Logic: The game logic (game.js) is a direct port of the original Haskell implementation (TP.hs).
  • Styling: Custom CSS with a dark color scheme (style.css).