there is no turning back

This commit is contained in:
2024-12-17 01:45:16 +01:00
parent 64b22c52d3
commit 9f007ee467

View File

@@ -108,14 +108,6 @@ let rotate_dir_left dir =
| 'v' -> '>' | 'v' -> '>'
| _ -> raise (Invalid_argument "Invalid direction") | _ -> raise (Invalid_argument "Invalid direction")
let rotate_dir_back dir =
match dir with
| '<' -> '>'
| '>' -> '<'
| '^' -> 'v'
| 'v' -> '^'
| _ -> raise (Invalid_argument "Invalid direction")
let walk_forward state = let walk_forward state =
{state with pos = add_int_pair state.pos (get_dir_vector state.dir); score = state.score + 1 } {state with pos = add_int_pair state.pos (get_dir_vector state.dir); score = state.score + 1 }