From: Siraaj Khandkar Date: Fri, 27 Sep 2013 02:01:19 +0000 (-0400) Subject: Use a more idiomatic creator name. X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=b6599385e0cb497526b94ffa0cf4d881c036e534;p=cellular-automata.git Use a more idiomatic creator name. --- 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