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)


@echo off
 
:A
set /a number=%random% %% 10 + 1
:B
set /p guess=Choose a number between 1 and 10: 
if %guess equ %number% goto win
if %guess% gtr 10 msg * "Number must be between 1 and 10."
if %guess% leq 0 msg * "Number must be between 1 and 10."
if %guess% gtr %number% echo Higher!
if %guess% lss %number% echo Lower!
goto B
:win
cls
echo You won! The number was %number%
pause>nul
goto A