19

For reasons I'd rather not get into, what chess programs work well on the console (ie. does not require X Windows)? Something with an ASCII visualization of the board would be incredibly helpful (I'm still a chess newbie).

15

After installing GNU Chess run the command gnuchess from the terminal, it would look something like this:

~$ gnuchess
GNU Chess 5.07
Adjusting HashSize to 1024 slots
Transposition table:  Entries=1K Size=48K
Pawn hash table: Entries=0K Size=32K
White (1) : e4
1. e4

black  KQkq  e3
r n b q k b n r 
p p p p p p p p 
. . . . . . . . 
. . . . . . . . 
. . . . P . . . 
. . . . . . . . 
P P P P . P P P 
R N B Q K B N R 

Thinking...
Looking for opening book in book.dat...
Looking for opening book in /usr/share/games/gnuchess/book.dat...
Read opening book (/usr/share/games/gnuchess/book.dat)...
Loading book from /usr/share/games/gnuchess/book.dat.
40304 hash collisions...  Opening database: 265053 book positions. 
In this position, there are 11 book moves:
 Nc6(71/77/22/32)  Nf6(54/113/88/113)  a6(75/3/1/0)  b6(67/11/3/9) 
 c6(52/451/376/743)  d6(52/178/153/229)  e6(52/651/582/970)        g6(59/155/88/117) 
 c5(56/2535/1691/2912)  d5(54/47/38/35)  e5(54/2518/1938/3369)  

 c5(1322)  e5(1312)  e6(376)  c6(277)  d6(141)  g6(136)  Nf6(109)  Nc6(108) 
 a6(76)  d5(76)  b6(70)  


white  KQkq  c6
r n b q k b n r 
p p . p p p p p 
. . . . . . . . 
. . p . . . . . 
. . . . P . . . 
. . . . . . . . 
P P P P . P P P 
R N B Q K B N R 


My move is : c5
White (2) : 
| improve this answer | |
  • I guess you could output the moves over the board for better visualization, having lower case and upper case to keep track of might be difficult. – Helio Dec 5 '12 at 20:25
  • Was able to install but not execute, strangely enough – InterLinked Jul 15 '19 at 0:33
10

What about GNU Chess? It has a plain terminal interface but supports visual interfaces such as XBoard.

| improve this answer | |
6

Sunfish has a simple terminal interface, if you just want to play a bit for fun:

$ git clone https://github.com/thomasahle/sunfish.git
...
$ python sunfish/sunfish.py

  8 ♖ ♘ ♗ ♕ ♔ ♗ ♘ ♖
  7 ♙ ♙ ♙ ♙ ♙ ♙ ♙ ♙
  6 . . . . . . . .
  5 . . . . . . . .
  4 . . . . . . . .
  3 . . . . . . . .
  2 ♟ ♟ ♟ ♟ ♟ ♟ ♟ ♟
  1 ♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
    a b c d e f g h


Your move: e2e4

  8 ♖ ♘ ♗ ♕ ♔ ♗ ♘ ♖
  7 ♙ ♙ ♙ ♙ ♙ ♙ ♙ ♙
  6 . . . . . . . .
  5 . . . . . . . .
  4 . . . . ♟ . . .
  3 . . . . . . . .
  2 ♟ ♟ ♟ ♟ . ♟ ♟ ♟
  1 ♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
    a b c d e f g h


My move: g8f6

  8 ♖ ♘ ♗ ♕ ♔ ♗ . ♖
  7 ♙ ♙ ♙ ♙ ♙ ♙ ♙ ♙
  6 . . . . . ♘ . .
  5 . . . . . . . .
  4 . . . . ♟ . . .
  3 . . . . . . . .
  2 ♟ ♟ ♟ ♟ . ♟ ♟ ♟
  1 ♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
    a b c d e f g h


Your move: 
| improve this answer | |
  • Really nice interface, I do feel that the colours are reversed, though. – Eiko Oct 6 '16 at 14:24
  • @Eiko yes, that's because the web is black on white, while terminals are usually light on dark :-) – Thomas Ahle Oct 6 '16 at 20:13
  • 1
    You're just using the pieces wrong. Be it intentional or not, it's annoying - and a bug. The unicode characters have a clear meaning. BTW: in my terminal it's showing as expected (wrong!). Don't dump a piece called "White Chess Pawn" as a black one because someone uses a terminal that's inverted. If it is, so should be the position. Your code and decision, of course. I wouldn't use that code for anything in that state, though. – Eiko Oct 6 '16 at 20:19
  • 2
    I agree it's unfortunate and unsemantic, but your terminal configuration isn't typical. Inverted colors are standard on all common platforms, Ubuntu, Mac OSX, Windows. If you have any solutions, that would make things work better for dark-on-light terminals, I'd be happy to discuss it. – Thomas Ahle Oct 10 '16 at 9:25
  • The thing is, even on inverted terminals it breaks user expectation and looks wrong. And I can tell you that many people do not have an inverted terminal - if they do, it's their decision. It also completely breaks using the output for anything like copying into documents, printing, posting on this site. If you feel you absolutely must give wrong pieces, I suggest to make it an optional setting that needs to be explicitly set. – Eiko Oct 10 '16 at 9:37
4

Follow my commands. Play Stockfish on the terminal.

wget https://stockfish.s3.amazonaws.com/stockfish-6-linux.zip
unzip stockfish-6-linux.zip
cd stockfish-6-linux/Linux
./stockfish_6_x64

Stockfish 6 64 by Tord Romstad, Marco Costalba and Joona Kiiski
d

 +---+---+---+---+---+---+---+---+
 | r | n | b | q | k | b | n | r |
 +---+---+---+---+---+---+---+---+
 | p | p | p | p | p | p | p | p |
 +---+---+---+---+---+---+---+---+
 |   |   |   |   |   |   |   |   |
 +---+---+---+---+---+---+---+---+
 |   |   |   |   |   |   |   |   |
 +---+---+---+---+---+---+---+---+
 |   |   |   |   |   |   |   |   |
 +---+---+---+---+---+---+---+---+
 |   |   |   |   |   |   |   |   |
 +---+---+---+---+---+---+---+---+
 | P | P | P | P | P | P | P | P |
 +---+---+---+---+---+---+---+---+
 | R | N | B | Q | K | B | N | R |
 +---+---+---+---+---+---+---+---+

Fen: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
Key: B4D30CD15A43432D
Checkers: 
e2e4
Unknown command: e2e4
go movetime 1000
info depth 1 seldepth 1 multipv 1 score cp 84 nodes 21 nps 90 tbhits 0 time 232 pv e2e4
info depth 2 seldepth 2 multipv 1 score cp 82 nodes 62 nps 266 tbhits 0 time 233 pv e2e4 b7b6
info depth 3 seldepth 3 multipv 1 score cp 75 nodes 162 nps 695 tbhits 0 time 233 pv b1c3 d7d6 e2e3
info depth 4 seldepth 4 multipv 1 score cp 60 nodes 417 nps 1789 tbhits 0 time 233 pv g1f3 e7e6 e2e3 d7d6
info depth 5 seldepth 5 multipv 1 score cp 136 nodes 1546 nps 6578 tbhits 0 time 235 pv g1f3 c7c5 e2e4 d7d6 d2d4
info depth 6 seldepth 6 multipv 1 score cp 21 nodes 4562 nps 19087 tbhits 0 time 239 pv g1f3 g8f6 d2d4 d7d5 b1c3 e7e6
info depth 7 seldepth 7 multipv 1 score cp 51 nodes 5949 nps 24787 tbhits 0 time 240 pv g1f3 g8f6 d2d4 d7d5 b1c3 e7e6 e2e3
info depth 8 seldepth 8 multipv 1 score cp 39 nodes 9124 nps 37547 tbhits 0 time 243 pv g1f3 e7e6 b1c3 d7d5 d2d4 g8f6 e2e3 a7a6
info depth 9 seldepth 9 multipv 1 score cp 39 nodes 13735 nps 55607 tbhits 0 time 247 pv g1f3 d7d5 d2d4 b8c6 b1c3 g8f6 c1f4 e7e6 e2e3
info depth 10 seldepth 13 multipv 1 score cp 28 nodes 25801 nps 101180 tbhits 0 time 255 pv g1f3 d7d5 d2d4 b8c6 b1c3 g8f6 e2e3 a8b8 h2h3 e7e6
info depth 11 seldepth 13 multipv 1 score cp 26 nodes 56118 nps 206316 tbhits 0 time 272 pv e2e4 d7d5 e4d5 g8f6 b1c3 f6d5 g1f3 e7e6 a2a3 b8c6 d2d4 h7h6
info depth 12 seldepth 16 multipv 1 score cp 25 nodes 194110 nps 549886 tbhits 0 time 353 pv e2e4 e7e5 b1c3 g8f6 g1f3 b8c6 f1b5 f8b4 e1g1 b4c3 d2c3 e8g8 d1e2 d7d5
info depth 13 seldepth 19 multipv 1 score cp 28 nodes 336964 nps 764090 tbhits 0 time 441 pv e2e4 e7e5 b1c3 g8f6 g1f3 b8c6 f1b5 f8b4 e1g1 e8g8 c3d5 f6d5 e4d5
info depth 14 seldepth 19 multipv 1 score cp 31 nodes 457658 nps 886934 tbhits 0 time 516 pv g1f3 g8f6 b1c3 d7d5 e2e3 e7e6 d2d4 b8c6 f1d3 f8d6 e1g1 e8g8 c1d2 e6e5 a2a3
info depth 15 seldepth 19 multipv 1 score cp 29 nodes 638239 nps 1022818 tbhits 0 time 624 pv g1f3 g8f6 b1c3 d7d5 d2d4 e7e6 e2e3 b8c6 f1e2 f6e4 e1g1 f8b4 c3e4 d5e4 f3e5 e8g8
info nodes 1246584 time 1003
bestmove g1f3 ponder g8f6
| improve this answer | |
  • Here you can only interact based on the UCI protocol (between the engine and a GUI). I don't think this is adequate for interactive use. – Bogdan Calmac Feb 7 '19 at 4:13
4

chs

Play chess against the Stockfish engine in your terminal.

enter image description here

| improve this answer | |
  • I'm liking this answer the most - the interface is clearly nicer than the other options. – konsolas Aug 7 '19 at 16:04

Not the answer you're looking for? Browse other questions tagged or ask your own question.