aboutsummaryrefslogtreecommitdiff
path: root/std/stdlib.sloth
diff options
context:
space:
mode:
authorCody <cody@codyq.dev>2023-06-25 23:23:36 -0500
committerCody <cody@codyq.dev>2023-06-25 23:23:36 -0500
commit91ac969f992521b665bb41c1c024a5f69ca6df67 (patch)
tree8562a40e5be385bb7d7f4a69d0840fc8493c71d9 /std/stdlib.sloth
parentae4c1af949c7230c07b2a7cc86a2e4031c37f651 (diff)
parentc3bb1751d7f62a13a46f28c1eb67d9e20d8d6f7f (diff)
downloadsloth-91ac969f992521b665bb41c1c024a5f69ca6df67.tar.gz
Merge branch 'master' of github.com:slothlang/sloth
Diffstat (limited to 'std/stdlib.sloth')
-rw-r--r--std/stdlib.sloth17
1 files changed, 17 insertions, 0 deletions
diff --git a/std/stdlib.sloth b/std/stdlib.sloth
new file mode 100644
index 0000000..d7ddeff
--- /dev/null
+++ b/std/stdlib.sloth
@@ -0,0 +1,17 @@
+foreign fn wait(x: Int) Void;
+foreign fn print(str: String) Void;
+foreign fn slen(str: String) Int;
+foreign fn charAt(str: String) Char;
+foreign fn parse_int(str: String) Int;
+
+fn termpos(x: int, y: int) Void {
+ print("\x1b[");
+ print(x);
+ print(";");
+ print(y);
+ print("H");
+}
+
+fn termclear() Void {
+ print("\x1b[2J\x1b[H");
+}