aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/guessing.sloth8
-rw-r--r--examples/hello.sloth2
2 files changed, 5 insertions, 5 deletions
diff --git a/examples/guessing.sloth b/examples/guessing.sloth
index 1938269..05c25db 100644
--- a/examples/guessing.sloth
+++ b/examples/guessing.sloth
@@ -1,11 +1,11 @@
-val computer = random(1, 10);
+val computer: int = random(1, 10);
-var tries = 0;
-var correct = false;
+var tries: int = 0;
+var correct: bool = false;
while !correct {
print("\nPick a number between 1 and 10: ");
- val human = parse_int(readln());
+ val human: int = parse_int(readln());
if human == computer {
println("You guessed the same number as me!");
diff --git a/examples/hello.sloth b/examples/hello.sloth
index 3dbc685..8201dae 100644
--- a/examples/hello.sloth
+++ b/examples/hello.sloth
@@ -1,6 +1,6 @@
print("Hello World!");
-## A basic for loop greeting the user in multiple languages
+# Comment
for greeting in ["Hello", "Hola", "你好"] {
print(greeting + " World!");
}