diff options
author | Santo Cariotti <santo@dcariotti.me> | 2024-02-09 11:45:18 +0100 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2024-02-09 11:45:18 +0100 |
commit | 8ff53967fac0ba5c8cee1a248a38e8e0ad1b72ee (patch) | |
tree | 46d45d1be6df9ef9e7624d38e7cedeb5ad7a58fb /2023/ocaml/day2/_build/default/bin | |
parent | db2686c798378738020a0951a521358586e21aa0 (diff) |
Remove OCaml build
Diffstat (limited to '2023/ocaml/day2/_build/default/bin')
-rw-r--r-- | 2023/ocaml/day2/_build/default/bin/.main.eobjs/byte/dune__exe__Main.cmi | bin | 205 -> 0 bytes | |||
-rw-r--r-- | 2023/ocaml/day2/_build/default/bin/.main.eobjs/byte/dune__exe__Main.cmti | bin | 2368 -> 0 bytes | |||
-rw-r--r-- | 2023/ocaml/day2/_build/default/bin/.main.eobjs/native/dune__exe__Main.cmx | bin | 552 -> 0 bytes | |||
-rw-r--r-- | 2023/ocaml/day2/_build/default/bin/.main.eobjs/native/dune__exe__Main.o | bin | 15200 -> 0 bytes | |||
-rw-r--r-- | 2023/ocaml/day2/_build/default/bin/.merlin-conf/exe-main | bin | 620 -> 0 bytes | |||
-rwxr-xr-x | 2023/ocaml/day2/_build/default/bin/main.exe | bin | 2254592 -> 0 bytes | |||
-rw-r--r-- | 2023/ocaml/day2/_build/default/bin/main.ml | 39 | ||||
-rw-r--r-- | 2023/ocaml/day2/_build/default/bin/main.mli | 1 |
8 files changed, 0 insertions, 40 deletions
diff --git a/2023/ocaml/day2/_build/default/bin/.main.eobjs/byte/dune__exe__Main.cmi b/2023/ocaml/day2/_build/default/bin/.main.eobjs/byte/dune__exe__Main.cmi Binary files differdeleted file mode 100644 index 1886df9..0000000 --- a/2023/ocaml/day2/_build/default/bin/.main.eobjs/byte/dune__exe__Main.cmi +++ /dev/null diff --git a/2023/ocaml/day2/_build/default/bin/.main.eobjs/byte/dune__exe__Main.cmti b/2023/ocaml/day2/_build/default/bin/.main.eobjs/byte/dune__exe__Main.cmti Binary files differdeleted file mode 100644 index 87d60ff..0000000 --- a/2023/ocaml/day2/_build/default/bin/.main.eobjs/byte/dune__exe__Main.cmti +++ /dev/null diff --git a/2023/ocaml/day2/_build/default/bin/.main.eobjs/native/dune__exe__Main.cmx b/2023/ocaml/day2/_build/default/bin/.main.eobjs/native/dune__exe__Main.cmx Binary files differdeleted file mode 100644 index fdc4cf6..0000000 --- a/2023/ocaml/day2/_build/default/bin/.main.eobjs/native/dune__exe__Main.cmx +++ /dev/null diff --git a/2023/ocaml/day2/_build/default/bin/.main.eobjs/native/dune__exe__Main.o b/2023/ocaml/day2/_build/default/bin/.main.eobjs/native/dune__exe__Main.o Binary files differdeleted file mode 100644 index 7bbc169..0000000 --- a/2023/ocaml/day2/_build/default/bin/.main.eobjs/native/dune__exe__Main.o +++ /dev/null diff --git a/2023/ocaml/day2/_build/default/bin/.merlin-conf/exe-main b/2023/ocaml/day2/_build/default/bin/.merlin-conf/exe-main Binary files differdeleted file mode 100644 index 647fe64..0000000 --- a/2023/ocaml/day2/_build/default/bin/.merlin-conf/exe-main +++ /dev/null diff --git a/2023/ocaml/day2/_build/default/bin/main.exe b/2023/ocaml/day2/_build/default/bin/main.exe Binary files differdeleted file mode 100755 index 1b3c926..0000000 --- a/2023/ocaml/day2/_build/default/bin/main.exe +++ /dev/null diff --git a/2023/ocaml/day2/_build/default/bin/main.ml b/2023/ocaml/day2/_build/default/bin/main.ml deleted file mode 100644 index 6dba854..0000000 --- a/2023/ocaml/day2/_build/default/bin/main.ml +++ /dev/null @@ -1,39 +0,0 @@ -let input_file = "input.txt" - -let read_file f = - let ic = open_in f in - try - let lines = really_input_string ic (in_channel_length ic) in - let lines = String.trim lines in - close_in ic ; - lines - with e -> - close_in_noerr ic; - raise e - -let rec parse ?(result=0) body = - match body with - | [] -> result - | x :: tail -> - let plays = String.split_on_char ':' x - |> List.rev - |> List.hd - |> String.split_on_char ';' - |> List.map (String.split_on_char ',') - |> List.map (List.map @@ String.trim) - |> List.map (List.map (fun x -> (List.hd (String.split_on_char ' ' x) |> int_of_string, String.get (List.nth (String.split_on_char ' ' x) 1 ) 0))) - in - - - let points = List.map (List.map (fun (p,c) -> if (c = 'r' && p > 12) || (c = 'g' && p > 13) || (c = 'b' && p > 14) then 0 else 1)) plays in - let add = if List.length (List.filter (fun x -> List.length x > 0) @@ List.map (List.filter (fun x -> x = 0)) points) = 0 then - String.split_on_char ':' x |> List.hd |> String.split_on_char ' ' |> List.rev |> List.hd |> int_of_string - else - 0 in - - parse tail ~result:(result+add) - - -let () = - let result = parse (String.split_on_char '\n' (read_file input_file)) in - Printf.printf "%d" result diff --git a/2023/ocaml/day2/_build/default/bin/main.mli b/2023/ocaml/day2/_build/default/bin/main.mli deleted file mode 100644 index 335ae1f..0000000 --- a/2023/ocaml/day2/_build/default/bin/main.mli +++ /dev/null @@ -1 +0,0 @@ -(* Auto-generated by Dune *)
\ No newline at end of file |