# Most ways to uncheck the king

Here's my attempt at a chess puzzle

Your task is to construct a legal chess position where:

• It is black's turn to move
• Black is in check
• Black has the greatest number of different legal moves possible

(A legal chess position is a position reachable during a normal game of chess)

For example:

Here, black has 4 different moves to get out of check (Qxh1, Bh2, Kg3, Kg2)

I was able to construct a position with 39 different moves. What's the best you can do?

## 4 Answers

Eeny meeny myny moo (or however you want to spell that)

42!
break down by kind of piece: K:6 Q:15 R:2 B:3 N:8 p:8 (4 promotions each)

• Whoa! Well done. – Gareth McCaughan Nov 27 '20 at 1:03
• Congrats! Might i suggest you add some brief explanation for how many moves each type of piece has – thesilican Nov 27 '20 at 1:06
• Ah, the different kind of pawn promotions is kind of tricky, but still technically different move! – justhalf Nov 27 '20 at 8:14
• @JulienLopez No, in that case the king loses 2 moves and bishop gains only 1 so -1 total. – quarague Nov 27 '20 at 11:06
• @chrylis-cautiouslyoptimistic- with Q not a legal position (too many promoted pieces). – Paul Panzer Nov 29 '20 at 2:05

I can do

40 ways, with this position: 6r1/2n4b/1qqqqq2/R6k/1qqqqb2/2n5/8/KB4r1 w - - 0 1
Each of the nine queens (one original, eight promoted) has 3 saving moves. Each knight has 2, as has the dark-squared bishop. The two rooks and the light-squared bishop have 1 each. The king has 4. Total: 27+6+3+4=40.

Could we do better?

I don't think any Q can get more than 3 saves, nor any R/N/B more than 2, nor the K more than 6. (Unless the check is from a knight or a pawn, but those greatly reduce the options for other pieces to have multiple saves.) So we can't hope for more than 27+12+6=45. I briefly entertained hopes that we could do better by keeping a lot of pawns on the board and putting the check along B's eighth rank, since then each pawn promotion can happen in four different ways, but the best I've been able to do along those lines while keeping the position plausibly legal has 6 pawns, one of which can capture as well as just promoting, for 28 moves, plus two knights with another 2 each, a Q or R to capture the checking piece on the a/h-file, and a B tucked in at the other side to block in one way: total 28+4+1+1=34. I think the constraints imposed by running the check along one edge of the board outweigh the gains from pawn promotions, especially as most of the pawns can only have 4 blocking moves which is only a little better than a Q can do. ... Though I have just seen Paul Panzer's answer, which equals my 40 by using the pawn-promotion idea more intelligently than I did, so maybe it can be made better still after all.

• Nice job, but don't forget to add the white king to the board to create a legal position – thesilican Nov 26 '20 at 23:56
• Yes, I just noticed that too :-). – Gareth McCaughan Nov 26 '20 at 23:57
• @thesilican I think you should un-accept this and accept Paul P's improved one. – Gareth McCaughan Nov 27 '20 at 1:04

Here is another

40
number of legal moves per kind of piece K:1 N:8 B:1 R:2 p:28 (each pawn has 4 different promotion options and the f2 one can either capture or move on)

• Oh, that's nice. I tried something similar but was a bit less clever about it than you and didn't get so many options. – Gareth McCaughan Nov 27 '20 at 0:02
• @GarethMcCaughan I've taken the liberty to splice your and my solutions together, see separate answer. – Paul Panzer Nov 27 '20 at 0:59

For sake of completness, here was my original 39 move solution:

Two of the four knights are promoted black pawns The idea was to create a position with as many black pawns ready to promote as possible, as each pawn could make up to 4 different moves. However, Paul Panzer's solution managed to squeeze in an extra black move with better positioning and a g-file rook instead of an a-file rook