aboutsummaryrefslogtreecommitdiff
path: root/examples/hello.sloth
diff options
context:
space:
mode:
Diffstat (limited to 'examples/hello.sloth')
-rw-r--r--examples/hello.sloth19
1 files changed, 19 insertions, 0 deletions
diff --git a/examples/hello.sloth b/examples/hello.sloth
index 8abb65c..75071c3 100644
--- a/examples/hello.sloth
+++ b/examples/hello.sloth
@@ -1,4 +1,23 @@
+foreign fn printdeez(nutz: Int);
+foreign fn print(str: String);
+foreign fn randGen(min: Int, max: Int) Int;
+
fn main() Int {
+ var x: [Int] = [5];
+ vpopi(x);
+ var i: Int = 0;
+ while i < 100 {
+ vpushi(x, randGen(0, 100));
+ i = i + 1;
+ }
+
+ var y: Int = vgeti(x, 42);
+ var y: Int = vgeti(x, 45);
+ var y: Int = vgeti(x, 41);
+ var y: Int = vgeti(x, 49);
+ printdeez(y);
+
+
print("Hello World\n");
return 0;
}