From a875d1626dd74a6dee31ef056f3ffe874256a8e2 Mon Sep 17 00:00:00 2001 From: nic-gaffney Date: Tue, 11 Apr 2023 20:30:43 -0500 Subject: Fixed if statements and while loops --- examples/guessing.sloth | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') 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!"); -- cgit v1.2.3