Chess Loop Challenge
Place chess pieces (Knights, Bishops, Rooks, Queens, Kings, no pawns) on an
r × c grid so that:
- Each piece attacks exactly one other piece.
- A piece may not attack a piece of the same type (a Knight may not attack another Knight).
- The pieces form a single attacking chain that loops (one big cycle, no stragglers).
Sliders (B, R, Q) attack only the first piece along each ray; pieces behind it are shielded. Coordinates are 0-indexed with (0,0) top-left.
Pieces & base values
| piece | base value | attacks | |
|---|---|---|---|
| ♞ | Knight (N) | 3 | the 8 knight-move squares; never blocked |
| ♝ | Bishop (B) | 3 | diagonal rays, blocked by first piece hit |
| ♜ | Rook (R) | 5 | orthogonal rays, blocked by first piece hit |
| ♛ | Queen (Q) | 9 | orthogonal + diagonal rays, blocked by first piece hit |
| ♚ | King (K) | 4 | the 8 adjacent squares |
Scoring
Base values are the piece's worth on an 8×8 board. Values are board-size dependent: a piece scales up on larger boards with the square of how far it reaches.
piece_value(t, r, c) = max(base, round(base × (mobility(t, r, c) / mobility(t, 8, 8))2))board_score = ∑ piece_value ÷ (r × c), or 0 if the board is invalid.total_score = ∑ board_scoreover every board in your submission.
mobility(t, r, c) is the average number of squares a piece of type t attacks over every square of an empty r × c board.
Base: N 3B 3R 5Q 9K 4
Board builder
Click an empty square to place the selected piece, click a piece to remove it, or drag a piece to move it. Red arrows show attacks: solid where a link is valid, dashed where it breaks a rule. All scoring here is client-side.
Click a size to view that board; click an empty size to start building it.
Status
Score
Piece values
Submit your solution
boards.json to submit it.
The builder above is a playground - submissions come from an uploaded
boards.json (see solution.py in the brief). Copies of the
example solution are rejected. Submissions can only be made every 30 minutes.