From: Amélia Coutard-Sander <git@ameliathe1st.gay>
Date: Fri, 13 Dec 2024 01:37:02 +0000 (+0100)
Subject: Vision du monde "infini"
X-Git-Url: https://git.ameliathe1st.gay/?a=commitdiff_plain;h=0aeaf33afcf5f35bdcc0d377b721984a072334a4;p=cells.git

Vision du monde "infini"

Un mensonge pour l'instant, le monde fait toujours 64×64 cellules, mais
j'adapte l'interface graphique pour qu'elle marche sans changements
quand j'étendrai le système à un monde infini.
---

diff --git a/bin/main.ml b/bin/main.ml
index a8060eb..dee50bd 100644
--- a/bin/main.ml
+++ b/bin/main.ml
@@ -21,8 +21,8 @@ let render
     (board : t Automata.board)
     (inter : t interface_state) =
         let module M = (val m) in
-        for x = 0 to 63 do
-          for y = 0 to 63 do
+        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));