January 7th, 2008

This is a bug fix release.

  • When playing a closed game, the plugin no longer uses PHP sessions. This avoids problems with PHP configurations where output buffering is disabled (thus preventing cookies from being set correctly in the plugin) - this would manifest as an inability to post a move in a closed game. Note: this requires the WordPress nonce feature, which was introduced in WordPress 2.0.2.
  • When playing a closed game, users with Contributor access or lower (or those without the unfiltered_html capability) no longer corrupt the special div tags in the post after posting a move.
  • For closed games, players are now only required to have the Subscriber role. Unlike the previous version of the plugin, this should work in versions of WordPress prior to 2.2.
  • Draw offers, acceptance, and refusal should now work as intended.
  • A bug which allowed a player to force an opponent to castle in certain circumstances has been fixed.

As usual, here is the Chess By Blog blurb page.

And here’s the download - ChessByBlog-1.0.3.zip, 213 KiB.

Please post any questions or issues in the comments. Happy chess playing!

August 26th, 2007

Another new release!. Here’s the changelist:

  • Full support for Forsyth-Edwards Notation (FEN) has been added via the FEN tag. This allows for arbitrary positioning of pieces on the board.
  • Fischer Random Chess (aka Chess960) is now supported. You must specify the opening layout via a FEN tag. The castling rules specific to this variant are handled correctly.
  • Capablanca chess is now supported. The Archbishop and Chancellor pieces have been added. Capablanca Random Chess is also supported. Caveat: arbitrary positioning of the first rank is supported, but castling always follows Capablanca Random Chess rules (i.e. the King ends up on the c or i files). This is at odds with Capablanca-derived variants such as Embassy Chess.
  • Limited support has been added for arbitrary board sizes; the plugin detects the implied board size based on the FEN tag. Note that en passant, castling, and pawn promotion makes some assumptions which change based on the board size, and not all chess variants will work correctly.
  • For persistent games, users now only require Contributor access, not Editor access, in order to play the game. Note that this will only work with WordPress 2.2; users in WordPress 2.0 and 2.1 still require Editor access due to WordPress issues.
  • Because of the potential castling ambiguity caused by the random chess variants, castling must now be done via the new buttons, rather than by direct manipulation of the King piece on the board.
  • A bug in en passant capture has been fixed.
  • The server side now correctly escapes text before posting moves to the database. Previously there were SQL issues preventing some posts from being updated correctly.
  • Various cross-browser/platform user interface glitches have been fixed.
  • The default icons are now 32×32 instead of 44×44.

As usual, here is the Chess By Blog blurb page.

And here’s the download - ChessByBlog-1.0.2.zip, 212 KiB.

Please post any questions or issues in the comments. Happy chess playing!

August 25th, 2007

José Raúl Capablanca invented (or at least popularized) a chess variant played on a 10×8 board and named after him: Capablanca chess. There are two new pieces in it: a chancellor that moves as both a rook and a knight, and an archbishop that moves as both a bishop and a knight. These are pretty powerful pieces; for example, the archbishop can checkmate by itself (opposite king in a corner, archbishop two diagonal squares away).

While working on some user-requested features for Chess By Blog, I realised that supporting Capablanca chess wasn’t going to be a big deal. Behold:


Note that this isn’t quite the first rank layout that Capablanca envisioned; this is the layout for Embassy chess, itself a variant on Capablanca chess. (Confusing matters further, I’ve implemented the castling rules in the applet to follow Capablanca random chess.) Anyways, check it out on the board above. I haven’t played it against anyone yet, but so far it seems like the two new pieces make for a very different opening game from standard chess: the archbishop and chancellor wreak havoc on the midboard early since they jump over the pawns immediately. Very interesting!

On track for a Chess By Blog 1.0.2 tomorrow or Monday.

June 26th, 2007

June 24th, 2007

A new release, fairly minor. Here’s what’s changed:

  • Now compiled with Google Web Toolkit 1.4 Release Candidate. This automatically fixes the issue whereby viewers can get to your blog from different addresses (i.e. http://levork.org instead of http://www.levork.org) fail to see the chess board due to the Google Web Toolkit’s enforcement of the Single Origin Policy. There are also some speed and size enhancements that automatically come along with the upgrade.
  • The “bouncy resize” of the initial board seen by users of Internet Explorer 6 and 7 has been addressed.
  • In closed games there is now the ability to offer, accept or refuse a draw; also to resign.
  • Games which end in a draw, stalemate, checkmate, or resignation now automatically update the “Result” tag in the PGN.
  • An issue where “+” and “++” was stripped out of the PGN has been fixed.
  • The PGN parser was unable to handle moves ending in ‘=’ (indicating stalemate); now fixed.
  • The one-hour timeout between page view and move post is now reset with each move.

Here is the Chess By Blog blurb page.

Here’s the download - ChessByBlog-1.0.1.zip, 206 KiB.

Please post any questions or issues in the comments. Happy chess playing!

April 20th, 2007

I think it’s ready for release!

Here is the Chess By Blog blurb page.

Here’s the download - ChessByBlog-1.0.0.zip, 212 KiB.

Please post any questions or issues in the comments. Happy chess playing!

Here begins the testing of the chess wordpress plugin. Feel free to kibitz while we hash it out.


Screen capture of Chess applet written with GWT

My brother-in-law and I have been playing chess by e-mail for the last few months. This has been less than optimal: we use the old style English notation rather than algebraic notation, and he sets up a real board while I use Apple Chess, so there’s always some transcription from mail to board. Invariably one of us (usually me) gets something wrong, and we end up backtracking through mail history or making a stupid move that we didn’t intend.

We looked at web interfaces for chess by e-mail gateways, and none of them worked out acceptably for both of us. So finally I decided I’d program something. I decided to put together a client side using the Google Web Toolkit; I plan to integrate the back end with Wordpress as a PHP plugin.

The Google Web Toolkit (GWT) is pretty neat, even without diving into all the AJAX/RPC stuff which I might not need for this project. You program the client side in Java, using the GWT-supplied emulation of java.lang, java.util, plus their own classes which provide UI elements and control over the browser object model. During development, the GWT environment runs your code in a Java-enabled hosted browser; once done, it compiles your code into browser-specific Javascript. No Java plugin required.

The result of hacking this weekend: a Chess applet that runs in a browser. The applet itself is about 61 KiB depending on browser, plus 16 KiB for Google-supplied base code. You can play a new game on a blank board here. All chess rules except for pawn promotion are handled, including en passant and castling - you shouldn’t be able to input an invalid move. (If so, it’s a bug! Please let me know.) It should detect check, checkmate, and stalemate (by lack of move) correctly, and the game log should be maintained in proper algebraic notation. The applet can also load a movelist in PGN format (or at least a good subset of it), embedded directly on the web page - for example, here’s Fool’s Mate in 4 moves, view the page source to see the original PGN. For a more interesting problem, here’s Reshevsky vs. Fisher, 1970, black to move and win.

I burrowed the icons from XBoard, themselves generated from a METAFONT font. I noticed Wikipedia has SVG versions derived from same.

The Google Web Toolkit does have a few quirks. No java.util.StringTokenizer, but String.split sort of covers that. It also doesn’t completely cover cross-browser issues. I noticed some differences between regular expression handling (or maybe it was actually newline or whitespace issues in TextAreas), and because of Internet Explorer stupidity (lack of CSS support for min-width), and because I couldn’t figure out how to size an element after an image had guaranteed loading, I couldn’t successfully achieve my goal of getting all sizes and images controlled completely by a style sheet. I still have a ways to go before the client UI is as clean as I want, and with all the chess rules pushed to the client side, it isn’t as optimal as it should be. For example, you may have gotten a script incomplete warning while loading the last page: it’s churning through a lot of possible moves while dealing with PGN notation. Then there’s figuring out how to integrate this all with Wordpress properly. Once this is all done though, David and I can finally be rid of my KP1-KP3 gaffes.

© 1999-2008 Julian Fong