Chess puzzle I found in my dad's old book
106 points by Eswo 3 days ago | 29 comments

dllu 6 hours ago
Neat. Surprisingly, there are 388 solutions, and a lot of them look rather unintuitive.

    ........
    ...Q....
    ........
    ........
    .....Q..
    ........
    ........
    Q..B..Q.

    Q.......
    ........
    ........
    ........
    ..QQB..Q
    ........
    ........
    ........
My original intuition was to place the queens on unique rows and columns to cover as much as possible but it turns out there are solutions with three of them on the same row.

Python script: https://gist.github.com/dllu/698d5f71b2b9735c5c462ddf4a2f6fc...

Here's how it works:

0. precompute the attack patterns of each possible queen/bishop location as a bitmask, stored as an integer

1. generate candidate solutions, allowing attack rays to pass through other pieces, by brute forcing the positions of the 5 pieces and taking the bitwise OR of their attacks

2. out of the candidate solutions, check which ones are actually valid taking into account occlusion. Actually, you only need to check if the queen's horizontal attack is blocked by the bishop, as queens cannot block each other (the blocking queen herself has the same attacks so they effectively pass through each other).

reply
sobellian 4 hours ago
I used CP-SAT to enumerate the solutions. A heuristic for "interesting" solutions is those which only admit one valid bishop placement. For example:

    ........
    Q..B..Q.
    ........
    ........
    .......Q
    ........
    ........
    ...Q....
Where the bishop lies at the intersection of three queens' horizontal attacks. With these queens, no other bishop placement works.
reply
aaron695 2 hours ago
[dead]
reply
NooneAtAll3 4 hours ago
is there a solution where all the pieces are covered as well?
reply
hammock 16 minutes ago
The trick for me was to place a queen (most anywhere, but start with a corner it’s easier), then check and look for the spot with the most reds around it (eg 9, or 8, or 7), place the next queen there, repeat. Then place the bishop as needed.

The key was realizing the proximal spaces next to the placed queen are the most important to cover. Forget about trying to have a long reach, it comes naturally.

reply
tromp 6 hours ago
> The task is to place four black queens and one black bishop on the chessboard so that there is no square not under their attack. In other words, after arranging the five black pieces, it must be impossible to place the white king anywhere without it being in checkmate.

That last word should be "check". not "checkmate". A king next to an unprotected queen will be in check but not checkmate as it can capture the queen.

reply
nojs 2 hours ago
Yeah, the solution given is actually wrong as stated!
reply
jhncls 4 hours ago
Although unlikely, maybe there exists a solution where all black pieces are protected?
reply
yunwal 3 hours ago
If there is, it's not listed as the solution on the puzzle website
reply
maest 3 hours ago
> In other words, after arranging the five black pieces, it must be impossible to place the white king anywhere without it being in checkmate.

I think this is a bit ambiguous and, strictly speaking, wrong for the solution as given.

In particular, this asks for the king to be in check _mate_. Does this require all black pieces to defend each other? Otherwise, white king on the board would not be in checkmate if you place it next to a queen and can immediately capture.

From the solution, you can see it's not a checkmate requirement, just a check requirement.

reply
tantalor 6 hours ago
Really nice but I wish I didn't have to click "Check" every time after moving the pieces. It could do that automatically.
reply
hatthew 3 hours ago
I put `setInterval(checkBoard, 100)` in the console to do it automatically.
reply
smitty1110 2 hours ago
The solutions that look like a pinwheel are oddly satisfying, that was a fun little exercise. Thanks OP, I needed that diversion.
reply
etothet 2 hours ago
Seems like a variation of this game called Chess Peace: https://chesspeace.app
reply
pimlottc 3 hours ago
Please don’t use red and green for the colors in the “check” mode, it’s hard to tell apart for colorblind people (especially against the partially shaded black squares).

In fact, there isn’t really a need for two colors. Just color the squares that are threatened by the pieces and leave the rest blank. The meaning will be obvious.

reply
hatthew 3 hours ago
I solved it with this, a pleasingly symmetric solution. I was surprised that a solution exists with all the queens in a row.

    . . . . . . . .
    . . . . . . . Q
    . . B . . . . .
    . . . . . Q . .
    . . . . . . . .
    . . . Q . . . .
    . . . . . . . .
    . Q . . . . . .
reply
archargelod 3 hours ago
I found this solution (actually, it's 4 solutions, each B is a different Bishop placement and at the same time it's the only 4 spots on the board not covered by queens):

    . B . . . . . .
    . . . . . . Q .
    . . . B . . . .
    Q . . . . . . .
    . . . . . B . .
    . . Q . . . . .
    . . . . . . . B
    . . . . Q . . .
reply
aidenn0 3 hours ago
More surprising to me is that there's a solution with no pieces on black.
reply
ra0x3 5 hours ago
Wait, the instructions are a little ambiguous. I clicked "Solution" and it has the dark-squared bishop on a white square! XD

Should maybe update the instructions to clarify that the dark-squared bishop is not constrained to dark squares.

reply
loganc2342 5 hours ago
It's a black bishop, but not necessarily a dark-squared bishop. Both the black side and white side in a normal chess game get a dark-squared and a light-squared bishop, and I don't see anywhere that specifies which type this one is. It can be either one depending on where you place it.
reply
sltkr 4 hours ago
Also if you care that much just mirror the solution horizontally or vertically, and now your bishop is on the white square instead.
reply
danbrooks 5 hours ago
The instructions likely mean that the bishop itself is black, not the square that it is on.
reply
dwa3592 4 hours ago
that's exactly what happened to me. I ended up spending so much time thinking black bishop can only go to black squares. and agreed this is a bit ambiguous.
reply
maest 3 hours ago
You can rotate any solution by 90 degrees, which would toggle the square colour of your bishop, so it doesn't ultimately matter.
reply
NooneAtAll3 4 hours ago
> The task is to place four black queens and one black bishop on the chessboard

where did you read "dark-squared"?

reply
wrqvrwvq 5 hours ago
fun demo. could be a daily puzzle combining various commenter suggestions. There are (didn't verify personally) 388 solutions. The daily puzzle could remove 1+ pieces and ask for a 1+ move guess.

Also a click on a square could auto place a queen and a second click would swap to the bishop. Every click could auto-check.

A separate discovery mode could start blocking out the squares visually as you place pieces. For a lot of people, that would be easier than the mental representation.

reply
coherentpony 3 hours ago
> The task is to place four black queens and one black bishop on the chessboard so that there is no square not under their attack

> In other words, after arranging the five black pieces, it must be impossible to place the white king anywhere without it being in checkmate.

These two sentences mean very different things in the normal rules of chess. And if you replace the word “checkmate” with the word “check” in the second sentence it still doesn’t mean the same thing as the first sentence.

The first sentence implies that all the pieces must be defended.

Edit: Eh, I guess it depends on how you view the word “attack” since all the pieces are the same colour.

reply
c4kar 6 hours ago
That was an experience. Thank you
reply
Trufa 4 hours ago
Mildly related, if anyone want another chess minigame (I did this just in case).

https://knight-queen-game.netlify.app/

reply
neuroelectron 4 hours ago
I've definitely seen this puzzle before. of course I can't recall where
reply