mirror of
https://github.com/TheRealOwenRees/chess-endgame-trainer.git
synced 2026-11-18 03:32:06 +00:00
Reject out-of-range endgame FENs at entry (#25)
Add FEN.piece_count/1 and reject positions with more than 7 pieces in the Endgame changeset, so an 8+ piece FEN fails at entry instead of saving and then blocking at play. Accumulate all FEN issues rather than letting a later check overwrite an earlier one, and guard the seed FENs with a test (dropping the out-of-range seed that bypassed the changeset).
This commit is contained in:
@@ -8,11 +8,6 @@ defmodule Chesstrainer.Repo.Seeds.Endgames do
|
||||
notes: "Basic rook endgame",
|
||||
result: :win
|
||||
},
|
||||
%{
|
||||
fen: "3k4/2n2B2/1KP5/2B2p2/5b1p/7P/8/8 b - - 0 0",
|
||||
color: :black,
|
||||
result: :win
|
||||
},
|
||||
%{
|
||||
fen: "r7/4R2P/3p4/3k1K2/2p5/8/8/8 b - - 0 0",
|
||||
color: :black,
|
||||
|
||||
Reference in New Issue
Block a user