White's last move?

You guys have proven to be quite capable chess detectives.
So here is one more mystery for you to solve:

What was White's last move?

• Board editor of this board.
– Paul
Jul 4, 2019 at 21:48

In the position shown,

white is in check, so the last move must have been made by black. The only positions the rook could have moved from already have white in check, and there's nothing that can have made a discovery, so black's only possible last move was to castle.

Now,

what did white do before that? The only "physically possible" moves are: K{g8,g7,h8}-h8; Q{g5,h5}-g4; N{e6,d5,d3}-f4. It's not immediately obvious which, so let's look a little further.

Before that

black can't have moved anything other than a pawn -- the K and R can't have moved because that would have prevented castling, and the other pieces have nowhere to move from. Again it's not clear how to narrow this down further, so let's look at some other things.

Black

has lost the KB, the KR, and nothing else. (And has promoted no pawns.) White captured something on f3; it can't have been the (dark-squared) KB, so it must have been the KR. How did it get out? Not via e8 because the king hasn't moved, hence via f7. So the f-pawn moved either to f6 or to f5 before that rook escaped. We could have had f7-f5, then R-f8-f6-out, then e7xf6; or f6, then R-f7 by some route, then e6xf5. I think that's all the possibilities but haven't checked super-carefully. Once again it's not obvious how to proceed so let's change tack again.

White

has lost one pawn, a light-squared bishop, and a rook. The Bh2 can't have escaped from behind b2 and d2, so in fact it's promoted. So the a-pawn captured the BKB on b4 or b6 and promoted on b8 to the bishop that now stands on h2; and black has captured one white bishop of each sort and a white rook. At least two of those captures were made by pawns. The WQB never left c1 so wasn't captured by a pawn; so black pawns captured (on the c and f files) the WKB and one white rook. What else? The BQB must have reached f1 via h3, so we had g2xf3 before h6. The BN on g1 must also have got there by that route before h3 was played. Also in that window: the WKB's escape from the back rank, heading for eventual capture on c6 or f5. Continuing to think about the order in which things happened: before the WP could promote, B must have captured on c6 or c5 with his b-pawn. Only after b7xc6 or b7-b6 can the BBc8 have escaped (to get eventually to its current location on f1).

So we have the following sequence of events.

White plays gxf3, capturing the BKR. Before that, black either captures on f6 or plays f7-f5. After white plays gxf3, in some order, these things happen: (a) the WKB escapes via h3, (b) the BQB gets to f1 via h3, (c) the BN gets to g1 via h3. At some point after (a), the WKB gets captured on either c6 or f5. And at some point after all of (a,b,c) white plays h2-h3.

Now,

this means that the WKB was captured on f6, not f5, because by the time it was anywhere capturable black had already either made a kingside pawn capture or put a pawn on f5 without capturing. So at some point after (a), black played b7xc6 capturing that bishop (and now note that (b) above must have happened after that); and then at some point after that the white a-pawn made its way down to b8 and became the bishop now on h2.

We still haven't figured out

exactly what happened on the kingside. A white rook was captured there, either on f6 or on f5. Before that could happen, either the white a-pawn must have reached the fourth rank or gxf3 must have been played. And, of course, at some point the WK somehow made its way to h8. And, also, at some point the BKB got out in order to be captured by the white a-pawn on either b4 or b6.

Suppose that

black played f5 before capturing on f6. The BKR must have escaped between those two occurrences. For this to be possible, the pawn on g7 must have moved, either to let the BKR past or to get the BKB off f8 or both. At this point, we have black pawns on f5 and g6, which means that once white has played gxf3 there is no way for the WKB to escape from the kingside in order to be captured on c6. So this won't do, and in fact black played e7xf6 before the BKR escaped. This capture, as we saw above, was of a WR. It can't have been the KR because at this point gxf3 hadn't been played, so the WKR couldn't escape "upward" (because the pawns were still in the way) nor "leftward" (because the Bf1 was still in the way). So it was the QR, so at this point the white a-pawn had already reached the fourth rank at least. I don't yet see any way to tell whether it went to a4 or played a3xb4 (in which case the BKB must have got out already, presumably via g7).

Now

before the BKR can get out to be captured on f3, black still needs to play f5 and f6. So is the WKB's situation any better? Yes, but only just. It needs to get out via g6! From there it can't reach the queenside via f7 because then it would be checking the BK, which mustn't move, so in fact it must go to g6, then h7, then g8, and then over to its eventual doom on c6. So we have h6 before g6.

So let's consider

how the WK got to his current position. He can't have gone via d7, e7, f7, all of which were attacked by the BK until the move black only just made. So the WK got in via g7 or h7. And we've just seen that black played h6 before g6, so in fact the WK went to g6, then h7, then h8.

We must now be quite close to having nailed down

which black pawn moved last. It wasn't either of the f-pawns, both of which had to move to get the BKR out. It wasn't the one on h6, which moved before the one on g6. It wasn't whichever one captured on c6, because that happened a while ago. So it was either the one on g6 or the one on c6. And it can't be the one on c6, because before the promoted WB on b8 could get out there had to be no black pawn on c7 any more. So black's last pawn move was g6.

So far, so good. But black

is still really short of moves. So far we know that the last few moves were WHITE-MOVE-A g6; WHITE-MOVE-B 0-0-0. Whatever those last two white moves were, somehow there must be some possible black move before WHITE-MOVE-A, and it must be a piece move because all the considerations above surrounding the other black pawns still apply. The only way to do that is if WHITE-MOVE-B is a queen move and WHITE-MOVE-A is Rg4-g3.

Aha!

WHITE-MOVE-B can't have been Qh5-g4 because on h5 the queen would have been giving check to the black king.

Therefore white's last move was

Qg5-g4.

It's possible that some of the reasoning above can be pruned without loss, but it's stupid o'clock and I need to go to bed. (It's also possible that some of the reasoning above is just plain wrong, for the same reason. My apologies if so.)

• Oh. How much time spend you to write this answer? Jul 4, 2019 at 9:47
• Some, but I was already up late :-). Jul 4, 2019 at 10:19
• (I'm sure some of the above can be skipped while still making the proof work, but I think quite a lot of it needs to stay. So the answer is never going to be really short. But I could be wrong...) Jul 4, 2019 at 10:21
• I think a legal game on its own shouldn't be a valid solution, because a priori it's possible that the answer might be something like "white's last move might be either X or Y", and just presenting a legal game in which the last move was X doesn't rule that out. if you explicitly add to the problem the stipulation that you can assume only one last move is possible -- which, of course, might reasonably be understood -- then just presenting a game is enough, but it feels to me like finding a possible answer and showing it's the only possible one are different things. Jul 4, 2019 at 12:40
• @North Aside from the typo issue, I think you should also have said explicitly where the queen was moving from, which in this sort of puzzle I think is part of what you're looking to find. The question is "what was the move?" not "what was the algebraic notation for the move?" and Qh5-g4 and Qg5-g4 are different moves even if you write them both as Qg4. Jul 4, 2019 at 15:51

Edit It's actually

Qg6

Unnecessarily long PGN (I'm sure it can be shortened will work on that)

1. a4 Nc6 2. Ra3 Na5 3. Re3 f5 4. Re6 Nh6 5. Rf6 exf6 6. Na3 Bb4 7. Nb5 Rf8 8. Nh3 Rf7 9. Nc3 Re7 10. Ng5 Re3 11. Nf7 Nb3 12. a5 Rf3 13. gxf3 Ng8 14. Bh3 Nxc1 15. Bg4 h6 16. Bh5 Ne7 17. Bg6 Nb3 18. Bh7 Ng6 19. Bg8 Qe7 20. Ng5 Nd4 21. Bd5 Qe5 22. Bc6 bxc6 23. Nce4 Bc5 24. Qb1 Bb6 25. Qa1 Nb3 26. axb6 Nc1 27. Qa5 Nd3+ 28. Kd1 c5 29. b7 c6 30. b8=B Ne1 31. Rg1 Nh4 32. Rg4 Nhg2 33. Nc3 Nf4 34. Bd6 Nh5 35. Nf7 Ng3 36. Qb4 Nh1 37. Kc1 Ba6 38. Kb1 Nd3 39. Ka2 Nf4 40. Nh8 Nh3 41. Kb3 Ng1 42. Ka3 Bc4 43. Rh4 Bf7 44. Bc7 Bh5 45. Kb3 Bg4 46. Kc4 Bh3 47. Ng6 Bf1 48. Ne7 Qg3 49. Rh5 Qg2 50. Kd3 Qg3 51. Ke3 Qh3 52. Kf4 Qg2 53. Rh3 Qg6 54. Rg3 Qf7 55. Rh3 Qd5 56. Rh4 Ng3 57. Ng6 Ne4 58. Nd1 Nc3 59. Kg3 Bg2 60. Rh3 Bf1 61. Kh4 Ne4 62. Kh5 Qd4 63. Ne5 Ng3+ 64. Kg6 Nh1 65. Kh7 Qg4 66. Rh5 Qg2 67. Ne3 Qh3 68. N3c4 Qg2 69. Ng6 Qg3 70. h3 Qg4 71. Ne3 Qg5 72. Nd5 Qg4 73. Qf4 Qg5 74. Qh4 Qg4 75. Bh2 Qg3 76. Qg4 Qg2 77. Nh4 Qg3 78. Nf4 Qg2 79. Rg5 Qg3 80. Rh5 Qg2 81. Qg5 Qg3 82. Nhg6 Bg2 83. Rh4 Qg4 84. Qh5 Qg3 85. Rg4 Bf1 86. Qg5 Qg2 87. Nh4 Qg3 88. Kh8 Qg2 89. Rg3 g6 90. Qg4 O-O-O+


Disproved
I'm thinking

Kh8 O-O-O+

Reasoning: The white king has to have moved to h8 before the black king castled, all other move would have the king move into the check or remain in check without white doing anything to block it.

The moves leading up to this solution will be posted soon

• Supposing you got black's last move right, there's not necessarily anything stopping a white's move from using the f knight or the queen? Note that this game is far from rational: white has never moved five of the pawns! Jul 4, 2019 at 0:31
• That's a fair point Jul 4, 2019 at 0:55
• Yeah, you're right lol Jul 4, 2019 at 1:11
• Here is the game on Lichess
– Paul
Jul 5, 2019 at 12:02

I have a correction to the solutions submitted. I need to point out that there are two possible final moves, since there could have been a discovered check. The final two moves could have been either

Rg4-g3 g7-g6 Qg5-g4 OOO+

or

Rg6-g3+ g7-g6 Qh5-g4 OOO+

I am sorry that I do not have the motivation to type the lengthy details of reasoning and sample games to give a complete solution. I hope that the early submissions cover most of them.

This is a wonderful composition.

• Absolutely correct! This simple discovered check retraction has been missed by the creator of this puzzle (that is, me). I'll go now and sit in the corner of shame. Jul 6, 2019 at 12:40

I tried to prove

black could not have castled.

And though I came close, it fails. I leave the analysis here for anyone else to use as reference

First, the white bishop on h2 must be a promoted pawn, since it could not be the bishop from c1 (couldn't have gotten out).

Second, there were only two black pawn captures. There are 3 white pieces missing (2 bishops and a rook), but one of the bishops was captured on c1, thus not by a pawn. One of the pawn captures was a rook and one was a white-square bishop on either c6 or f5

Third, the pawn on f3 must have captured from g2 before the Bishop on f1 could get out and get captured by a pawn. This capture must have been the black rook, since the missing black pieces are a black-squared bishop, and a rook

But, which rook? if the white white-square bishop was captured on f5, then the h8 rook could not get out to get captured on f3 to release the bishop, so it must have been the a8 rook, and thus black can't queenside castle. If the white white-square bishop was captured on c6, then the rook was captured on f6 or f5. At this point I thought the pawn structure was in place before the capture on f3 and the release of the bishop, and that the bishop can not get from f1 to c6 to get captured. But the pawn on g6 must not have moved yet at this point and the white bishop gets out (and the black bishop gets in) via g6.

Now, that doesn't help determine what did happen, but I think it shows what didn't!

• If Black didn't castle, how could the white king come into check? The rook can only move along the line where the white king is, this is not possible without castling. Jul 4, 2019 at 8:43
• @infinitezero Well yeah, castling must have happened, but this answer shows that it couldn't have happened. So the question contains an unreachable position and there is no sane answer to what white's last move was.
– Paul
Jul 4, 2019 at 23:39
• Is accepted answer wrong then? Jul 5, 2019 at 2:09
• i think my logic is wrong somewhere. :( Jul 5, 2019 at 2:50
• I think the mistake is in the next-to-last sentence in your spoiler block. Jul 5, 2019 at 4:34