We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
next
impl Iterator for MoveGen
I'm puzzled by this first case: https://github.com/jordanbray/chess/blob/main/src/movegen/movegen.rs#L302-L306
fn next(&mut self) -> Option<ChessMove> { if self.index >= self.moves.len() || self.moves[self.index].bitboard & self.iterator_mask == EMPTY { // are we done? None
Shouldn't we increase self.index before returning None?
self.index
None
The text was updated successfully, but these errors were encountered:
Ok, I guess this works without increasing self.index because of two properties:
self.moves
.bitboard
set_iterator_mask
I would then rephrase the above comment: // are we done? -> // we are done, or just remove it. It confused me a little.
// are we done?
// we are done
Sorry, something went wrong.
No branches or pull requests
I'm puzzled by this first case:
https://github.com/jordanbray/chess/blob/main/src/movegen/movegen.rs#L302-L306
Shouldn't we increase
self.index
before returningNone
?The text was updated successfully, but these errors were encountered: