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)


OpenConsole()
 
Repeat
  ; Ask for limits, with sanity check
  Print("Enter low limit : "): low  =Val(Input())
  Print("Enter high limit: "): High =Val(Input())
Until High>low
 
TheNumber=Random(High-low)+low  
Debug TheNumber
Repeat
  Print("Guess what number I have: "): Guess=Val(Input())
  If Guess=TheNumber
    PrintN("You got it!"): Break
  ElseIf Guess < TheNumber
    PrintN("Your guess is to low.")
  Else
    PrintN("Your guess is to high.")
  EndIf
ForEver