https://github.com/nikochiko/df-wizard-chess
๐ง Dialogflow fulfillment for Wizard Chess
https://github.com/nikochiko/df-wizard-chess
blindfold-chess chess dialogflow dialogflow-fulfillment flask flask-sqlalchemy google-assistant python python3
Last synced: 2 months ago
JSON representation
๐ง Dialogflow fulfillment for Wizard Chess
- Host: GitHub
- URL: https://github.com/nikochiko/df-wizard-chess
- Owner: nikochiko
- License: gpl-3.0
- Created: 2020-04-27T11:14:48.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2025-04-18T04:59:07.000Z (2 months ago)
- Last Synced: 2025-04-20T23:41:28.512Z (2 months ago)
- Topics: blindfold-chess, chess, dialogflow, dialogflow-fulfillment, flask, flask-sqlalchemy, google-assistant, python, python3
- Language: Python
- Homepage: https://df-wizardchess.herokuapp.com
- Size: 74.1 MB
- Stars: 14
- Watchers: 2
- Forks: 3
- Open Issues: 36
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Wizard Chess w/ Dialogflow
[](https://gitter.im/wizard-chess/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[](https://travis-ci.com/nikochiko/df-wizard-chess)
[](https://codecov.io/gh/nikochiko/df-wizard-chess)
[](https://dependabot.com)
[](https://github.com/psf/black)๐ค What is Wizard Chess?
To truly understand, I will have you read this
> **What do you do when you really want to play blindfold chess but
> you're stuck at home? ๐ **
>
> *Ask your chess friends - easy ๐จโ๐จโ๐งโ๐ฆ*
>
> **They don't like blindfold ๐คท**
>
> *Google for an online solution ๐ป, there are so many chess apps. There
> has to be one about blindfold chess.*
>
> **Pbbt ๐ There ain't one.**
>
> *What about.. the popular ones?*
>
> **They say "hide your pieces, it's just like blindfold chess ๐"**
>
> *Ugh - that's a scam*
>
> **I have to do something about this.. ๐จโ๐ง๐ณ**Wizard Chess is **that** something. The goal is to provide the best
blindfold chess experience. That is, to have anything you might need
while playing blindfold chess - be it a platform to play, a platform to
learn, or a platform to further develop your prowess. See
[๐ง How do you do it?](#how-do-you-do-it) for the technical details.Wizard Chess is already available as a Google Action! See
[๐๐ฝโโ๏ธ Where can I play?](#where-can-i-play) to know more.๐ง How do you do it?
We use the wizardry ๐ฎ of AI assistants and chatbots to interact with the
user. When a user talks to our AI asssistant, the message is forwarded
to [Dialogflow](http://dialogflow.com/). It processes the request from
the assistant - intelligently, with machine learning - and sends it to
our [webhook](https://sendgrid.com/blog/whats-webhook/). Now our server
uses this cooked data to generate a response and sends it back to
Dialogflow which in turn sends it to the assistant. The whole process
basically looks like this:
```
User ======= |AI assistant/chatbot| <-------> |Dialogflow| <-------> |THIS SERVER| ๐ช
```Examples of operations done on our end are creating and storing chess
games in a database, receiving a move and updating the board
accordingly, and generating responses for the user.๐๐ฝโโ๏ธ Where can I play?
The app is already available for the Google Assistant
[here](https://assistant.google.com/services/a/uid/0000003ba609b4ff?hl=en).
You can even launch the app without touching the link at all, just say
*Talk to Wizard Chess* to your Google Assistant to boot up the Action.More platforms coming soon! Let me know via
[email](mailto:[email protected]) or
[Gitter](https://gitter.im/wizard-chess/community) if you want to see
Wizard Chess on a particular platform so that we can prioritize it.๐ How do I play?
Upon starting the Wizard Chess Action (by saying *Talk to Wizard
Chess*), you will be asked to choose the side you'd like to play as and
the assistant will present you with a list of three options: White,
Black and Random. Now you can either select an option by touch or say
your choice out loud. The latter even works with devices which don't
have a screen (e.g. Google Home).Playing moves
The system to interpret moves is very lenient and allows you to choose
how you want to say the move.Here's a short list of how you can describe your moves:
- Long descriptive format - e.g. ***Knight from g1 to f3*** or ***Pawn e4 captures d5*** or even without mentioning the piece ***d5 takes c4***
- For pawn promotion, you can add the name of the promotion
piece to the end - that is, ***Pawn from d7 to d8 queen*** or
***b2 takes c1 queen***
- Shorter format with just the piece and square - e.g. ***Knight to d4*** or ***Queen takes f6***
- Pawn promotion is supported in the same way as above
- Note that you will be notified by the assistant if your move
is ambiguous. This usually means that there were more than one
moves which matched your description - for example when two knights can
come to the mentioned square and you didn't specify which one.
- Pawn moves by the squares they want to move to - e.g. ***e4***, ***g3***
- Short Algebraic Notation (SAN) - e.g. ***Bd6***, ***Nbd7***
- Long Algebraic Notation (LAN) - e.g. ***e2-e4***, ***Nf6xe4***, ***O-O*****Note**: The app doesn't yet support descriptive moves like ***Knight b to
d7*** or ***e takes d5***. In that case you should use the long descriptive
format of move by mentioning the actual square the piece was at - e.g.
***knight b8 to d7*** and ***e4 takes d5***Castling
You can castle by telling the assistant to castle and mentioning the side you
want to castle on.Some examples: ***Castle short***, ***Castle kingside***, ***Long castling***, ***Castle to the queen's side***
If you don't mention which side you want to castle on (just ***castles***), castling
will be performed on whichever side is legal, defaulting to the kingside in
case both are legal.Undoing the moves
You can easily undo your last move by saying ***Undo move***, ***take back
my last move***, etc.Seeing the board
You are also given the option to take a peek at the board. To do that just say
something like ***show me the board*** or ***let me see the board*** to the assistant.Resignation
You can resign at any time by just saying ***resign***.
๐ง Contributing
Use the [issue tracker](https://github.com/nikochiko/df-wizard-chess/issues) to suggest
new features or report bugs. Feel free to directly [create pull
requests](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request)
for small changes and typos. Create an issue before opening larger pull
requests so that the changes can be discussed beforehand. The latest
Dialogflow agent can be downloaded from \.โฐ Changelog
### 0.2.0 - 16/05/2020
- Moved from SQLite to Postgres with SQLAlchemy
- Bug fixes in show\_board
- Bug fixes with session\_id handling
- Added feature to accept SAN (or overspecified SAN) moves
- Fixed bug which caused stale result comment after engine's move
- Added feature to accept move when only a piece and square are
mentioned
- Fixed bug which made app to crash when square had capital letters
(A4, D5 etc.)
- Edited show board feature to flip board when user is playing as
black### 0.1.1 - 07/05/2020
- Set up Travis CI
- Set up coverage reporting with Codecov
- Moved from using Dict in memory to sqlite3 DB on disk ๐
- Added testing to cover more than 90% of codebase ๐ช
- Added feature to see board at any time ๐๏ธ
- Board image will be shown after completion of games ๐### 0.1.0 - 27/04/2020
- Format according to Black formatting tool
- Basic functionality to play a game as a Google Action
- Voice-activated ability to castle, promote pawn, and play move when
at least the two squares involved in the move are given.
- Works with games stored in memory as Dict data type. Considering
move to sqlite in future versions
- Unit tests added for most basic functions. More tests required for
functions which handle intents.License
Licensed under GNU General Public License 3.0 (GPL-3.0). See
[LICENSE](https://github.com/nikochiko/df-wizard-chess/blob/master/LICENSE)
for full text.