
Shogi (しょうぎ) is an interesting Chess variant from Japan. Captured pieces may be returned to play, avoiding endgame attrition, and counterattacks after a failed offensive by the other player.
The Chess section on my blog contains other articles on Shogi.
MacShogi allows replay of Portable Shogi Notation (PSN) data, such as those hosted at Eric’s games collection. GNU Shogi allows practice play against a computer player based on GNU Chess.
PSN game data can be loaded into a database with psn-util.
$ psn-util psn2db *.psn
psn-util can also reconstruct PSN data, for example by querying the database for games where the Black King ends up in the bottom left corner. Lacking expertise in the Japanese Castling terms, I’m calling this castle the King Flees to Corner (KFC) maneuver (or あなぐま “bear in a hole” as I’ve since learned).
$ cat king-query.sql
select k.game_id from moves k, moves l
where k.move_text='K9i'
and l.move_text='L9h'
and k.game_id = l.game_id
$ psn-util db2psn < king-query.sql > results.psn
A fairly canonical version of this castle looks like:

See the source for psn-util for PostgreSQL database schema and sample queries to run.