Show HN: Termichess – Play chess in your terminal (github.com)
Hey everyone,
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.
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.
[1] https://github.com/thomas-mauran/chess-tui [2] https://github.com/textualize/textual
28 comments
[ 5.8 ms ] story [ 70.0 ms ] threadVery cool program though :)
> 2. Qf3
Well maybe it was jus...
> 4. Nh3
I see...
I guess I'm stuck with the Sicilian. If anyone knows a way to make the Alapin wild and tactical as black, I'm listening.
Funnily enough I actually play the Italian as white, but I don't play the boring c3 d3 lines. After 3. Bc4 Bc5 I play 0-0 and on Nf6 play d4. exd4 e5 transposes to the Max Lange and Bxd4 Nxd4 Nxd4 Bg5 gets into the Italian gambit which is very sharp. My main issue is that on 4. 0-0 d6, d4 doesn't really offer much. I've been playing a "deferred Evans" with b4 and getting some fun positions that way though. I'm also working on learning the minutiae of 2. Bc4 so I never have play a Petrov ever again...
So the board shrinks down as you reduce the size of window. Currently there is an issue in the chess pieces scaling down in size if we reduce the size of terminal. Showing images properly is quite tricky in terminal, hope to get to it sometime later this week.
> Need Keyboard support.
That's also something on my mind. Do you have any specific scenario in mind. I was thinking of hotkeys or chess notation as input.
I'd also assume people would use https://en.wikipedia.org/wiki/Algebraic_notation_(chess) for the notation. No need to say "e2 e4" if "e4" is already non-ambiguous. Plus side for learning this notation is it can help read old games.
And "e2 e4" contains technically superflous information, yes. The application should be able to parse the most minimal algebraic notation possible, but also more verbose commands.
[1] https://github.com/darrenburns/rich-pixels
As a starting point (and only a few because this gets long and tedious to show) - it uses tput ( https://man7.org/linux/man-pages/man1/tput.1p.html https://www.gnu.org/software/termutils/manual/termutils-2.0/... )
The first version was chess notation based movement. I got some initial feedback that it's probably not very useful. I still understand that most people would probably use chess.com or some other chess app if they want a full blown graphical experience and with terminal there are many limitations at play which would limit a full experience for such folks. But there is hopefully more interesting things that can be added to this such as your suggestions for viewing games that will make it more useful.
Pattern recognition
https://github.com/mlang/chessIO
And Emacs Chess (also known as chess.el) has a "chess-plain" board variant which is configurable down to which letters should be used. Borders are also optional, all configurable.
https://github.com/sa-/wordle-tui
http://curdle.me/
If you write an XBoard-compatible terminal client, then it can just work with GNU chess and other back ends.