From: Amélia Coutard-Sander Date: Fri, 13 Dec 2024 13:13:43 +0000 (+0100) Subject: Simplification du code d'affichage de la couleur des cellules X-Git-Url: https://git.ameliathe1st.gay/?a=commitdiff_plain;h=a0fba205f099276cfd9c076d63abcca20f9fe2cf;p=cells.git Simplification du code d'affichage de la couleur des cellules --- 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