aboutsummaryrefslogtreecommitdiff
path: root/std
diff options
context:
space:
mode:
authorCody <cody@codyq.dev>2023-06-27 04:03:26 -0500
committerCody <cody@codyq.dev>2023-06-27 04:03:26 -0500
commit2cf498f7bf1311ebca156315a0c9ac25b0addef5 (patch)
treead216a67c0339f14908c98e744c9b617ff8bc0e2 /std
parent5d958f8af1646f9cb4763bb2f020bb2e6de8a3c0 (diff)
downloadsloth-2cf498f7bf1311ebca156315a0c9ac25b0addef5.tar.gz
Working conways game of life
Diffstat (limited to 'std')
-rw-r--r--std/stdio.c4
-rw-r--r--std/stdlib.c8
-rw-r--r--std/stdlib.sloth6
3 files changed, 10 insertions, 8 deletions
diff --git a/std/stdio.c b/std/stdio.c
index a257f67..d3ff5a0 100644
--- a/std/stdio.c
+++ b/std/stdio.c
@@ -14,3 +14,7 @@ void print(char *str) {
void termpos(int x, int y) {
printf("\x1b[%d;%dH", x, y);
}
+
+void termclear() {
+ printf("\x1b[2J\x1b[H");
+}
diff --git a/std/stdlib.c b/std/stdlib.c
index 9510866..b70f5b7 100644
--- a/std/stdlib.c
+++ b/std/stdlib.c
@@ -22,7 +22,7 @@ int as_int(float x) {
return (int) x;
}
-char* istr(int x) {
- char snum[100];
- return (char* )itoa(x, snum, 10);
-}
+// char* istr(int x) {
+// char snum[100];
+// return (char* )itoa(x, snum, 10);
+// }
diff --git a/std/stdlib.sloth b/std/stdlib.sloth
index 913fd0b..eb6000d 100644
--- a/std/stdlib.sloth
+++ b/std/stdlib.sloth
@@ -5,8 +5,6 @@ foreign fn slen(str: String) Int;
foreign fn parse_int(str: String) Int;
foreign fn termpos(x: Int, y: Int);
foreign fn as_int(x: Float) Int;
-foreign fn istr(x: Int) Int;
+#foreign fn istr(x: Int) Int;
-fn termclear() Void {
- print("\x1b[2J\x1b[H");
-}
+foreign fn termclear() Void;