forked from nikochiko/df-wizard-chess
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
122 lines (112 loc) ยท 9.56 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<h1 id="wizard-chess-w-dialogflow">Wizard Chess w/ Dialogflow</h1>
<p><a href="https://gitter.im/wizard-chess/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge"><img src="https://badges.gitter.im/wizard-chess/community.svg" alt="Gitter" /></a> <a href="https://travis-ci.com/nikochiko/df-wizard-chess"><embed src="https://travis-ci.com/nikochiko/df-wizard-chess.svg?branch=master" /></a> <a href="https://codecov.io/gh/nikochiko/df-wizard-chess"><img src="https://codecov.io/gh/nikochiko/df-wizard-chess/branch/master/graph/badge.svg" alt="codecov" /></a> <a href="https://dependabot.com"><img src="https://api.dependabot.com/badges/status?host=github&repo=nikochiko/df-wizard-chess&identifier=259290685" alt="Dependabot Status" /></a> <a href="https://github.com/psf/black"><img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code style: black" /></a></p>
<h2 id="what-is-wizard-chess">
๐ค What is Wizard Chess?
</h2>
<p>To truly understand, I will have you read this</p>
<blockquote>
<p><strong>What do you do when you really want to play blindfold chess but you're stuck at home? ๐ </strong></p>
<p><em>Ask your chess friends - easy ๐จโ๐จโ๐งโ๐ฆ</em></p>
<p><strong>They don't like blindfold ๐คท</strong></p>
<p><em>Google for an online solution ๐ป, there are so many chess apps. There has to be one about blindfold chess.</em></p>
<p><strong>Pbbt ๐
There ain't one.</strong></p>
<p><em>What about.. the popular ones?</em></p>
<p><strong>They say "hide your pieces, it's just like blindfold chess ๐"</strong></p>
<p><em>Ugh - that's a scam</em></p>
<p><strong>I have to do something about this.. ๐จโ๐ง๐ณ</strong></p>
</blockquote>
<p>Wizard Chess is <strong>that</strong> 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 <a href="#how-do-you-do-it">๐ง How do you do it?</a> for the technical details.</p>
<p>Wizard Chess is already available as a Google Action! See <a href="#where-can-i-play">๐๐ฝโโ๏ธ Where can I play?</a> to know more.</p>
<h2 id="how-do-you-do-it">
๐ง How do you do it?
</h2>
<p>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 <a href="http://dialogflow.com/">Dialogflow</a>. It processes the request from the assistant - intelligently, with machine learning - and sends it to our <a href="https://sendgrid.com/blog/whats-webhook/">webhook</a>. 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:</p>
<pre><code> User ======= |AI assistant/chatbot| <-------> |Dialogflow| <-------> |THIS SERVER| ๐ช</code></pre>
<p>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.</p>
<h2 id="where-can-i-play">
๐๐ฝโโ๏ธ Where can I play?
</h2>
<p>The app is already available for the Google Assistant <a href="https://assistant.google.com/services/a/uid/0000003ba609b4ff?hl=en">here</a>. You can even launch the app without touching the link at all, just say <em>Talk to Wizard Chess</em> to your Google Assistant to boot up the Action.</p>
<p>More platforms coming soon! Let me know via <script type="text/javascript">
<!--
h='gmail.com';a='@';n='ktvm42';e=n+a+h;
document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+'email'+'<\/'+'a'+'>');
// -->
</script><noscript>email (ktvm42 at gmail dot com)</noscript> or <a href="https://gitter.im/wizard-chess/community">Gitter</a> if you want to see Wizard Chess on a particular platform so that we can prioritize it.</p>
<h2 id="how-do-i-play">
๐ How do I play?
</h2>
<p>Upon starting the Wizard Chess Action (by saying <em>Talk to Wizard Chess</em>), 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).</p>
<h3>
Playing moves
</h3>
<p>The system to interpret moves is very lenient and allows you to choose how you want to say the move.</p>
<p>Here's a short list of how you can describe your moves:</p>
<ul>
<li>Long descriptive format - e.g. <strong><em>Knight from g1 to f3</em></strong> or <strong><em>Pawn e4 captures d5</em></strong> or even without mentioning the piece <strong><em>d5 takes c4</em></strong></li>
<li>For pawn promotion, you can add the name of the promotion piece to the end - that is, <strong><em>Pawn from d7 to d8 queen</em></strong> or <strong><em>b2 takes c1 queen</em></strong></li>
<li>Shorter format with just the piece and square - e.g. <strong><em>Knight to d4</em></strong> or <strong><em>Queen takes f6</em></strong></li>
<li>Pawn promotion is supported in the same way as above</li>
<li>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.</li>
<li>Pawn moves by the squares they want to move to - e.g. <strong><em>e4</em></strong>, <strong><em>g3</em></strong></li>
<li>Short Algebraic Notation (SAN) - e.g. <strong><em>Bd6</em></strong>, <strong><em>Nbd7</em></strong></li>
<li>Long Algebraic Notation (LAN) - e.g. <strong><em>e2-e4</em></strong>, <strong><em>Nf6xe4</em></strong>, <strong><em>O-O</em></strong></li>
</ul>
<p><strong>Note</strong>: The app doesn't yet support descriptive moves like <strong><em>Knight b to d7</em></strong> or <strong><em>e takes d5</em></strong>. In that case you should use the long descriptive format of move by mentioning the actual square the piece was at - e.g. <strong><em>knight b8 to d7</em></strong> and <strong><em>e4 takes d5</em></strong></p>
<h3>
Castling
</h3>
<p>You can castle by telling the assistant to castle and mentioning the side you want to castle on.</p>
<p>Some examples: <strong><em>Castle short</em></strong>, <strong><em>Castle kingside</em></strong>, <strong><em>Long castling</em></strong>, <strong><em>Castle to the queen's side</em></strong></p>
<p>If you don't mention which side you want to castle on (just <strong><em>castles</em></strong>), castling will be performed on whichever side is legal, defaulting to the kingside in case both are legal.</p>
<h3>
Undoing the moves
</h3>
<p>You can easily undo your last move by saying <strong><em>Undo move</em></strong>, <strong><em>take back my last move</em></strong>, etc.</p>
<h3>
Seeing the board
</h3>
<p>You are also given the option to take a peek at the board. To do that just say something like <strong><em>show me the board</em></strong> or <strong><em>let me see the board</em></strong> to the assistant.</p>
<h3>
Resignation
</h3>
<p>You can resign at any time by just saying <strong><em>resign</em></strong>.</p>
<h2 id="contributing">
๐ง Contributing
</h2>
<p>Use the <a href="https://github.com/nikochiko/df-wizard-chess/issues">issue tracker</a> to suggest new features or report bugs. Feel free to directly <a href="https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request">create pull requests</a> 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 <link to be updated>.</p>
<h2 id="changelog">
โฐ Changelog
</h2>
<h3 id="section">0.2.0 - 16/05/2020</h3>
<ul>
<li>Moved from SQLite to Postgres with SQLAlchemy</li>
<li>Bug fixes in show_board</li>
<li>Bug fixes with session_id handling</li>
<li>Added feature to accept SAN (or overspecified SAN) moves</li>
<li>Fixed bug which caused stale result comment after engine's move</li>
<li>Added feature to accept move when only a piece and square are mentioned</li>
<li>Fixed bug which made app to crash when square had capital letters (A4, D5 etc.)</li>
<li>Edited show board feature to flip board when user is playing as black</li>
</ul>
<h3 id="section-1">0.1.1 - 07/05/2020</h3>
<ul>
<li>Set up Travis CI</li>
<li>Set up coverage reporting with Codecov</li>
<li>Moved from using Dict in memory to sqlite3 DB on disk ๐</li>
<li>Added testing to cover more than 90% of codebase ๐ช</li>
<li>Added feature to see board at any time ๐๏ธ</li>
<li>Board image will be shown after completion of games ๐</li>
</ul>
<h3 id="section-2">0.1.0 - 27/04/2020</h3>
<ul>
<li>Format according to Black formatting tool</li>
<li>Basic functionality to play a game as a Google Action</li>
<li>Voice-activated ability to castle, promote pawn, and play move when at least the two squares involved in the move are given.</li>
<li>Works with games stored in memory as Dict data type. Considering move to sqlite in future versions</li>
<li>Unit tests added for most basic functions. More tests required for functions which handle intents.</li>
</ul>
<h2 id="license">
License
</h2>
<p>Licensed under GNU General Public License 3.0 (GPL-3.0). See <a href="https://github.com/nikochiko/df-wizard-chess/blob/master/LICENSE">LICENSE</a> for full text.</p>