Andros Fenollosa: Playing chess online with Emacs

Wait 5 sec.

Every now and then I like to play a game of chess with my colleagues at the office, without ever leaving my favourite Elisp interpreter. Emacs has a really good package for this, chess, which supports several ways to play: against the machine, over a local network, against internet chess servers (ICS), and even through IRC (I am proud to say I finished implementing that last feature myself). You can check out the official documentation.So I would like to share a brief introduction to playing chess over a network from Emacs.Local network gameLets you play directly between two Emacs sessions over TCP. You can use it to play with a friend on the same local network or VPN.Launch it with:C-u M-x chess RET network RETOn startup it asks which role you want:Server: opens a local port and waits for a connection. Uses open-network-stream-server (or nc -l -p as a fallback if not available).Client: prompts for a host and port, then connects.Internet chess servers (ICS)Maybe you have a favourite online chess provider, or you want to test your skills against players from around the world.Launch it directly with:M-x chess-icsConnects to real ICS servers. The preconfigured ones are:ServerPortfreechess.org5000chessclub.com5000chess.net5000chess.unix-ag.uni-kl.de5000oics.olympuschess.com5000Supports login with a handle and password.Playing through IRCTo play over IRC, run:M-x chess-ircIt will connect to your configured IRC server, then ask for your opponent's nick. Your opponent needs to do the same on their end. No worries about privacy: the game uses private messages.Note: this feature is part of my Pull Request, so if you do not see it, you may need to update your chess version or build it from the repository.Final notesMy configuration:(use-package chess :ensure t :config (setq chess-images-separate-frame nil) ; Display the board in the same frame (setq chess-images-default-size 100)) ; Piece size in pixelsOne last piece of advice: play against humans. The AI is quite easy, and while winning is fun, it is not much of a challenge. You will also get to meet more people that way. Checkmate!I hope you enjoy your chess games inside Emacs as much as I do.