Chess (and why data is fun)
I’ve been playing chess (and with chess) quite a lot recently. I started up playing online chess again (on chess.com), and I’ve been having quite a lot of fun with it. This quickly moved into playing with chess in Python, and I’ve had quite a lot of fun with that, especially thanks to a nifty chess library I found for python. One of the things I realized is that chess.com makes quite a lot of data available for each user. For example, I can download a .pgn file of the last few weeks of games that I have played (I ended up downloading about 40 chess games that I’ve played — I could get more games but unfortunately I need to pay for a real account if I want this).
This is a lot of data, so I decided to try to do something with it. I ended up producing this:
This represents all of the chess moves made in about 40 chess games I’ve played, coloured by piece. Rooks are gold, kings are purple, pawns are blue, bishops are green, knights are red, and queens are black. I also made a few images representing only certain pieces, here’s one with only the knights:
Most of the work that I did on this project actually went into producing the graphics rather than interpreting the files. I got the best results (that you see here) by using PYX curves. Each arc that you see in the images represents a move. The degree of the arcs (how wide the are, etc) is randomly generated so that multiple “moves” don’t overlap. This way we can see, that, for example, I like to move my knights to c3 and g3 quite a lot.
Oh, and if you’d like to play chess with me, feel free to challenge me online. I can’t guarantee that I’m any good at chess, though, so it might be a bit embarrassing for me.