REM The Guessing Game echo off cls :start set /a tries=1 REM define the random number Set /a Number=(%Random% %%10)+1 echo %Number% pause REM Start of Guessing loop :retry rem set /a yn=0 REM Check # of tries if %tries% == 4 ( echo Too many tries set /p yn=Do you want to play again y/n echo %yn% YN imp ) else ( goto cont ) echo %yn% loopy if %yn% EQU y ( goto start ) else ( goto end ) :cont SET /P Guess=Guess a number from 1 to 10 : Rem Testing the numbers if %Guess% GTR %Number% ( echo Your number is to large set/a tries=%tries%+1 echo %tries% goto retry ) if %Guess% LSS %Number% ( echo Your number is to small set/a tries=%tries%+1 echo %tries% goto retry ) echo Your guess was correct %Number% is correct echo %tries% Tries echo %Guess% user Guess pause :end