From b6599385e0cb497526b94ffa0cf4d881c036e534 Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Thu, 26 Sep 2013 22:01:19 -0400 Subject: [PATCH] Use a more idiomatic creator name. --- polymorphic-life/001/src/polymorphic_life.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/polymorphic-life/001/src/polymorphic_life.ml b/polymorphic-life/001/src/polymorphic_life.ml index 544136c..b93a79d 100644 --- a/polymorphic-life/001/src/polymorphic_life.ml +++ b/polymorphic-life/001/src/polymorphic_life.ml @@ -59,7 +59,7 @@ end module type CELL = sig type t - val init : unit -> t + val create : unit -> t val to_string : t -> string @@ -85,7 +85,7 @@ module Conway : CELL = struct | D -> " " | A -> "o" - let init () = + let create () = Random.int 2 |> of_int let state = to_int @@ -104,7 +104,7 @@ end let main rows cols () = Random.self_init (); - let grid = Matrix.create ~rows ~cols ~data:() |> Matrix.map ~f:Conway.init in + let grid = Matrix.create ~rows ~cols ~data:() |> Matrix.map ~f:Conway.create in Matrix.print grid ~to_string:Conway.to_string -- 2.20.1