Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rootenginear/why-is-this-a-checkmate
Input FEN and get image explanation as an output
https://github.com/rootenginear/why-is-this-a-checkmate
chess hacktoberfest
Last synced: 4 days ago
JSON representation
Input FEN and get image explanation as an output
- Host: GitHub
- URL: https://github.com/rootenginear/why-is-this-a-checkmate
- Owner: rootEnginear
- License: mit
- Created: 2022-08-30T13:31:03.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-04T18:16:53.000Z (about 2 years ago)
- Last Synced: 2024-10-11T10:52:11.412Z (28 days ago)
- Topics: chess, hacktoberfest
- Language: JavaScript
- Homepage: https://whymate.glitch.me/
- Size: 218 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Why Is This A Checkmate?
![GitHub](https://img.shields.io/github/license/rootenginear/why-is-this-a-checkmate)
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/rootenginear/why-is-this-a-checkmate/Glitch%20Sync)A public API that can be used to explain why the entered chess position is a
checkmate.## Endpoints
> Currently deployed at
```http
GET /
```The root endpoint will response with the homepage that you can enter FEN to
perform mate checking.---
```http
GET /
```Redirect to `GET /?fen=`. You may replace any spaces in FEN string with `+` for
this syntax to work.Examples:
- `/1R4k1/5ppp/8/8/8/8/5PPP/6K1`
- `/5bk1/2p2p1p/6p1/nB2pb2/1K6/2P2N2/1P1N1PPP/r3R3+w`---
```http
GET /?fen=[&flip][&img]
````Generate a page that shows why in that position (FEN) is a checkmate. This
*required* the first part of the FEN — which is the board configuration.However, you can also specify the second part of the FEN too, which will help
the checker to only find mate in that color. This part can be either "w" or
"b". If it's "w", the checker will check if white is in a mate, and vise versa.
If the mate is not found, *currently*, it will just render the position for you.Parameters:
- `flip` : Show the board from the opposite *perspective*. Normally, if white is mating black, it will show as white perspective (A file at the left, H file at the right). But if black is mating white, it will show as black perspective (H file at the left, A file at the right).
- `img` : Generate an SVG image instead of a HTML page.Examples:
- `/?fen=5bk1/2p2p1p/6p1/nB2pb2/1K6/2P2N2/1P1N1PPP/r3R3+w`
- `/?fen=kr6/ppN5/8/1K6/8/8/8/8+b&flip`
- `/?fen=5k2/5Q2/5K2/8/8/8/8/8+b&img`## Todo
- [ ] If it's not a checkmate, show how to escape.
- [ ] Show escape square.
- [ ] Show if the check can be blocked.## Resources
- Chess Pieces: Maestro chess piece by sadsnake1
- Board Theme: Green Plastic theme by the [lila authors](https://github.com/lichess-org/lila) and [pirouetti](https://lichess.org/@/pirouetti)> Reference: