Guessing Game. Part 2

Generating random number

We will use builtin rand_range to generate random number between 1 and 100

println("Guess the number!")
let secret_number = rand_range(1,10)
println("Secret number is: " secret_number)
println("Please input your guess")
let input = read_line()
println("You guessed: ",input)

Comparing secret number with guess

println("Guess the number!")
let secret_number = rand_range(1,10)
println("Secret number is: ", secret_number)
println("Please input your guess")
let input = int(string_trim(read_line()))
println("You guessed: ",input)
if input < secret_number
println("Too small")
else if input > secret_number println("Too big")
else if input == secret_number println("You win!")
else error("Should not happen")