Hey everyone,<p>I have been trying to build a terminal based app for sometime now and this is an attempt at trying to build a chess app that one can play right inside terminal.<p>I was inspired by `chess-tui`[1] which is a rust based project and was looking to build something similar using python. Luckily I stumbled upon textual[2] recently and it made my task of building this far more easier than I thought.<p>[1] <a href="https://github.com/thomas-mauran/chess-tui">https://github.com/thomas-mauran/chess-tui</a>
[2] <a href="https://github.com/textualize/textual">https://github.com/textualize/textual</a>
Why reinvent a graphical interface in the terminal? If we are playing chess in the terminal, we are likely happy to accept abstractions and such. You could use normal letters for the different pieces, perhaps using lowercase for black and uppercase for white. Even the "grid" could be an optional setting, placing a slight emphasis on user skill in being able to visualize the grid on their own.<p><pre><code> A B C D E F G H
8 r n b q k b n r
7 p p p p p p p p
6
5
4
3
2 P P P P P P P P
1 R N B Q K B N R
</code></pre>
This to me feels more like truly playing chess in the terminal. Add a non-interactive session mode, for example "chesst game123 view" to produce a view of the game, and "chesst game123 e2 e4" to move the pawn infront of white king two squares up. Naturally moving a piece can by default also print the new board state, after the opponents move. Implicitly prompting you to move again, or to just leave the terminal and do something else.
The unbearable pixel graphics on such a large display make it unplayable. It's a nice one, though. I think I should shrink the size of my terminal window. Or can you make everything smaller? Need Keyboard support.
In the FOSS world there is a protocol between chess-like board games and user interfaces, the primary examples of which are the XBoard GUI client, and the GNU Chess engine.<p>If you write an XBoard-compatible terminal client, then it can just work with GNU chess and other back ends.
Slightly relevant, here's a version of Wordle in the terminal built using go:<p><a href="https://github.com/sa-/wordle-tui">https://github.com/sa-/wordle-tui</a>