tangled
alpha
login
or
join now
gearsco.de
/
starfish
2
fork
atom
A chess library for Gleam
2
fork
atom
overview
issues
pulls
pipelines
Add support for generating En Passant moves
gearsco.de
6 months ago
375f3dd8
7a6db26a
+8
1 changed file
expand all
collapse all
unified
split
src
starfish
internal
move.gleam
+8
src/starfish/internal/move.gleam
···
86
86
Capture(from: position, to: new_position),
87
87
..moves
88
88
]
89
89
+
Ok(board.Empty) if game.en_passant_square == Some(new_position) -> [
90
90
+
EnPassant(from: position, to: new_position),
91
91
+
..moves
92
92
+
]
89
93
Ok(board.Empty) | Ok(board.Occupied(_, _)) | Error(_) -> moves
90
94
}
91
95
···
93
97
case iv.get(game.board, new_position) {
94
98
Ok(board.Occupied(colour:, ..)) if colour != game.to_move -> [
95
99
Capture(from: position, to: new_position),
100
100
+
..moves
101
101
+
]
102
102
+
Ok(board.Empty) if game.en_passant_square == Some(new_position) -> [
103
103
+
EnPassant(from: position, to: new_position),
96
104
..moves
97
105
]
98
106
Ok(board.Empty) | Ok(board.Occupied(_, _)) | Error(_) -> moves