New Feature: En Passant

There have been a number of requests for en passant support, and I’m planning on tackling this soon. I’d like to first get it polished on the website and then implement the same on the iPhone app.

My thought is to treat en passant like a piece which can be freely dragged to any square in ranks 3 or 6. Something like this:

The website would then send to the engine the en passant target whenever the X piece has been placed on the board.

What do you think?

I’m working on icons to represent en passant. Three candidates are below. Is there a standard graphical way to represent en passant?

Personally I like the 3rd icon the most because it seems that an “X” is convention and simpler icons work best! However, it might be nice to have the 2nd icon (the “X” with the words) as the drag icon and have an “X” on the board so that lit’ noobs will understand what the “X” represents.

I hope I explained that well.

This is a good feature-- keep up the good work with NCM!

That’s a really good idea - it helps keep some of the distraction off the board! Is the X displayed here on Wikipedia pretty typical?

Thanks for being the first to post on the forums, BTW! :slight_smile:

I have basic en passant support deployed – check it out and let me know what you think! I couldn’t find a position that triggers the computer do an en passant capture, but I did verify that the data is being sent to the engine.

Please let me know if any of you can get the engine to do an en passant capture, and send me the FEN link! I resorted to some hackery to test the FEN capture animations. The animations seemed to work but it would be good validation to see it happen on its own!

Well that was quick! :smile:

I can confirm it works with this situation I invented: FEN:

I think the “X” is convention and works well graphically so don’t worry about that.

I can’t test the animation because I don’t have the mobile version (one of the few people that don’t own a mobile).

The only suggestion for improvement I’d have is that it would be nice to have the en passant automatically be placed when you move a pawn up 2 spaces but that might be asking too much. I ask this because I read in the Wikipedia article on FEN that: “If there’s no en passant target square, this is “-” [as you already have implemented]. If a pawn has just made a two-square move, this is the position “behind” the pawn. This is recorded regardless of whether there is a pawn in position to make an en passant capture”. At any rate, it works as is!

Love the forums too BTW very clean, it’s a pity not more people have signed up.

Thank you, that link is perfect! It turns out that there was a bug in the animation, but it’s fixed now. You should actually be able to see that on a non-mobile device – you just have to click on the move text it will be animated on the board. My analytics are showing that the move text isn’t clicked too often, so I suspect that many don’t realize it does that.

Good call on automatically placing the en passant target – I’ll take a stab at this.

I’m Getting Icons On Both My Bishops And The King On The Website, Is Anyone Else Getting THis ??

Eek – this probably a caching issue. Can you try a hard-refresh in the browser? I think holding down Shift and clicking the refresh button usually works.

Sorry about this! I’ll dig in to the cause.

Thanks as always!

Turns out I broke it. It should be fixed now – thanks much for reporting this!

I’ve pushed out another en passant change. Now, when a pawn moves two squares the en passant target icon is automatically placed if and only if the pawn is susceptible to an en passant capture.

I initially had it placing the maker whenever a pawn moves two spaces, but that was confusing GNUChess’s book moves. Specifically, GNUChess refused to use the book for opening moves when given an en passant target in the FEN.

I had a bug with an en passant situation today, where it was clearly the next best move but the gnu just couldnt calculate the next step, and threw out ‘error’ message. The X mark moved from where it was originally too: after the program decided to make a black pawn move to a spott leaving it vulnerable to an en passant capture, I switched to white to move and as I hit the calculate the X mark moved to some random square near the white’s bishop or something, can’t send a link cause i lost it but i could regenerate the plays