tangled
alpha
login
or
join now
gearsco.de
/
starfish
2
fork
atom
A chess library for Gleam
2
fork
atom
overview
issues
pulls
pipelines
Fix insufficient material detection
gearsco.de
6 months ago
209d916a
e6be74c5
+7
-4
1 changed file
expand all
collapse all
unified
split
src
starfish
internal
game.gleam
+7
-4
src/starfish/internal/game.gleam
···
464
464
}
465
465
466
466
pub fn is_insufficient_material(game: Game) -> Bool {
467
467
-
{
468
468
-
game.black_pieces.pawn_material == 0 && game.white_pieces.pawn_material == 0
469
469
-
}
467
467
+
game.black_pieces.pawn_material == 0
468
468
+
&& game.white_pieces.pawn_material == 0
470
469
&& {
471
470
game.black_pieces.non_pawn_material == board.bishop_value
472
471
|| game.black_pieces.non_pawn_material == board.knight_value
473
473
-
|| game.white_pieces.non_pawn_material == board.bishop_value
472
472
+
|| game.black_pieces.non_pawn_material == 0
473
473
+
}
474
474
+
&& {
475
475
+
game.white_pieces.non_pawn_material == board.bishop_value
474
476
|| game.white_pieces.non_pawn_material == board.knight_value
477
477
+
|| game.white_pieces.non_pawn_material == 0
475
478
}
476
479
}
477
480