Fix fragile pattern-matching.
[cellular-automata.git] / polymorphic-life / 001 / src / polymorphic_life.ml
index e25bbf6..4a28992 100644 (file)
@@ -85,7 +85,8 @@ module Conway : CELL = struct
     | D -> " "
     | A -> "o"
 
-  let init () = Random.int 2 |> of_int
+  let init () =
+    Random.int 2 |> of_int
 
   let state = to_int
 
@@ -96,7 +97,8 @@ module Conway : CELL = struct
     | A when live_neighbors < 4 -> A
     | A when live_neighbors > 3 -> D
     | D when live_neighbors = 3 -> A
-    | t -> t
+    | A -> A
+    | D -> D
 end
 
 
This page took 0.024604 seconds and 4 git commands to generate.