add diagonal support
This commit is contained in:
parent
8eed946c98
commit
37658c7bd0
@ -105,7 +105,13 @@ impl Board {
|
||||
.map(|range| range.into_iter().map(|j| (i, j)).collect()),
|
||||
);
|
||||
|
||||
// TODO! add diagonals to `chains` here
|
||||
chains.extend(
|
||||
split_from(0, BOARD_SIZE - 1, i)
|
||||
.into_iter()
|
||||
.zip(split_from(0, BOARD_SIZE - 1, j))
|
||||
.map(|(i_vec, j_vec)| i_vec.into_iter().zip(j_vec))
|
||||
.map(|x| x.into_iter().map(|(i, j)| (i, j)).collect()),
|
||||
);
|
||||
|
||||
let mut captured: usize = 0;
|
||||
|
||||
|
||||
@ -51,11 +51,9 @@ impl Game {
|
||||
|
||||
println!("{}", self);
|
||||
|
||||
// return;
|
||||
|
||||
self.step(i);
|
||||
|
||||
// std::thread::sleep(Duration::from_millis(200));
|
||||
std::thread::sleep(Duration::from_millis(200));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user