Skip to content

sadrasa97/Python-Chess-with-Tkinter-GUI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation


Python Chess with Tkinter GUI

This is a Python chess implementation with a Tkinter graphical user interface (GUI). The project is built using clean, object-oriented programming (OOP) principles to ensure modularity, readability, and extensibility. It includes features such as pawn promotion and en passant.

Features

  • Clean Code: The project follows best practices for writing clean, readable, and maintainable code. It adheres to the principles of object-oriented programming (OOP) to promote modularity and extensibility.

  • Fully Object-Oriented Design: The chess game logic is implemented using object-oriented design, with classes representing each component of the game such as the board, pieces, players, and moves.

  • Pawn Promotion: When a pawn reaches the opposite end of the board, it can be promoted to any other piece (queen, rook, bishop, or knight) chosen by the player.

  • En Passant: The en passant rule is implemented, allowing a pawn to capture an opponent's pawn if it moves two squares forward from its starting position, bypassing the captured pawn's original position.

  • Tkinter GUI: The graphical user interface is built using Tkinter, the standard GUI toolkit for Python. It provides an intuitive and user-friendly interface for playing chess.

Getting Started

  1. Installation: Clone the repository to your local machine.

    git clone https://github.com/sadrasa97/Python-Chess-with-Tkinter-GUI.git
  2. Dependencies: Ensure you have Python 3.x installed on your system. Install Tkinter if not already available.

    pip install tk
  3. Run the Game: Navigate to the project directory and run the main Python file.

    cd Python-Chess-with-Tkinter-GUI
    python main.py
  4. Play Chess: Use the mouse to select and move pieces on the chessboard. Enjoy playing against either a friend or yourself!

Tips for Playing

  • Mouse Controls: Click on a piece to select it, then click on a valid square to move the piece to that location.

  • Pawn Promotion: When a pawn reaches the opposite end of the board, a promotion dialog will appear. Select the desired piece for promotion.

  • En Passant: If your opponent moves a pawn two squares forward from its starting position, you have the option to capture it en passant on the next move.

  • Check and Checkmate: Keep an eye out for check and checkmate situations. The game will automatically detect and handle these scenarios.

  • Undo Move: Press the "Undo" button to undo your last move if needed.

Contributing

Contributions are welcome! If you have any suggestions, feature requests, or bug reports, please open an issue on GitHub or submit a pull request.


Feel free to customize the content as needed for your specific project. Let me know if there's anything else you'd like to add or modify!

About

Python Chess with Tkinter GUI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages