From 89fcc9a395f2aa9744d507d79d29aa117b89fa7e Mon Sep 17 00:00:00 2001 From: Mel Date: Sun, 14 Nov 2021 19:55:18 +0100 Subject: Update GoL example with Str embeds and escape seqs. --- examples/game_of_life.rh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'examples') 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 -- cgit 1.4.1