summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2023-06-10 19:06:23 +0200
committerkdx <kikoodx@paranoici.org>2023-06-10 19:06:23 +0200
commitb3e5203f6260cb400d7c73b56f91eddea6b24502 (patch)
tree74340c09ded42716147444de38eb7f1a43e6b310 /samples
parenta4a117871b56e72fc1638c6561d2d3670de929dc (diff)
downloadgolem-b3e5203f6260cb400d7c73b56f91eddea6b24502.tar.gz
string literal
Diffstat (limited to 'samples')
-rw-r--r--samples/helloworld.golem15
1 files changed, 15 insertions, 0 deletions
diff --git a/samples/helloworld.golem b/samples/helloworld.golem
index d1758ac..aac5202 100644
--- a/samples/helloworld.golem
+++ b/samples/helloworld.golem
@@ -3,6 +3,9 @@ global str[32];
main() {
local i;
+ print("uwu");
+ wrt '\n';
+
strappend(str, 'H');
strappend(str, 'e');
strappend(str, 'L');
@@ -27,6 +30,18 @@ main() {
}
}
+strcpy(dst, src) {
+ local rv;
+ rv = dst;
+ loop {
+ [dst] = [src];
+ src = src + 1;
+ if ([src] == 0)
+ return rv;
+ dst = dst + 1;
+ }
+}
+
strappend(s, c) {
loop {
if ([s] == 0) {