Skip to content

An interactive chess game with an AI opponent, implemented in JavaScript

License

Notifications You must be signed in to change notification settings

scar17off/chess-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chess Bot ♟️

GitHub JavaScript Version GitHub stars GitHub forks GitHub issues GitHub pull requests GitHub last commit GitHub repo size GitHub contributors GitHub commit activity GitHub code size in bytes

This project is an interactive chess game with an AI opponent, implemented in JavaScript. ♔♕♖♗♘♙

Features 🚀

  • Play chess against an AI opponent 🤖
  • Interactive chessboard with piece movement ♟️
  • Move validation ✅
  • Undo and redo moves ↩️↪️
  • Move history display 📜
  • Best move suggestion 💡
  • Auto-move mode 🔄
  • Free mode for piece placement 🆓
  • Move analysis 🔍

Files 📁

  • index.html: The main HTML file that structures the web page 🌐
  • app.js: Contains the game logic and user interface interactions 🧠
  • bot.js: Implements the AI opponent using the minimax algorithm 🤖
  • LICENSE.md: The license for the project 📜

How to Use 🎮

  1. Open index.html in a web browser to start the game. 🌐
  2. Click on a piece to select it, then click on a valid square to move. 🖱️
  3. Use the checkboxes and buttons below the board to access different features:
    • Enable Move Analysis: Highlights the best move for the current player 🔍
    • Enable Auto Move: Automatically makes moves for the white player ⚪
    • Free Mode: Allows free placement of pieces on the board 🆓
    • Make Best Move: Makes the best move for the current player 🏆
    • Undo: Reverts the last move ↩️
    • Redo: Reapplies an undone move ↪️

AI Implementation 🧠

The AI uses the minimax algorithm with alpha-beta pruning to determine the best move. The evaluation function considers piece values and positional advantages. 🤖♟️

License 📜

This project is licensed under the MIT License. See the LICENSE file for details.

Feel free to contribute to this project by submitting pull requests or reporting issues! 🙌