diff options
| author | Mel <einebeere@gmail.com> | 2021-11-14 19:55:18 +0100 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2021-11-14 19:55:18 +0100 |
| commit | 89fcc9a395f2aa9744d507d79d29aa117b89fa7e (patch) | |
| tree | ebe813355dacfe99342eb0c8ef0d9fcc5d83fc46 /examples/game_of_life.rh | |
| parent | a8eb28c81176c25f9688ce352aa5f14e04393098 (diff) | |
| download | rabbithole-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.rh | 5 |
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 |
