Task

Write a game (computer program) that follows the following rules:

 The computer chooses a number between given set limits.
 The player is asked for repeated guesses until the the target number is guessed correctly
 At each guess, the computer responds with whether the guess is:
 higher than the target,
 equal to the target, 
 less than the target,   or
 the input was inappropriate. 


Related task

   Guess the number/With Feedback (Player)


import rand.seed
import rand
import os
const (
    lower = 1
    upper = 100
)
 
fn main() {
    rand.seed(seed.time_seed_array(2))
    n := rand.intn(upper-lower+1) or {0} + lower
    for {
        guess := os.input("Guess integer number from $lower to $upper: ").int()
 
        if guess < n {
            println("Too low. Try again: ")
        } else if guess > n {
            println("Too high. Try again: ")
        } else {
            println("Well guessed!")
            return
        }
    }
}