I'm trying to make this guessing game with only 10 tries in batch but whatever number I guess it says the number is smaller and I can't find the problem
set /a var=%random%
echo %var%
for /l %%x in (1, 1, 10) do (
set /p guess="Try to guess the number: "
if "%guess%" equ "%var%" (goto 1)
if "%guess%" gtr "%var%" (echo Your number is greater)
if "%guess%" lss "%var%" (echo Your number is smaller)
)
echo You lost
pause
exit
:1
echo you guessed the number