diff options
author | kdx <kikoodx@paranoici.org> | 2023-06-10 17:40:16 +0200 |
---|---|---|
committer | kdx <kikoodx@paranoici.org> | 2023-06-10 17:40:16 +0200 |
commit | 5e9f115e2d938a47a3d3db42188b837d4b57891a (patch) | |
tree | cf26c1ab4992b77961c10fce0e82fce0b057643b /samples | |
parent | 11d4688d8bec78efc5aee1a668ea0ba8193e5ec2 (diff) | |
download | golem-5e9f115e2d938a47a3d3db42188b837d4b57891a.tar.gz |
that was kinda stupid
Diffstat (limited to 'samples')
-rw-r--r-- | samples/helloworld.golem | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/samples/helloworld.golem b/samples/helloworld.golem index 5ddde54..6609a51 100644 --- a/samples/helloworld.golem +++ b/samples/helloworld.golem @@ -1,6 +1,9 @@ global str[32]; +global str_i = 0; main() { + local i; + strappend('H'); strappend('e'); strappend('l'); @@ -15,18 +18,18 @@ main() { strappend('!'); strappend('\n'); - print(str); -} - -strappend(c) { - local s; - s = str; + i = 0; loop { - if ([s] == 0) + i = i + 1; + if (i > 9) break; - s = s + 1; + print(str); } - [s] = c; +} + +strappend(c) { + [str+str_i] = c; + str_i = str_i + 1; } print(s) { |