Skip to content

Play an open chess tournament! Compete for the crown!

License

Notifications You must be signed in to change notification settings

GaslightGod/GithubChess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GaslightGod's Online Open Chess Tournament

Select your next move! white to move

A B C D E F G H
8 8
7 7
6 6
5 5
4 4
3 3
2 2
1 1
A B C D E F G H

It's your turn to move! Choose one from the following table

FROM TO (Just click a link!)
A2 A3, A4
B1 A3, C3, D2
B2 B3, B4
C1 D2, E3, F4, G5, H6
C2 C3, C4
D5 D6
E1 D1, D2
E2 E3, E4
F2 F3, F4
G1 F3, H3
G2 G3, G4
H2 H3, H4
Last 5 moves in this game
Move Author
B7 to A6 @GaslightGod
D3 to A6 @TheHighNoonCowboy
C6 to C5 @GaslightGod
D4 to D5 @TheHighNoonCowboy
B8 to A6 @GaslightGod
Top 10 most moves across all games
Total moves User
4 @TheHighNoonCowboy
4 @GaslightGod

How It Works

This repository contains a Python script that automates chess games through GitHub issues. Users can make moves and start new games by creating specific issues, and the script processes these actions accordingly.

Game Initiation

To start a new chess game, follow these steps:

  1. Create an Issue:

    • Title: "Chess: Start New Game"
  2. Validation:

    • Only the repository owner can initiate a new game.
  3. Outcome:

    • If the initiation is successful, the script creates a new game instance.
    • The README.md file is dynamically updated to reflect the new game's state.
  4. Error Handling:

    • If a game is already in progress and a non-owner attempts to start a new game, an error is communicated, and the issue is closed.
  5. Last Moves Update:

    • The last moves file is updated to reflect the start of the new game.
  6. Game Headers:

    • Event details, site information, date, and round are set in the game headers.
  7. Readme Update:

    • The README.md file is dynamically updated to display the initial state of the chess board, moves list, and other relevant information.

Making Moves

To make a move in the chess game, follow these steps:

  1. Create an Issue:

    • Title: "Chess: Move [source] to [destination]"
    • Replace [source] and [destination] with the respective chess coordinates (e.g., "Chess: Move E2 to E4").
  2. Validation:

    • The script validates the move, ensuring it adheres to standard chess rules.
    • Checks are performed for consecutive moves, invalid positions, and other game conditions.
  3. Outcome:

    • If the move is valid, the script updates the game board and provides feedback in the issue.
    • Labels indicating capture and player turn are applied.
    • Top moves and last moves statistics are updated.
  4. Readme Update:

    • The README.md file is dynamically updated to reflect the current state of the chess board, moves list, and other relevant information.
  5. Alternatively:

    • You can select the move you would like to make from the corresponding dropdown of valid moves!

Game Over

The chess game can conclude with various outcomes, and the script handles the conclusion as follows:

  1. End Conditions:

    • The game can end in a draw, white win, or black win based on standard chess rules.
  2. Summary:

    • Upon game completion, the script archives the current game.
    • A summary comment is added to the issue, indicating the outcome and providing details on the players involved.
  3. Labeling:

    • Labels are applied to the issue to denote the result, such as "Draw!" or "Winner!"
  4. Cleanup:

    • The current game is archived, and the last moves file is removed.
  5. Readme Update:

    • The README.md file is dynamically updated to reflect the final state of the chess board, moves list, and other relevant information.

Dependencies

  • python-chess: A Python chess library for chess move generation and validation.
  • PyYAML: A YAML parser and emitter for Python.

About

Play an open chess tournament! Compete for the crown!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages