Skip to main content
Notice added Insufficient justification by Mast
place "code fences" (lines containing just ~~~) around each "code block"
Source Link
greybeard
  • 7.7k
  • 3
  • 21
  • 56
 

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
 

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

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

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

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
Source Link

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

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