FENipulator

Thu 2012.01.05
by brian hefele

FENipulator is my latest project, a chess board application written in PHP. I call it a chess board application and not a chess application, because of its dumb nature. With a few small exceptions, it does not care about (or, frankly, know) the rules of chess. It does not, generally speaking, validate anything. It assumes the players are smart and honest enough to play by the rules. It also does not keep track of anything that isn’t a component of Forsyth-Edwards Notation(FEN). It is not connected to a database, it has no sense of state. Rather, it relies entirely on being passed FEN via HTTP-GET. It takes in FEN, allows the player to make a move, and generates new FEN based on the move made.

Let me back up a little bit, and say that as much as I love gaming, chess is almost certainly my favorite game. Correspondence chess systems online have all proven too heavy and complicated for my taste. I decided last night to implement an extremely simple system myself, a system that just simplified the process of getting the state of a chess board back and forth among two players. Play is simple — white clicks a piece to select it, clicks a space to move it to, reviews her move, and copies/pastes a link to the current board state to black. The link can be sent over email, IM, Twitter, whatever. Black does the same, and so on until the game is over. Because no state is ever saved on the server, there’s no overhead for an individual game. Thus, there’s no incentive (or, possibility even) for me to make games time out after so much inactivity, etc. It is, perhaps easiest to simply think of FENipulator as an interface to viewing and manipulating FEN data — hence the name.

Simplicity exists in many aspects of FENipulator. Aside from the aforementioned lack of a database, FENipulator also makes zero use of Javascript. There are no images, pieces are all represented by text. If one wanted, one could use images for pieces and spaces, as all of that is defined in CSS. Every space is a span, every piece is an :after pseudo-element attached to that span. For users who like their board flipped, a setting for this is possible using vendor-specific CSS transforms. Thus, flipping is not available on IE or older browsers, but for users of modern browsers, the possibility is there.

Update: Version 1.4 has all the short-term improvements taken care of except figuring out how I’m going to license the thing (see footnote). I got a bit carried away. Anyway, without going into the full changelog, here’s what has happened since v0.9: pawn promotion (to queen only); en passant (works on board and is recorded in FEN); POST is now used for sending move to/from data instead of GET, this meant switching the spaces from <a> to <button>; some classes added to CSS, making board-flipping easier and more things possible with board display (active state now exists after a move, showing to and from); board state URLs go through urlencode(), so everything validates now; and finally, no spaces are ‘live’ after a move has been made — the user must either choose to send the link or reset the board (the earlier behavior where the user could essentially change their move was unintentional and unpredictable). Anyway, read the footnote about licensing, then download it here, or just play.

As I have not yet determined how to license FENipulator, currently all rights are reserved. This will change soon, I promise. Also, know that while I have tested it, and it should not be able to cause any damage, I assume no liability or responsibility for its installation and/or use.

End-of-year, Best-of-year

Sat 2011.12.31
by brian hefele


‘watchful,’ possibly my favorite photo of 2011.

As an introspective sort of an exercise, I went through all of my 2011 photos, and selected my top seven. I put them all into a set on Flickr, for feedback or whatever purpose, I’m not really sure. Anyway, I work better in top threes and sevens than fives and tens, so here’s my top three — and the rest of the seven are on Flickr.


‘quoth,’ a photo i like considerably more than i probably should.


‘like fireworks to water,’ a night shot that i’m really quite happy with.

A word about my host — NearlyFreeSpeech.NET

Thu 2011.12.29
by brian hefele

It’s mentioned on my about page, but I host this site, brainaxle.com, and the sites of several clients through NearlyFreeSpeech.NET. I also use their domain registration services. This is all partly due to price, but also due to their policies, which are very much pro-web. SOPA is very much anti-web. Another great thing about NFSN is their honest, direct communication with regard to technical issues, outages (rare!), and beliefs and policy. Their recent, level-headed blog post about SOPA is no exception. It’s a great read, especially for people hunting for a web host who will actually work for them.

Hopefully it’s obvious, but I’m not being compensated in any way for recommending NFSN. I’m their customer for the reasons I outlined above — not for any hidden incentive. But well thought-out customer communication like the aforelinked blog post really makes me want to help get the word out about their service.