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)


V (target_min, target_max) = (1, 100)
 
print("Guess my target number that is between #. and #. (inclusive).\n".format(target_min, target_max))
V target = random:(target_min..target_max)
V (answer, i) = (target_min - 1, 0)
L answer != target
   i++
   V txt = input(‘Your guess(#.): ’.format(i))
   X.try
      answer = Int(txt)
   X.catch ValueError
      print(‘  I don't understand your input of '#.' ?’.format(txt))
      L.continue
   I answer < target_min | answer > target_max
      print(‘  Out of range!’)
      L.continue
   I answer == target
      print(‘  Ye-Haw!!’)
      L.break
   I answer < target {print(‘  Too low.’)}
   I answer > target {print(‘  Too high.’)}
 
print("\nThanks for playing.")