适用于Linux / Unix控制台的国际象棋程序


19

由于我不想进入的原因,哪种国际象棋程序可以在控制台上正常运行(即不需要X Windows)?板的ASCII可视化功能会非常有用(我仍然是国际象棋新手)。

Answers:


15

在安装GNU Chess之后,从终端运行命令gnuchess,它看起来像这样:

~$ 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) : 

我想您可以将这些动作输出到整个板上,以实现更好的可视化,同时要区分大小写,很难跟踪。
— Helio

能够安装但无法执行,非常奇怪
— InterLinked


6

如果您只是想玩一点,Sunfish有一个简单的终端界面:

$ 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: 

界面真的很好,不过我确实觉得颜色是相反的。
— Eiko

@Eiko是的,那是因为网是白色的,而终端通常是深色的:-)
— Thomas Ahle 16-10-6

1
您只是在使用错误的片段。无论是有意还是无意,这都是令人讨厌的-还有一个错误。unicode字符具有明确的含义。顺便说一句:在我的终端上,它显示的是预期的(错误!)。不要将名为“ White Chess Pawn”的棋子转为黑色棋子,因为有人使用了倒置的终端。如果是,那么位置也应该如此。当然,您的代码和决定。但是,在那种状态下,我不会使用该代码。
— Eiko

2
我同意这是不幸和不切实际的,但是您的终端配置不是典型的。反转色是所有常见平台(Ubuntu,Mac OSX和Windows)上的标准颜色。如果您有任何解决方案,那将使暗终端设备的工作状况更好,我很乐于讨论。
— 托马斯·阿勒

问题是,即使在倒置的终端上,它也违反了用户的预期并且看起来是错误的。我可以告诉你,许多人没有倒置终端-如果他们这样做,那是他们的决定。它还完全中断了使用输出进行复制到文档,打印,在此站点上发布之类的操作。如果您绝对必须提供错误的内容,建议将其设为需要显式设置的可选设置。
— Eiko

4

按照我的命令。在终端上播放Stockfish。

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

在这里,您只能基于UCI协议进行交互(在引擎和GUI之间)。我认为这不足以进行交互式使用。
— Bogdan Calmac

4

chs

在您的终端机上对Stockfish引擎下棋。

在此处输入图片说明


我最喜欢这个答案-界面显然比其他选项好。
— konsolas
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.