aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/hello.sloth3
-rw-r--r--examples/hello2.sloth11
2 files changed, 13 insertions, 1 deletions
diff --git a/examples/hello.sloth b/examples/hello.sloth
index fea5304..8b395e8 100644
--- a/examples/hello.sloth
+++ b/examples/hello.sloth
@@ -1,8 +1,9 @@
fn main() {
var i: Int = 10;
- var j: Int = int(1.0) - 1;
+ var j: Int = 1.0 - 1;
while i > j {
i = i - 1;
}
+ example(i);
}
diff --git a/examples/hello2.sloth b/examples/hello2.sloth
new file mode 100644
index 0000000..589d969
--- /dev/null
+++ b/examples/hello2.sloth
@@ -0,0 +1,11 @@
+fn example() {}
+
+fn main() {
+ var i: Int = 10;
+ var j: Int = 1.0 - 1;
+ while i > j {
+ i = i - 1;
+ }
+ example(i);
+}
+