removed useless imports
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
open Printf;;
|
open Printf;;
|
||||||
open String;;
|
|
||||||
|
|
||||||
let rec build_list in_file =
|
let rec build_list in_file =
|
||||||
try
|
try
|
||||||
@@ -15,7 +14,7 @@ let is_not_empty lst =
|
|||||||
| _ -> true
|
| _ -> true
|
||||||
|
|
||||||
let rec parse_list (l1, l2) str =
|
let rec parse_list (l1, l2) str =
|
||||||
let list1 = (List.filter (fun a -> length a != 0) (String.split_on_char ' ' str)) in
|
let list1 = (List.filter (fun a -> String.length a != 0) (String.split_on_char ' ' str)) in
|
||||||
let list_of_int = List.map int_of_string list1 in
|
let list_of_int = List.map int_of_string list1 in
|
||||||
match list_of_int with
|
match list_of_int with
|
||||||
| e1 :: e2 :: _ -> (e1 :: l1, e2 :: l2)
|
| e1 :: e2 :: _ -> (e1 :: l1, e2 :: l2)
|
||||||
|
@@ -1,6 +1,4 @@
|
|||||||
open Printf;;
|
open Printf;;
|
||||||
open String;;
|
|
||||||
open Map;;
|
|
||||||
|
|
||||||
let rec list_of_lines in_file =
|
let rec list_of_lines in_file =
|
||||||
try
|
try
|
||||||
@@ -12,7 +10,7 @@ let rec list_of_lines in_file =
|
|||||||
|
|
||||||
let file_to_2d_array in_file =
|
let file_to_2d_array in_file =
|
||||||
let lines = list_of_lines in_file in
|
let lines = list_of_lines in_file in
|
||||||
let size_x = length @@ List.hd lines in
|
let size_x = String.length @@ List.hd lines in
|
||||||
let size_y = List.length lines in
|
let size_y = List.length lines in
|
||||||
let arr = Array.make_matrix size_x size_y '?' in
|
let arr = Array.make_matrix size_x size_y '?' in
|
||||||
List.iteri (fun j line -> String.iteri (fun i c -> arr.(j).(i) <- c) line) lines;
|
List.iteri (fun j line -> String.iteri (fun i c -> arr.(j).(i) <- c) line) lines;
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
open Printf;;
|
open Printf;;
|
||||||
open String;;
|
|
||||||
|
|
||||||
let rec list_of_lines in_file =
|
let rec list_of_lines in_file =
|
||||||
try
|
try
|
||||||
@@ -15,7 +14,7 @@ let is_not_empty lst =
|
|||||||
| _ -> true
|
| _ -> true
|
||||||
|
|
||||||
let rec parse_int_list str =
|
let rec parse_int_list str =
|
||||||
let list1 = (List.filter (fun a -> length a != 0) (String.split_on_char ' ' str)) in
|
let list1 = (List.filter (fun a -> String.length a != 0) (String.split_on_char ' ' str)) in
|
||||||
List.map int_of_string list1
|
List.map int_of_string list1
|
||||||
|
|
||||||
let rec int_list_diff int_list =
|
let rec int_list_diff int_list =
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
open Printf;;
|
open Printf;;
|
||||||
open String;;
|
|
||||||
open Str;;
|
open Str;;
|
||||||
|
|
||||||
let read_whole_file f =
|
let read_whole_file f =
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
open Printf;;
|
open Printf;;
|
||||||
open Buffer;;
|
open Buffer;;
|
||||||
open String;;
|
|
||||||
open Str;;
|
open Str;;
|
||||||
|
|
||||||
let rec list_of_lines in_file =
|
let rec list_of_lines in_file =
|
||||||
@@ -13,7 +12,7 @@ let rec list_of_lines in_file =
|
|||||||
|
|
||||||
let file_to_2d_array in_file =
|
let file_to_2d_array in_file =
|
||||||
let lines = list_of_lines in_file in
|
let lines = list_of_lines in_file in
|
||||||
let size_x = length @@ List.hd lines in
|
let size_x = String.length @@ List.hd lines in
|
||||||
let size_y = List.length lines in
|
let size_y = List.length lines in
|
||||||
let arr = Array.make_matrix size_x size_y '?' in
|
let arr = Array.make_matrix size_x size_y '?' in
|
||||||
List.iteri (fun j line -> String.iteri (fun i c -> arr.(j).(i) <- c) line) lines;
|
List.iteri (fun j line -> String.iteri (fun i c -> arr.(j).(i) <- c) line) lines;
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
open Printf;;
|
open Printf;;
|
||||||
open String;;
|
|
||||||
open Map;;
|
open Map;;
|
||||||
|
|
||||||
let rec list_of_lines in_file =
|
let rec list_of_lines in_file =
|
||||||
@@ -11,7 +10,7 @@ let rec list_of_lines in_file =
|
|||||||
[]
|
[]
|
||||||
|
|
||||||
let rec parse_int_list sep str =
|
let rec parse_int_list sep str =
|
||||||
let list1 = (List.filter (fun a -> length a != 0) (String.split_on_char sep str)) in
|
let list1 = (List.filter (fun a -> String.length a != 0) (String.split_on_char sep str)) in
|
||||||
List.map int_of_string list1
|
List.map int_of_string list1
|
||||||
|
|
||||||
(* Ordering map is a map that indexes int and maps it into a set of ints,
|
(* Ordering map is a map that indexes int and maps it into a set of ints,
|
||||||
@@ -22,7 +21,7 @@ module IntSet = Set.Make(Int)
|
|||||||
let rec parse_ordering lines ordering_map =
|
let rec parse_ordering lines ordering_map =
|
||||||
match lines with
|
match lines with
|
||||||
| head :: tail ->
|
| head :: tail ->
|
||||||
if length head > 0 then
|
if String.length head > 0 then
|
||||||
let elems = parse_int_list '|' head in
|
let elems = parse_int_list '|' head in
|
||||||
let e1 = List.hd elems in
|
let e1 = List.hd elems in
|
||||||
let e2 = List.nth elems 1 in
|
let e2 = List.nth elems 1 in
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
open Printf;;
|
open Printf;;
|
||||||
open String;;
|
|
||||||
|
|
||||||
let rec list_of_lines in_file =
|
let rec list_of_lines in_file =
|
||||||
try
|
try
|
||||||
@@ -11,7 +10,7 @@ let rec list_of_lines in_file =
|
|||||||
|
|
||||||
let file_to_2d_array in_file =
|
let file_to_2d_array in_file =
|
||||||
let lines = list_of_lines in_file in
|
let lines = list_of_lines in_file in
|
||||||
let size_x = length @@ List.hd lines in
|
let size_x = String.length @@ List.hd lines in
|
||||||
let size_y = List.length lines in
|
let size_y = List.length lines in
|
||||||
let arr = Array.make_matrix size_x size_y '?' in
|
let arr = Array.make_matrix size_x size_y '?' in
|
||||||
List.iteri (fun j line -> String.iteri (fun i c -> arr.(j).(i) <- c) line) lines;
|
List.iteri (fun j line -> String.iteri (fun i c -> arr.(j).(i) <- c) line) lines;
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
open Printf;;
|
open Printf;;
|
||||||
open String;;
|
|
||||||
|
|
||||||
let rec list_of_lines in_file =
|
let rec list_of_lines in_file =
|
||||||
try
|
try
|
||||||
@@ -13,7 +12,7 @@ let clean_string str =
|
|||||||
str |> String.split_on_char ':' |> List.hd
|
str |> String.split_on_char ':' |> List.hd
|
||||||
|
|
||||||
let rec parse_int_list sep str =
|
let rec parse_int_list sep str =
|
||||||
let list1 = (List.filter (fun a -> length a != 0) (String.split_on_char sep str)) in
|
let list1 = (List.filter (fun a -> String.length a != 0) (String.split_on_char sep str)) in
|
||||||
List.map (fun x -> int_of_string @@ clean_string x) list1
|
List.map (fun x -> int_of_string @@ clean_string x) list1
|
||||||
|
|
||||||
let rec is_possible_inner goal operand_list =
|
let rec is_possible_inner goal operand_list =
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
open Printf;;
|
open Printf;;
|
||||||
open String;;
|
|
||||||
open Map;;
|
open Map;;
|
||||||
|
|
||||||
let rec list_of_lines in_file =
|
let rec list_of_lines in_file =
|
||||||
@@ -12,7 +11,7 @@ let rec list_of_lines in_file =
|
|||||||
|
|
||||||
let file_to_2d_array in_file =
|
let file_to_2d_array in_file =
|
||||||
let lines = list_of_lines in_file in
|
let lines = list_of_lines in_file in
|
||||||
let size_x = length @@ List.hd lines in
|
let size_x = String.length @@ List.hd lines in
|
||||||
let size_y = List.length lines in
|
let size_y = List.length lines in
|
||||||
let arr = Array.make_matrix size_x size_y '?' in
|
let arr = Array.make_matrix size_x size_y '?' in
|
||||||
List.iteri (fun j line -> String.iteri (fun i c -> arr.(j).(i) <- c) line) lines;
|
List.iteri (fun j line -> String.iteri (fun i c -> arr.(j).(i) <- c) line) lines;
|
||||||
|
Reference in New Issue
Block a user