add comments
This commit is contained in:
@@ -17,9 +17,9 @@ impl Agent for ComplexAgent {
|
||||
.collect::<Vec<(usize, usize)>>()
|
||||
})
|
||||
.map(|(i, j)| (i, j, board.move_would_propegate(i, j, self.color)))
|
||||
.filter(|&(_, _, c)| c >= 0)
|
||||
.filter(|&(_, _, c)| c >= 0) // a `c` value of less than 0 implies the move is invalid: TODO! make this an enum or smth
|
||||
.max_by_key(|&(_, _, c)| c)
|
||||
.map(|(i, j, _)| (i, j))
|
||||
.map(|(i, j, _)| (i, j)) // remove `c` and return the best move
|
||||
}
|
||||
|
||||
fn name(&self) -> &'static str {
|
||||
|
||||
Reference in New Issue
Block a user