From a0fba205f099276cfd9c076d63abcca20f9fe2cf Mon Sep 17 00:00:00 2001
From: =?utf8?q?Am=C3=A9lia=20Coutard-Sander?= <git@ameliathe1st.gay>
Date: Fri, 13 Dec 2024 14:13:43 +0100
Subject: [PATCH] Simplification du code d'affichage de la couleur des cellules

---
 bin/main.ml | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/bin/main.ml b/bin/main.ml
index 9169e02..0c2c005 100644
--- a/bin/main.ml
+++ b/bin/main.ml
@@ -23,17 +23,17 @@ let render
         let module M = (val m) in
         for x = 0 to (Graphics.size_x () / 16) + 1 do
           for y = 0 to (Graphics.size_y () / 16) + 1 do
-            Graphics.set_color
-              (let r, g, b = M.color (Automata.get x y board) in
-               Graphics.rgb (int_of_char r) (int_of_char g) (int_of_char b));
+            let r, g, b = M.color (Automata.get x y board) in
+            let r, g, b = (int_of_char r, int_of_char g, int_of_char b) in
+            Graphics.set_color (Graphics.rgb r g b);
             Graphics.fill_rect (x * 16) (y * 16) 16 16;
             Graphics.set_color (Graphics.rgb 127 127 127);
             Graphics.draw_rect (x * 16) (y * 16) 16 16
           done
         done;
-        Graphics.set_color
-          (let r, g, b = M.color inter.current in
-           Graphics.rgb (int_of_char r) (int_of_char g) (int_of_char b));
+        let r, g, b = M.color inter.current in
+        let r, g, b = (int_of_char r, int_of_char g, int_of_char b) in
+        Graphics.set_color (Graphics.rgb r g b);
         Graphics.fill_rect ((inter.x * 16) + 5) ((inter.y * 16) + 5) 6 6;
         Graphics.set_color (Graphics.rgb 127 127 127);
         Graphics.draw_rect ((inter.x * 16) + 5) ((inter.y * 16) + 5) 6 6
-- 
2.46.0