diff --git a/lab01/lab1.ml b/lab01/lab1.ml index aa1c705..5626673 100644 --- a/lab01/lab1.ml +++ b/lab01/lab1.ml @@ -117,7 +117,8 @@ let test_dedup () = assert (dedup [] = []); assert (dedup [1] = [1]); assert (dedup [1; 2] = [1; 2]); - assert (dedup [1; 1; 2; 2; 2; 1; 3; 3; 2] = [1; 2; 1; 3; 2]) + assert (dedup [1; 1; 2; 2; 2; 1; 3; 3; 2] = [1; 2; 1; 3; 2]); + assert (dedup [1; 1; 2; 2; 2; 1; 3; 3; 2; 4] = [1; 2; 1; 3; 2; 4]) (**/**) (** [dedup l] takes in a list [l] and collapses consecutive duplicated @@ -126,10 +127,10 @@ let dedup_tr l = let rec dedup' acc l = match l with | [] -> acc - | [x] -> l + | [x] -> reverse_tr (x :: acc) | x :: y :: zs -> - if x = y then dedup' (x :: acc) (x :: zs) - else x :: dedup' (x :: acc) (y :: zs) + if x = y then dedup' acc (x :: zs) + else dedup' (x :: acc) (y :: zs) in dedup' [] l;; diff --git a/tinker/cube b/tinker/cube index 56fd73a..a2f69fb 100755 Binary files a/tinker/cube and b/tinker/cube differ diff --git a/tinker/cube.ml b/tinker/cube.ml index fd897ce..fe0e324 100644 --- a/tinker/cube.ml +++ b/tinker/cube.ml @@ -125,6 +125,6 @@ let () = auto_synchronize false; - spin_cube 0.; + spin_cube 0. 100; close_graph ()