aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authornic-gaffney <gaffney_nic@protonmail.com>2023-04-12 21:17:18 -0500
committernic-gaffney <gaffney_nic@protonmail.com>2023-04-12 21:17:18 -0500
commit93b2afeda3a0f413ec7df2b411a53973f2d7a8a6 (patch)
tree93ec7d7324a13b2e7191c831d7be977d6e5adc90 /examples
parent6449ff2c0582bec9f8289ef643ce867311a18218 (diff)
downloadsloth-93b2afeda3a0f413ec7df2b411a53973f2d7a8a6.tar.gz
Guessing game has explicit types now
Diffstat (limited to 'examples')
-rw-r--r--examples/guessing.sloth8
1 files changed, 4 insertions, 4 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!");