This commit is contained in:
Vincent Velociter
2024-08-01 12:54:49 +02:00
parent f9b9e0e75a
commit 6d154d261f
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -81,7 +81,7 @@ extension type const File._(int value) implements int {
/// Gets the chessboard [File] from a file index between 0 and 7.
const File(this.value) : assert(value >= 0 && value < 8);
/// Gets a [File] its name in algebraic notation.
/// Gets a [File] from its name in algebraic notation.
///
/// Throws a [FormatException] if the algebraic notation is invalid.
factory File.fromName(String algebraic) {
+1 -1
View File
@@ -2654,7 +2654,7 @@ SquareSet _pseudoLegalMoves(Position pos, Square square, _Context context) {
}
pseudo = pseudo & captureTargets;
final delta = pos.turn == Side.white ? 8 : -8;
final step = square.value + delta;
final step = square + delta;
if (0 <= step && step < 64 && !pos.board.occupied.has(Square(step))) {
pseudo = pseudo.withSquare(Square(step));
final canDoubleStep =