From: Amélia Coutard-Sander Date: Thu, 12 Dec 2024 20:48:43 +0000 (+0100) Subject: Plus besoin des graphismes pour les automates eux mêmes X-Git-Url: https://git.ameliathe1st.gay/?a=commitdiff_plain;h=e648c703534d30c6c9da054ca58dba741d6b1639;p=cells.git Plus besoin des graphismes pour les automates eux mêmes Bien sûr, les graphismes restent nécessaires pour l'affichage. --- diff --git a/automata/automata.ml b/automata/automata.ml index 847918c..639bcee 100644 --- a/automata/automata.ml +++ b/automata/automata.ml @@ -28,7 +28,7 @@ module type Automaton = sig val next : t -> t - val color : t -> Graphics.color + val color : t -> char * char * char end let automata = [(module Life : Automaton); (module Wireworld : Automaton)] diff --git a/automata/automata.mli b/automata/automata.mli index 59a2c62..40a67b3 100644 --- a/automata/automata.mli +++ b/automata/automata.mli @@ -28,7 +28,7 @@ module type Automaton = sig val next : t -> t - val color : t -> Graphics.color + val color : t -> char * char * char end val automata : (module Automaton) list diff --git a/automata/automata/life.ml b/automata/automata/life.ml index 0ee7472..570ca4b 100644 --- a/automata/automata/life.ml +++ b/automata/automata/life.ml @@ -34,5 +34,5 @@ let next = function | Alive -> Dead let color = function - | Dead -> Graphics.rgb 0 0 31 - | Alive -> Graphics.rgb 255 255 255 + | Dead -> ('\x00', '\x00', '\x1F') + | Alive -> ('\xFF', '\xFF', '\xFF') diff --git a/automata/automata/wireworld.ml b/automata/automata/wireworld.ml index 023751c..9ca3451 100644 --- a/automata/automata/wireworld.ml +++ b/automata/automata/wireworld.ml @@ -42,7 +42,7 @@ let next = function | Tail -> Empty let color = function - | Empty -> Graphics.rgb 0 0 31 - | Conductor -> Graphics.rgb 191 191 0 - | Head -> Graphics.rgb 191 0 0 - | Tail -> Graphics.rgb 0 0 191 + | Empty -> ('\x00', '\x00', '\x1F') + | Conductor -> ('\xBF', '\xBF', '\x00') + | Head -> ('\xBF', '\x00', '\x00') + | Tail -> ('\x00', '\x00', '\xBF') diff --git a/automata/dune b/automata/dune index c503e3a..d1805a6 100644 --- a/automata/dune +++ b/automata/dune @@ -1,5 +1,4 @@ (include_subdirs unqualified) (library - (name automata) - (libraries graphics)) + (name automata))