Settings

Theme

A chess TUI implementation

github.com

115 points by kdheepak 2 years ago · 46 comments

Reader

qsort 2 years ago

Various TUI modes were implemented in the ICS protocol for online chess.

  telnet freechess.org 5000
still works.
  • FergusArgyll 2 years ago

    This is the coolest thing ever! it's a bit hard to play because black/white is not so easy to distinguish but you probably get used to it. (I lost cause I mixed up my knight with my opponents)

    • phone8675309 2 years ago

      You can use many compatible graphical interfaces.

      I remember using WinBoard (in Windows) or XBoard (in Linux) around 1998 or 1999 with to play chess on FICS after the novelty of the telnet experience wore off.

teleforce 2 years ago

Honest question, is there any open source non-subscription based no-frill virtual chess board on Android that allows you to simply play chess offline against human or AI, in the same spirit as VLC on Android?

magv 2 years ago

Hey, I have my own chess with a textual UI which allows you to play against several beginner-level chess AI opponents:

- Maia chess (https://maiachess.com), the human-like chess engine based on neural networks,

- several of neural networks by Dietrich Kappe (https://github.com/dkappe/leela-chess-weights/releases),

- and handicapped Stockfish (https://stockfishchess.org).

The whole thing is at https://github.com/magv/bchess, and can be installed with just 'pip install bchess'.

shric 2 years ago

Looks good! In case anyone else wonders (first thing I wanted to know), UCI (to talk to engines and online chess) is in the to-do, not yet implemented.

  • mtlmtlmtlmtl 2 years ago

    There is a perfectly fine UCI crate available already, so it shouldn't take the author too too long. Unless they intend on implementing it themselves of course. But it's not a terribly complicated protocol either.

ziotom78 2 years ago

Borland Pascal 7 had a chess engine implementation in the EXAMPLES directory. There were two frontends in the same directory: one used OWL to provide a graphical interface in Windows, the other one was for MS-DOS (character-based) using the Turbo Vision library, and it was pretty awesome!

shmageggy 2 years ago

It has always bothered me that there are no Unicode code points for the left/right halves of chess pieces, which would enable a nearly square board using two characters per square.

This is a nice solution, but it makes for a rather big board.

larsbrinkhoff 2 years ago

An older chess TUI: https://github.com/PDP-10/its/issues/1024#issuecomment-40025...

nilslindemann 2 years ago

What is a chess TUI, please? I play chess for decades but never heard of it.

shortrounddev2 2 years ago

It's wild to me how many people writing native software opt to sandbox everything with docker these days

  • enlyth 2 years ago

    As a user I love it, I use a mix of Windows, Linux and MacOS machines and when I see docker I know that it will "just werk" regardless of which one I'm using at the moment

    • somat 2 years ago

      conversely, I am using OpenBSD, I see docker, I know that I am in for a long night untangling a docker file.

  • mat_epice 2 years ago

    It’s just a distribution mechanism that users like. The page details other ways to install, including native methods. The container is at the top just because it will be the first thing many people will want to try.

    • shortrounddev2 2 years ago

      I don't think I've ever liked the experience of running Docker commands; I think its benefit is the sandboxed environment so the developer has fewer platform variables they need to worry about. I think flatpak is a more user friendly distribution mechanism. But, again, sandboxing really shouldn't be necessary with a Rust TUI application; there really shouldn't be much in the way of platform-specific code in there except maybe the ncurses library

lynx23 2 years ago

Commit 592de110d15c55512f8254b38051e3a61853eb82 looks weird. I don't have the time to read the code, but mod 9 instead of mod 8 in a chess-related program looks like the off-by-one has just been "fixed" in the wrong place.

photonbeam 2 years ago

I find when learning a language, reading the code for a problem that you already know the rules (or the shape of) really helps.

I think this is probably good project for simply reading the code to learn

ligurio 2 years ago

See other chess in text mode - https://github.com/ligurio/awesome-ttygames

jph 2 years ago

Great work! Thank you for sharing this.

olzhas 2 years ago

I think you should not highlight all the possible moves.

shmerl 2 years ago

Is it using sixels?

mongol 2 years ago

Looks like my old C64 chess game

memming 2 years ago

what's TUI? T for text?

  • dspillett 2 years ago

    Or sometimes Terminal, I've seen them used interchangeably though I find “Text” is more common.

    Usually TUI is used in a way that implies not just a basic command line interface: something like a GUI (buttons, dialogs, navigable lists, frames, interactive text editing, etc) just drawn using “text” elements so it works via a terminal console. I've seen some people refer to almost any CLI or REPL as a TUI but while they match the words of the acronym (they are user interfaces based on text) I think this is incorrect and TUI refers to a more specific sub-set of text-based interfaces.

    See https://en.wikipedia.org/wiki/Text-based_user_interface for more references.

  • schaefer 2 years ago

    Terminal (command line) User Interface

    Yes. Text

tbm57 2 years ago

this is the most performant chess TUI implementation I've ever used

globular-toast 2 years ago

This is probably one of the most egregious "in rust" projects I've seen. Should I care about the performance improvements over something like Python in a program where I'm going to spend 99.999% of the time thinking? Should I be concerned about memory safety in other chess implementations written in C? The only thing Rust seems to add over Python or Go for things like this is making it harder to hack.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection