From: Amélia Coutard-Sander Date: Wed, 7 Jan 2026 13:38:51 +0000 (+0100) Subject: Plus besoin des graphismes pour les automates eux mêmes X-Git-Url: https://git.f4mnq.fr/?a=commitdiff_plain;h=4deef347ab0e65988fb02f271254aa7637f3d06a;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 53bb973..1646095 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 4b12998..74da410 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 f5afcc4..1399730 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 c9c9b60..e6a02ee 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))