From c784f50963a3086e10d028a27849c1ee7a08e75a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Am=C3=A9lia=20Coutard-Sander?= Date: Fri, 13 Dec 2024 15:51:32 +0100 Subject: [PATCH] Ordre plus intuitif pour les cellules du Cerveau --- automata/automata/brain.ml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/automata/automata/brain.ml b/automata/automata/brain.ml index fbd5efc..0429a70 100644 --- a/automata/automata/brain.ml +++ b/automata/automata/brain.ml @@ -15,7 +15,7 @@ let name = "Le Cerveau de Brian" -type t = Off | Dying | On +type t = Off | On | Dying let neighbours = [(-1, -1); (-1, 0); (-1, 1); (0, -1); (0, 1); (1, -1); (1, 0); (1, 1)] @@ -23,22 +23,22 @@ let transition l = function | Off -> let n = List.length (List.filter (( = ) On) l) in if n = 2 then On else Off - | Dying -> Off | On -> Dying + | Dying -> Off let default = Off let prev = function - | Off -> On - | Dying -> Off - | On -> Dying - -let next = function | Off -> Dying - | Dying -> On | On -> Off + | Dying -> On + +let next = function + | Off -> On + | On -> Dying + | Dying -> Off let color = function | Off -> ('\x00', '\x00', '\x1F') - | Dying -> ('\x00', '\x00', '\xFF') | On -> ('\xFF', '\xFF', '\xFF') + | Dying -> ('\x00', '\x00', '\xFF') -- 2.46.0