From 2f23ab85adb7ffc5866cc948bad0c35a7d41a05b Mon Sep 17 00:00:00 2001 From: Justin Wernick Date: Sun, 17 May 2020 20:05:33 +0200 Subject: Only match the good moves --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib.rs') 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 { .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| { -- cgit v1.2.3