Files
owenrees 946fc38756 Derive disjoint material family themes from each endgame's Key (#193)
Every endgame now belongs to exactly one material family derived from its Key:
pawn, rook, rook and pawn, queen, queen and pawn, minor piece, minor piece and
pawn, basic mate, king and pawn, or bare king other. The bare-king families are
split out because those positions teach a mating or promotion technique rather
than a general material class.

Family membership is objective, so a derivation pass owns links to its themes:
refreshing rewrites them as derived and removes a curated link that contradicts
the family, while technique themes are untouched. Re-running is idempotent.

A mix task applies the mapping to the whole library. Seeds add the king
technique themes for later human tagging.

Closes #186
2026-11-17 21:18:11 +01:00

114 lines
2.3 KiB
Elixir

defmodule Chesstrainer.Repo.Seeds.Endgames.Win do
def all do
[
%{
fen: "8/8/3k4/8/8/3K1R2/8/8 w - - 0 1",
color: :white,
message: "Rook vs king endgame",
notes: "Basic rook endgame",
result: :win
},
%{
fen: "8/8/8/1P4p1/5k2/5p2/P6K/8 b - - 0 0",
color: :black,
result: :win
},
%{
fen: "8/8/8/2p1k3/P6R/1K6/6rP/8 w - - 0 0",
color: :white,
result: :win
},
%{
fen: "8/7p/6p1/8/k7/8/2K3P1/8 b - - 0 0",
color: :black,
result: :win
},
%{
fen: "8/8/7k/8/8/8/5q2/3B2RK b - - 0 1",
color: :black,
result: :win
},
%{
fen: "6K1/8/5P1k/2R5/1r6/8/2p5/8 w - - 0 0",
color: :white,
result: :win
},
%{
fen: "8/r7/5PK1/3k4/p7/8/1R6/8 w - - 0 1",
color: :white,
result: :win
},
%{
fen: "R7/P4r2/5k2/3Kp3/8/8/8/8 w - - 0 0",
color: :white,
result: :win
},
%{
fen: "8/B2k4/1P3K2/3bP3/8/8/8/8 w - - 0 1",
color: :white,
result: :win
},
%{
fen: "K7/P2k4/8/8/8/8/r7/6R1 w - - 0 1",
color: :white,
result: :win,
themes: ["Lucena"]
},
%{
fen: "6K1/4k1P1/8/8/8/8/2r5/1R6 w - - 0 1",
color: :white,
result: :win,
themes: ["Lucena"]
},
%{
fen: "5K2/3k1P2/8/8/8/8/6r1/5R2 w - - 0 1",
color: :white,
result: :win,
themes: ["Lucena"]
},
%{
fen: "3K4/3P2k1/8/8/8/8/2r5/5R2 w - - 0 1",
color: :white,
result: :win,
themes: ["Lucena"]
},
%{
fen: "2K5/2P1k3/8/8/8/8/1r6/R7 w - - 0 1",
color: :white,
result: :win,
themes: ["Lucena"]
},
%{
fen: "7K/2k4P/8/8/8/8/7r/3R4 w - - 0 1",
color: :white,
result: :win,
themes: ["Lucena"]
},
%{
fen: "7K/3k3P/8/8/8/8/7r/4R3 w - - 0 1",
color: :white,
result: :win,
themes: ["Lucena"]
},
%{
fen: "7K/4k2P/8/8/8/8/7r/5R2 w - - 0 1",
color: :white,
result: :draw,
themes: ["Lucena"]
},
%{
fen: "K7/P4k2/8/8/8/8/r7/4R3 w - - 0 1",
color: :white,
result: :win,
themes: ["Lucena"]
},
%{
fen: "K7/P3k3/8/8/8/8/r7/6R1 w - - 0 1",
color: :white,
result: :win,
themes: ["Lucena"]
},
]
end
end