summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorJustin Wernick <justin@worthe-it.co.za>2020-05-17 20:05:33 +0200
committerJustin Wernick <justin@worthe-it.co.za>2020-05-17 20:05:33 +0200
commit2f23ab85adb7ffc5866cc948bad0c35a7d41a05b (patch)
tree27ace87492fbb95fd29694b9e44215a49c879b1a /src/lib.rs
parentd28628822e172cf232e5a86764110870baf6fc39 (diff)
Only match the good moves
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 519b804..c36a817 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -128,7 +128,7 @@ fn shortest_path_first_command(initial_state: &GameState) -> Option<Command> {
.zip(shortest_path_states.0.iter().skip(1))
.map(|(state, next)| {
let player_move = state
- .valid_moves(0)
+ .good_moves(0)
.into_iter()
.filter(|player_move| *player_move != Command::UseOil)
.find(|player_move| {