Playing Chess Online with Emacs

ibobev1 pts0 comments

Playing chess online with Emacs | Andros Fenollosa

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 game

Lets 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 RET<br>On 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-ics<br>Connects to real ICS servers. The preconfigured ones are:

Server<br>Port

freechess.org<br>5000

chessclub.com<br>5000

chess.net<br>5000

chess.unix-ag.uni-kl.de<br>5000

oics.olympuschess.com<br>5000

Supports login with a handle and password.

Playing through IRC

To play over IRC, run:

M-x chess-irc<br>It 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 notes

My configuration:

(use-package chess<br>:ensure t<br>:config<br>(setq chess-images-separate-frame nil) ; Display the board in the same frame<br>(setq chess-images-default-size 100)) ; Piece size in pixels<br>One 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.

Local network game

Internet chess servers (ICS)

Playing through IRC

Final notes

This work is under a Attribution-NonCommercial-NoDerivatives 4.0 International license.

Will you buy me a coffee?

Support me on Ko-fi

Comments

page#run"<br>data-liveview-function="show_comment_email"<br>data-id="d8b3a759"<br>data-type="article"<br>>Leave a comment

There are no comments yet.

You may also like

page#run"<br>data-liveview-function="navigate_article"<br>data-uuid="6cad402e">

emacs

My Morning Routine in Emacs

page#run"<br>data-liveview-function="navigate_article"<br>data-uuid="409869f6">

emacs

Creating desktop applications using the Emacs core

page#run"<br>data-liveview-function="navigate_article"<br>data-uuid="ddd78757">

emacs

org-mode

orgsocial

Quick tutorial to get started on Org Social

Visitors in real time

You are alone: 🐱

chess emacs data network play playing

Related Articles