Skip to content

Commit 6c562d3

Browse files
committed
launch
0 parents  commit 6c562d3

37 files changed

+2318
-0
lines changed

.github/workflows/Chess.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Chess
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
jobs:
8+
move:
9+
permissions:
10+
issues: write
11+
contents: write
12+
runs-on: ubuntu-latest
13+
if: startsWith(github.event.issue.title, 'Chess:')
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
# Set up a Python 3.10 (64-bit) instance
19+
- name: Setting up Python
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: "3.10"
23+
architecture: "x64"
24+
25+
# Use pip to install the dependencies and then run the script
26+
- name: Play chess
27+
env:
28+
ISSUE_NUMBER: ${{ github.event.issue.number }}
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
REPOSITORY_OWNER: ${{ github.repository_owner }}
31+
run: |
32+
pip install -r requirements.txt
33+
python main.py
34+
35+
# Create new commit with the changed files and push it to GitHub
36+
- name: Commit and push changes
37+
env:
38+
ISSUE_TITLE: ${{ github.event.issue.title }}
39+
ISSUE_AUTHOR: ${{ github.event.issue.user.login }}
40+
run: |
41+
git config --global user.name "github-actions[bot]"
42+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
43+
git add .
44+
git commit -m "${ISSUE_TITLE} by ${ISSUE_AUTHOR}"
45+
git push

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
**/.DS_Store
2+
src/__pycache__/*

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 GaslightGod
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# GaslightGod's Online Open Chess Tournament
2+
3+
This is an open chess tournament where ANYONE can play. That's the fun part.
4+
It's your turn to play! Move a <!-- BEGIN TURN -->?<!-- END TURN --> piece.
5+
6+
<!-- BEGIN CHESS BOARD -->
7+
8+
(Here goes the chess board)
9+
10+
<!-- END CHESS BOARD -->
11+
12+
**It's your turn to move! Choose one from the following table**
13+
14+
<!-- BEGIN MOVES LIST -->
15+
16+
(Here goes the list of legal moves)
17+
18+
<!-- END MOVES LIST -->
19+
20+
<details>
21+
<summary>Last 5 moves in this game</summary>
22+
<!-- BEGIN LAST MOVES -->
23+
(Here goes the list of the last 5 moves)
24+
<!-- END LAST MOVES -->
25+
</details>
26+
27+
<details>
28+
<summary>Top 10 most moves across all games</summary>
29+
<!-- BEGIN TOP MOVES -->
30+
(Here goes the top 10 most moves)
31+
<!-- END TOP MOVES -->
32+
</details>
33+
34+
---

data/last_moves.txt

Whitespace-only changes.

data/settings.yaml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
comments:
2+
# Message to be shown when two consecutive moves are played. {author} is the author of the issue
3+
consecutive_moves: "Sorry {author}, you can't move twice in a row! You can ask someone to play the next turn :D"
4+
5+
# Message to be shown on game over. {outcome} is a message that specifies wether white wins, black wins or
6+
# both players draw, {num_moves} corresponds with the number of moves, {num_players} is the number of players
7+
# in this game and finally {players} is a comma-separated list of all players in this game (in no particular
8+
# order)
9+
game_over: |-
10+
And that's a game over! {outcome}! This game had {num_moves} moves made by {num_players} players.
11+
12+
Thanks to {players} for participating!
13+
14+
# This message is displayed if the board is in an invalid state. This shouldn't be shown unless something
15+
# has gone terribly wrong
16+
invalid_board: "{author} Sorry, I can't perform the specified move. The board is invalid!"
17+
18+
# Message to be displayed when a player plays an invalid move
19+
invalid_move: |-
20+
{author} Whaaaat? The move `{move}` is invalid!
21+
Maybe someone squeezed a move before you. Please try again.
22+
23+
# Message displayed if a player tries to start a new game mid-game and the author of the issue is not the
24+
# owner of the repository (the repo owner can always restart a game at any time)
25+
invalid_new_game: "{author} Sorry, but you cannot start a new game while the old one is still in progress. Only the repo owner can do that."
26+
27+
# Message displayed after a successful move done by a player. {move} is the move in UCI coordinates (e2e4 for example)
28+
successful_move: |-
29+
{author} done! Successfully played move `{move}` for current game.
30+
Thanks for playing!
31+
32+
# Message displayed when either a player or the repository owner start a new game
33+
successful_new_game: "{author} done! New game successfully started!"
34+
35+
# Error message shown after an invalid command to the chess bot
36+
unknown_command: "{author} Sorry, I can't understand the command. Please try again and do not modify the issue title!"
37+
38+
issues:
39+
link: "https://github.com/{repo}/issues/new?{params}"
40+
move:
41+
body: "Please do not change the title. Just click \"Submit new issue\". You don't need to do anything else :D"
42+
title: "Chess: Move {source} to {dest}"
43+
new_game:
44+
body: "Please do not change the title. Just click \"Submit new issue\". You don't need to do anything else :D"
45+
title: "Chess: Start new game"
46+
47+
markers:
48+
board:
49+
begin: "<!-- BEGIN CHESS BOARD -->\n"
50+
end: "<!-- END CHESS BOARD -->\n"
51+
last_moves:
52+
begin: "<!-- BEGIN LAST MOVES -->\n"
53+
end: "<!-- END LAST MOVES -->\n"
54+
moves:
55+
begin: "<!-- BEGIN MOVES LIST -->\n"
56+
end: "<!-- END MOVES LIST -->\n"
57+
top_moves:
58+
begin: "<!-- BEGIN TOP MOVES -->\n"
59+
end: "<!-- END TOP MOVES -->\n"
60+
turn:
61+
begin: "<!-- BEGIN TURN -->"
62+
end: "<!-- END TURN -->"
63+
64+
misc:
65+
# Maximum number of last moves displayed
66+
max_last_moves: 5
67+
# Maximum number of top players displayed
68+
max_top_moves: 10

data/top_moves.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

games/current.pgn

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Event "GaslightGod's Online Open Chess Tournament"]
2+
[Site "https://github.com/GaslightGod/GithubChess"]
3+
[Date "2020.12.26"]
4+
[Round "1"]
5+
[White "?"]
6+
[Black "?"]
7+
[Result "*"]
8+
9+
*
10+

img/black/bishop.svg

+1
Loading

img/black/king.svg

+1
Loading

img/black/knight.svg

+1
Loading

img/black/pawn.svg

+1
Loading

img/black/queen.svg

+1
Loading

img/black/rook.svg

+1
Loading

img/blank.png

84 Bytes
Loading

img/white/bishop.svg

+1
Loading

0 commit comments

Comments
 (0)