aboutsummaryrefslogtreecommitdiff
path: root/examples/test.sloth
blob: 7104593a7666c2979e99fd7f3a0c0a625ea551a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
print("Pick a number between 1 and 5: ");

val human = parse_int(readln());
val computer = random(1, 5);

if human == computer {
    println("You guessed the same number as me!");
}

if human > computer {
    println("Your guess was too high.");
}

if human < computer {
    println("Your guess was too low.");
}