Skip to content

Subhendu-Kumar/chess_engine_py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

♟️ Python Chess Game

A classic Chess game built using Python and Pygame, featuring a smooth graphical interface, valid move highlighting, turn-based mechanics, and standard chess rules. Whether you're a beginner or a seasoned player, this project delivers an enjoyable and intuitive chess experience right from your desktop.


🚀 Features

  • Clean and interactive GUI with Pygame
  • Full implementation of chess rules
  • Piece movement validation
  • Check and Checkmate detection
  • Stalemate detection
  • Valid move highlighting
  • Turn-based play (White vs Black)
  • Basic AI integration (optional)
  • Light-weight and beginner-friendly codebase

🖼️ Screenshots

Chess Game 1

Main game interface showing the chess board and pieces


Chess Game 2

Active gameplay with highlighted valid moves


🛠️ Installation

Make sure you have Python 3.7+ installed on your system.

  1. Clone the repository:

    git clone https://github.com/Subhendu-Kumar/chess_engine_py.git
    cd chess_engine_py
  2. Install dependencies:

    pip install -r requirements.txt
  3. Run the game:

    py main.py

🎮 How to Play

  • White always moves first.
  • Click on a piece to view its valid moves.
  • Click a highlighted square to move the selected piece.
  • Checkmate and stalemate are automatically detected.
  • Use the R key to reset the board.

🧠 Optional AI Support

The codebase supports plug-and-play AI move generation using minimax, negamax, and alpha-beta pruning.

To activate:

Replace self.game_mode = GameMode.HUMAN_VS_HUMAN # Default game mode with self.game_mode = GameMode.HUMAN_VS_AI # Default game mode

📁 Project Structure

  ├── chess_ai/
  │   ├── random_move.py
  ├── chess_engine/
  │   ├── castle_rights.py
  │   ├── chess_game.py
  │   ├── game_mode.py
  │   ├── game_settings.py
  │   ├── game_state.py
  │   ├── move.py
  ├── images/
  ├── screenshots/
  ├── utils/
  │   ├── variable_and_constants.py
  │   ├── helpers.py
  ├── .gitignore
  ├── main.py
  ├── README.md
  ├── requirements.txt

🤝 Contributing

Contributions are welcome! Feel free to fork the repo and submit a PR with any enhancements, bug fixes, or new features.


Thanks for checking it out! Feel free to ⭐ the repo if you found it helpful

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages