This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open! Base | |
let input = | |
let parse_command part = | |
let direction = part.[0] in | |
let length = String.drop_prefix part 1 |> Int.of_string in | |
direction, length | |
in | |
Stdio.In_channel.read_lines "input" | |
|> List.map ~f:(fun line -> |