From e648c703534d30c6c9da054ca58dba741d6b1639 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Am=C3=A9lia=20Coutard-Sander?= Date: Thu, 12 Dec 2024 21:48:43 +0100 Subject: [PATCH] =?utf8?q?Plus=20besoin=20des=20graphismes=20pour=20les=20?= =?utf8?q?automates=20eux=20m=C3=AAmes?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Bien sûr, les graphismes restent nécessaires pour l'affichage. --- automata/automata.ml | 2 +- automata/automata.mli | 2 +- automata/automata/life.ml | 4 ++-- automata/automata/wireworld.ml | 8 ++++---- automata/dune | 3 +-- 5 files changed, 9 insertions(+), 10 deletions(-) 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)) -- 2.46.0