1. One that doesn't tell you if you are greater or lower.
@echo off :restart set /a numb=(%RANDOM%*1/100) %numb% echo Guess a number from 1 to 350 set /p guess=Type guess here= if %guess% EQU %numb% goto :win if %guess% NEQ %numb% goto :lose goto :restart :win echo Good job! pause cls goto :restart :lose echo failed! is pause cls goto :restart
@echo off
:restart
set /a numb=(%RANDOM%*1/100)
%numb%
echo Guess a number from 1 to 350
set /p guess=Type guess here=
if %guess% EQU %numb% goto :win
if %guess% NEQ %numb% goto :lose
goto :restart
:win
echo Good job!
pause
cls
goto :restart
:lose
echo failed!
is
pause
cls
goto :restart
2.
One that does!
@echo off :restart set /a numb=(%RANDOM%*1/100) :retry echo Guess a number from 1 to 350 set /p guess=Type guess here= if %guess% EQU %numb% goto :win if %guess% GTR %numb% goto :GTR if %guess% LSS %numb% goto :LSS goto :restart :win echo Good job! pause cls goto :restart :GTR echo %guess% is greater than number. pause cls goto :retry :LSS echo %guess% is less than number. pause cls goto :retry
@echo off
:restart
set /a numb=(%RANDOM%*1/100)
:retry
echo Guess a number from 1 to 350
set /p guess=Type guess here=
if %guess% EQU %numb% goto :win
if %guess% GTR %numb% goto :GTR
if %guess% LSS %numb% goto :LSS
goto :restart
:win
echo Good job!
pause
cls
goto :restart
:GTR
echo %guess% is greater than number.
pause
cls
goto :retry
:LSS
echo %guess% is less than number.
pause
cls
goto :retry