News for hackers. Stuff that matters.
Re:A chess terminal user interface implementation by shric on Tuesday December 05, 2023 @09:29PM (#38539850)
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.
Re:A chess terminal user interface implementation by mtlmtlmtlmtl on Wednesday December 06, 2023 @04:35AM (#38541994)
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.
Re:A chess terminal user interface implementation by jph on Tuesday December 05, 2023 @10:46PM (#38540275)
Great work! Thank you for sharing this.
Re:A chess terminal user interface implementation by shmageggy on Tuesday December 05, 2023 @11:18PM (#38540427)
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.

Re:A chess terminal user interface implementation by colanderman on Tuesday December 05, 2023 @11:42PM (#38540538)
Behold, DEC double-width mode:

    echo -e '\033#6♔♕♖♗♘♙♚♛♜♝♞♟'
(best viewed in xterm)
Re:A chess terminal user interface implementation by shmageggy on Wednesday December 06, 2023 @06:56AM (#38542717)
This gets the correct aspect ratio but the glyphs (on my terminal) look stretched :(
Re:A chess terminal user interface implementation by saulpw on Wednesday December 06, 2023 @01:17AM (#38540951)
You can be clever and use half-blocks: ♘
Re:A chess terminal user interface implementation by shmageggy on Wednesday December 06, 2023 @07:00AM (#38542746)
What's a half-block and how do I use one?
Re:A chess terminal user interface implementation by saulpw on Wednesday December 06, 2023 @12:33PM (#38546973)
Sorry, that didn't render. They're U+258C and U+2590. So you put them on either side and each square is rendered across 3 cells, and the 2 outer cells are half-blocks shared with the adjacent squares.

https://en.wikipedia.org/wiki/Block_Elements

Re:A chess terminal user interface implementation by shmerl on Tuesday December 05, 2023 @11:51PM (#38540571)
Is it using sixels?
Re:A chess terminal user interface implementation by hnlmorg on Wednesday December 06, 2023 @01:56AM (#38541145)
Just standard character drawing blocks. Like how Teletext (if you remember that?) used to do graphics

https://github.com/thomas-mauran/chess-tui/blob/592de110d15c...

Re:A chess terminal user interface implementation by photonbeam on Wednesday December 06, 2023 @12:29AM (#38540749)
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

Re:A chess terminal user interface implementation by lynx23 on Wednesday December 06, 2023 @01:52AM (#38541120)
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.
Re:A chess terminal user interface implementation by a_t48 on Wednesday December 06, 2023 @03:00AM (#38541505)
Could be the newline
Re:A chess terminal user interface implementation by teleforce on Wednesday December 06, 2023 @02:12AM (#38541226)
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?
Re:A chess terminal user interface implementation by __jonas on Wednesday December 06, 2023 @02:18AM (#38541252)
lichess is open source and has an android app
Re:A chess terminal user interface implementation by jmfldn on Wednesday December 06, 2023 @04:10AM (#38541842)
Written in Scala I believe which makes me love it even more (Scala fan here!).
Re:A chess terminal user interface implementation by teleforce on Wednesday December 06, 2023 @02:43AM (#38541378)
Great, thanks for the suggestion.

Apparently, Lichess has 'Over the board' feature that allows you to play with your friend offline, nice!

Re:A chess terminal user interface implementation by naet on Wednesday December 06, 2023 @03:14AM (#38541569)
It also has a pretty good chess clock if you have a physical board but want to play timed.
Re:A chess terminal user interface implementation by mat_epice on Wednesday December 06, 2023 @09:36AM (#38544407)
It also lets you play an engine (stockfish) running on your phone. I play offline on planes all the time.
Re:A chess terminal user interface implementation by Zizizizz on Wednesday December 06, 2023 @02:37AM (#38541346)
Re:A chess terminal user interface implementation by graphe on Wednesday December 06, 2023 @02:21AM (#38541273)
Vouching for this, best chess app ever. Also offers a website!
Re:A chess terminal user interface implementation by tetris11 on Wednesday December 06, 2023 @02:20AM (#38541270)
Chess (Chess program and FICS client) https://f-droid.org/packages/jwtc.android.chess/

JustChess (Chess for one or two players) https://f-droid.org/packages/com.alaskalinuxuser.justchess/

Re:A chess terminal user interface implementation by hereonout2 on Wednesday December 06, 2023 @04:58AM (#38542125)
Not open source but chess.com app is brilliant, it's a freemium model - you can play for free - but they just keep trying to sell you tip and tutorials.

Also seems to have all the grand masters on there as players, Magnus ignored my request for a game though.

Re:A chess terminal user interface implementation by stavros on Wednesday December 06, 2023 @07:16AM (#38542858)
Lichess is fully open source and the best chess platform right now, online or offline.
Re:A chess terminal user interface implementation by memming on Wednesday December 06, 2023 @02:30AM (#38541312)
what's TUI? T for text?
Re:A chess terminal user interface implementation by schaefer on Wednesday December 06, 2023 @02:35AM (#38541336)
Terminal (command line) User Interface

Yes. Text

Re:A chess terminal user interface implementation by dspillett on Wednesday December 06, 2023 @06:05AM (#38542449)
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.

Re:A chess terminal user interface implementation by larsbrinkhoff on Wednesday December 06, 2023 @02:36AM (#38541341)
Re:A chess terminal user interface implementation by ziotom78 on Wednesday December 06, 2023 @04:25AM (#38541939)
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!
Re:A chess terminal user interface implementation by ligurio on Wednesday December 06, 2023 @04:46AM (#38542067)
See other chess in text mode - https://github.com/ligurio/awesome-ttygames
Re:A chess terminal user interface implementation by qsort on Wednesday December 06, 2023 @05:05AM (#38542160)
Various TUI modes were implemented in the ICS protocol for online chess.

  telnet freechess.org 5000
still works.
Re:A chess terminal user interface implementation by FergusArgyll on Wednesday December 06, 2023 @07:42AM (#38543088)
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)
Re:A chess terminal user interface implementation by phone8675309 on Wednesday December 06, 2023 @09:40AM (#38544471)
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.

Re:A chess terminal user interface implementation by mongol on Wednesday December 06, 2023 @06:08AM (#38542465)
Looks like my old C64 chess game
Re:A chess terminal user interface implementation by magv on Wednesday December 06, 2023 @07:20AM (#38542886)
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'.

Re:A chess terminal user interface implementation by nilslindemann on Wednesday December 06, 2023 @07:41AM (#38543084)
What is a chess TUI, please? I play chess for decades but never heard of it.
Re:A chess terminal user interface implementation by nilslindemann on Wednesday December 06, 2023 @07:44AM (#38543108)
Ok, it seems to be a "text-based user interface", https://en.wikipedia.org/wiki/Text-based_user_interface
Re:A chess terminal user interface implementation by olzhas on Wednesday December 06, 2023 @08:31AM (#38543611)
I think you should not highlight all the possible moves.
Re:A chess terminal user interface implementation by globular-toast on Wednesday December 06, 2023 @09:10AM (#38544082)
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.
Re:A chess terminal user interface implementation by shortrounddev2 on Wednesday December 06, 2023 @09:20AM (#38544201)
It's wild to me how many people writing native software opt to sandbox everything with docker these days
Re:A chess terminal user interface implementation by enlyth on Wednesday December 06, 2023 @09:46AM (#38544562)
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
Re:A chess terminal user interface implementation by somat on Wednesday December 06, 2023 @11:23AM (#38545972)
conversely, I am using OpenBSD, I see docker, I know that I am in for a long night untangling a docker file.
Re:A chess terminal user interface implementation by mat_epice on Wednesday December 06, 2023 @09:33AM (#38544353)
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.
Re:A chess terminal user interface implementation by shortrounddev2 on Wednesday December 06, 2023 @09:40AM (#38544477)
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
Re:A chess terminal user interface implementation by tbm57 on Wednesday December 06, 2023 @10:04AM (#38544739)
this is the most performant chess TUI implementation I've ever used