Array.init 64 (fun y ->
M.transition (List.map (fun (dx, dy) -> get (x + dx) (y + dy) board) M.neighbours) cells.(x).(y))) )
-let automata = [(module Life : Automaton); (module Wireworld : Automaton); (module Brain : Automaton)]
+let automata =
+ [
+ (module Life : Automaton);
+ (module Wireworld : Automaton);
+ (module Brain : Automaton);
+ (module Cont : Automaton);
+ ]
--- /dev/null
+(* Copyright 2024 Amélia COUTARD <https://www.ameliathe1st.gay>.
+ *
+ * This file from the program cells is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License along
+ * with this program. If not, see <https://www.gnu.org/licenses/>.
+ *)
+
+let name = "Automate continu random"
+
+type t = float
+
+let neighbours = [(-1, 0); (0, -1); (0, 1); (1, 0)]
+
+let transition l c = List.fold_left ( +. ) c l /. 5.
+
+let default = 0.
+
+let prev c = c -. 1.
+
+let next c = c +. 1.
+
+let color c =
+ let v = 256. /. (1. +. Float.exp (-.c)) |> int_of_float |> char_of_int in
+ (v, v, v)