How to play chess on linux?
December 16, 2004 6:37 PM   Subscribe

Linux and Chess: Looking for something with a painfully simple UI that still allows me to enter custom board positions. [check]

I'm trapped at home with bronchitis for a few days and want to practice some positions from a book, and have no physical board. I want something that lets me play against the computer, and I have to be able to start the game with the pieces set up however I want, and play either side. That's it.

You would think that google would be fine for this, but at home I run Debian Linux (sarge/testing), which frankly I'm way out of practice with...used to using windows all the time, but I don't have my windows machine here. Chess programs and Linux programs are each in their own right notoriously overcomplicated from a UI perspective.

I don't need something that creates a database that cross-references the differences between my games. I just want something old-school, like you would expect to see on an Apple II. Except that you would see it on Linux. And it would work on Debian Sarge with no major snags. I don't even care if it will let me play with other people online; I already have redhotpawn for that. I just want to be able to play the computer.

Any takers?
posted by bingo to Computers & Internet (20 answers total)
gnuchess is the classic Unix chess AI. Crafty is another, but a bit, er, craftier. Both xboard and eboard are frontends for both gnuchess and Crafty; I assume you'd be able to set up positions and play against the computer with both. eboard is a bit fancier-looking and has a few more features that I don't know much about. They're all apt-getable in Debian.
posted by zsazsa at 7:00 PM on December 16, 2004

I have gnuchess and xboard, and if it's possible to play against the computer, then I don't know how. It seems to be more of a game database/interface to play another human online with.
posted by bingo at 7:12 PM on December 16, 2004

Actually, not entirely true. If I start gnuchess in xterm mode by itself, then I am automatically in 'play vs. computer' mode, but I would really prefer to play on a (virtual) board and have the pieces represented by images instead of letters. When I start xboard, I can modify the starting position, but I don't see how to get the engine to start playing against me.
posted by bingo at 7:21 PM on December 16, 2004

In the default configuration right after apt-getting gnuchess and xboard, right after startup I was playing the computer. Make sure Mode is set to "Machine Black" or "Machine White." You can also set Mode to "Edit Position" to set up positions. Riight or Middle clicking on a square will let you empty it or place an arbitrary piece of black or white, respectively.
posted by zsazsa at 7:23 PM on December 16, 2004

My 'machine black' and 'machine white' choices are grayed out.
posted by bingo at 7:30 PM on December 16, 2004

Obviously it sounds like maybe I'm running xboard without gnuchess, and maybe (accidentally) I am. I do have gnuchess installed. I've been running xboard from my window manager's drop-down menus (fluxbox). When I try to run gnuchess from the command line with xboard, i.e. "$ gnuchess xboard" or "$gnuchess --xboard" I get 'Adjusting HashSize to 1024 Slots" and then it hangs.
posted by bingo at 7:36 PM on December 16, 2004

That's weird. Try starting xboard with the command line xboard -fcp "gnuchess". Or give eboard a try, it has a nice menu selection for picking a chess engine to play against.
posted by zsazsa at 7:39 PM on December 16, 2004

Hey, that command line for xboard worked great, thanks! I don't think I would have figured that out for quite a while.

You don't know how to turn off the timer, do you? I don't see anything about it on any of the menus.
posted by bingo at 8:24 PM on December 16, 2004

Hrm. I created a custom position and now it's rejecting my moves, which are definitely not illegal. Grrr. Linux and it's elite-only flexibility.
posted by bingo at 8:38 PM on December 16, 2004

i get the same behavior that you do when using gnuchess with xboard. gnuchess rejects obviously legal moves. weird, and bad on gnuchess.

but with crafty as the backend, it seems to accept a non-standard initial position and play the game from there. (note that you'll want non-free and contrib in /etc/apt/sources.list to be able to install crafty)

Also, you can supply xboard with the -clockMode False option to get rid of the clock (though you may want to experiment with the -searchTime and -timeControl options as well because the computer player will take those into account when evaluating how long to spend pondering the next move).

in short, try doing:
sudo apt-get crafty
xboard -fcp crafty -clockMode False
also, you may want to
man xboard
to learn about some other available options.

Lastly, if you decide to go with crafty, you might want to look into installing some additional books of openings for it (though that might not change anything if yer playing unusual board positions). They can be found in the crafty-books-* packages.
posted by dkg at 10:09 PM on December 16, 2004

Hmm. It was all going well until I tried to make the first move, and then got:

"xboard: Error: first chess program (crafty) exited unexpectedly"

For the record, all I'm trying to do at the moment is set up a position in which white (me) has a king and two bishops, and black (computer) has only a king. I got the error when I tried to make white's first move after I had changed the position. This is the same point at which I was getting the 'illegal move' error with gnuchess.
posted by bingo at 11:01 PM on December 16, 2004

FWIW, xboard and gnuchess come preinstalled in Red Hat 9, and I can set up a position with king vs king and two bishops and play on just fine.
posted by flabdablet at 3:57 AM on December 17, 2004

i set up the board as you suggested and saved the position to a file.

Save that file locally, and then load it with xboard (File->Load Position). it will be White's turn, and you can take a move. When it is black's turn, tell xboard the computer player should play black (Mode->Machine Black). i don't get any errors with this scenario.

(when i try the same sequence with gnuchess instead of crafty, gnuchess rejects my valid first moves. bleh. i think gnuchess thinks it's playing with the standard initial board position for some reason.)
posted by dkg at 8:50 AM on December 17, 2004

dkg: I loaded your file, and got the same problem as soon as I made my first move as white: 'Error: First chess program (Crafty) exited unexpectedly.'

Are you running sid? Maybe you have a newer version of crafty, or xboard, than I do. I think (based on apt-cache show) that I'm using crafty 19.4-1 and xboard 4.2.6-2.1.

posted by bingo at 10:02 AM on December 17, 2004

bingo, it works for me with xboard 4.2.6-2.1 and gnuchess 5.07-1 on sid. I loaded the board position dkg provided and I don't get the illegal move error that you both have mentioned. What version of gnuchess do you have?

A program called phalanx also seems to be available in apt as an alternative to gnuchess or crafty. I've never used it, but it might be worth trying out for you at this point.
posted by Lirp at 11:05 AM on December 17, 2004

Can someone remind me how to tell what version of a program you have? Apt-cache show gnuchess says v. 5.07-2, but that's not necessarily the version I have installed, right?

Lirp, since my last comment, I have actually installed phalanx, and it does not have the problem we've been discussing. It's a slow thinker, though, so it would still be nice though admittedly less urgent, to get one of the other engines working with the setup...
posted by bingo at 11:15 AM on December 17, 2004

"apt-cache show" gives you information about the package you currently have installed (if any) and also the newest available package (if it's different). I've sometimes thought it a bit confusing to tell at a glance the difference between "package not installed" and "package installed, no new version".

I've found that "dpkg -l gnuchess" is a more convenient way to find out from the command line what version of any particular package you have installed. The status should be listed as 'ii' if it's installed, or something different if it was installed but is now removed. Or something like that.
posted by Lirp at 12:00 PM on December 17, 2004

Thanks. I guess I really am running gnuchess 5.07-2 on sarge. Maybe I should file a bug.
posted by bingo at 12:53 PM on December 17, 2004

fwiw, i'm running sarge, and i've got all the same versions as you, bingo (though i don't have phalanx installed at all)

for figuring out what's on yer system, i like apt-show-versions, which is an additional perl-based package.
posted by dkg at 10:44 AM on December 18, 2004

dkg: I probably have something configured wrong somewhere. I don't really know what I'm doing, and since I got a job that has me in windows all the time, I've let my marginal linux skills slide. I'll check out apt-show-versions, though. Thanks.
posted by bingo at 10:11 AM on December 19, 2004

« Older Chocolate Linzer Cookies   |   Where can I find this specific type of 8.5x11... Newer »
This thread is closed to new comments.