about summary refs log tree commit diff
path: root/examples/game_of_life.rh
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2021-11-14 19:55:18 +0100
committerMel <einebeere@gmail.com>2021-11-14 19:55:18 +0100
commit89fcc9a395f2aa9744d507d79d29aa117b89fa7e (patch)
treeebe813355dacfe99342eb0c8ef0d9fcc5d83fc46 /examples/game_of_life.rh
parenta8eb28c81176c25f9688ce352aa5f14e04393098 (diff)
downloadrabbithole-89fcc9a395f2aa9744d507d79d29aa117b89fa7e.tar.zst
rabbithole-89fcc9a395f2aa9744d507d79d29aa117b89fa7e.zip
Update GoL example with Str embeds and escape seqs.
Diffstat (limited to 'examples/game_of_life.rh')
-rw-r--r--examples/game_of_life.rh5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/game_of_life.rh b/examples/game_of_life.rh
index 4d6f9bb..a9da2bc 100644
--- a/examples/game_of_life.rh
+++ b/examples/game_of_life.rh
@@ -63,6 +63,7 @@ loop {
 
     # Print field.
     y = 0;
+    field_str = "";
     loop if y < FIELD_HEIGHT {
         row = "";
 
@@ -75,11 +76,11 @@ loop {
             };
             x = x + 1;
         };
-        print row;
+        field_str = "{field_str}{row}\n";
         y = y + 1;
     };
 
-    print "";
+    print field_str;
 
     field = new_field;
 };
\ No newline at end of file