From: Amélia Coutard-Sander Date: Sun, 5 Jan 2025 23:19:40 +0000 (+0100) Subject: Suppression de l'automate continu, il n'était pas fun X-Git-Url: https://git.ameliathe1st.gay/?a=commitdiff_plain;h=5d7bb17003834cc07dafc75023f279f3cd583212;p=cells.git Suppression de l'automate continu, il n'était pas fun --- diff --git a/automata/automata.ml b/automata/automata.ml index eaa8467..2d4dcb9 100644 --- a/automata/automata.ml +++ b/automata/automata.ml @@ -160,6 +160,5 @@ let automata = (module Life : Automaton); (module Wireworld : Automaton); (module Brain : Automaton); - (module Cont : Automaton); (module Maze : Automaton); ] diff --git a/automata/automata/cont.ml b/automata/automata/cont.ml deleted file mode 100644 index 0d0ec9e..0000000 --- a/automata/automata/cont.ml +++ /dev/null @@ -1,48 +0,0 @@ -(* Copyright 2024 Amélia COUTARD . - * - * 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 . - *) - -let name = "Automate continu random" - -type t = float - -type 'a neighbours = 'a list - -let neighbours = [(0, 0); (-1, 0); (0, -1); (0, 1); (1, 0)] - -let map = List.map - -let fold_left = List.fold_left - -let iter = List.iter - -let transition l = List.fold_left ( +. ) 0. l /. 5. - -let default = 0. - -let prev c = c -. 1. - -let next c = c +. 1. - -let color c = - let v = - (if c > 0. then (512. /. (1. +. Float.exp (-.c))) -. 256. else (512. /. (1. +. Float.exp c)) -. 256.) - |> int_of_float - |> char_of_int - in - if c > 0. then (v, '\x00', '\x00') else ('\x00', '\x00', v) - -let of_string = float_of_string - -let to_string = string_of_float