aboutsummaryrefslogtreecommitdiff
path: root/examples/guessing.sloth
diff options
context:
space:
mode:
authornic-gaffney <gaffney_nic@protonmail.com>2023-04-11 20:30:43 -0500
committernic-gaffney <gaffney_nic@protonmail.com>2023-04-11 20:30:43 -0500
commita875d1626dd74a6dee31ef056f3ffe874256a8e2 (patch)
treed31a9980a3828145929430c61e7fe501e4e659c6 /examples/guessing.sloth
parent6bc1c9adfca016cdf2e1dd39425ca97a5ebd24b6 (diff)
downloadsloth-a875d1626dd74a6dee31ef056f3ffe874256a8e2.tar.gz
Fixed if statements and while loops
Diffstat (limited to 'examples/guessing.sloth')
-rw-r--r--examples/guessing.sloth4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/guessing.sloth b/examples/guessing.sloth
index 1938269..01f0796 100644
--- a/examples/guessing.sloth
+++ b/examples/guessing.sloth
@@ -9,7 +9,7 @@ while !correct {
if human == computer {
println("You guessed the same number as me!");
- correct = true;
+ var correct = true;
}
if human > computer {
@@ -20,7 +20,7 @@ while !correct {
println("Your guess was too low.");
}
- tries = tries + 1;
+ var tries = tries + 1;
}
println("\nIt took you ", tries, " tries to guess correctly!");