Curious Bug

I was playing the Chess game in Clubhouse Games on the Nintendo DS last night, and I’ve discovered a bug that can occur in a very unusual situation. Normally, the game quite rightly allows you to only make legal moves. For example, when in check, the only legal moves are those moves which get you out of check, either by (a) capturing the attacking piece, (b) blocking the attack or (c) moving the king in such a way that he is no longer in check.

However, it looks like the programmers of Clubhouse Games, when writing support for the en passant rule, gave en passant moves more importance than they should have, making them always valid moves (even when they shouldn’t be). Consider the scenario below:

Chessboard showing how to break Clubhouse Games with an en passant move

Black moves his pawn two squares forward, putting white’s king in check through his bishop. At this point, the only valid moves for white should involve moving the king out of check. However, Clubhouse Games will also accept the white pawn capturing the black pawn en passant as valid.

Of course, being a bit of a geek, I felt compelled to do this (illegal) move, just to see how the game engine handled it. The result was that I was told that I had lost, and then the whole game crashed and locked up.

Sloppy coding there, guys, which could easily have been avoided by putting the valid move check after the special moves. I wonder if similar problems affect castling…

Geek Night At Rory’s

Tonight’s Geek Night will be hosted by Rory (follow that second link for a map to his place if you don’t know where it is – don’t worry, it’s easy to find).

What would people like me to take there? I’m thinking Carcassonne, because it’s been getting a lot of enjoyable playtime recently and there’s rulesets we still haven’t played in recent times, the Treehouse sets, and perhaps something light-hearted like Chez Geek (it’s been a knackering week for me, so don’t expect too much in the way of intelligent play from me tonight). I assume Rory‘s projector takes component inputs in case anybody needs rules projected (which I hope is the case, because I’ve been looking for an excuse to try out the TV-out and PowerPoint viewer on my phone).