Introduction: Simple Batch Game
Here's a simple .bat game. It's not that good, but at least you'll have something to do when bored. :P
PS.: If you find any way to improve this code or any bugs/mistakes, please let me know by commenting down below.
Code:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
@echo off
:Start1
cls
echo Let's play a game!
echo It's called NUMBER!
echo For settings, type "Sets"
echo Choose any number
echo between 1 and 10:
set /p choice1=
if %choice1%==Sets goto Settings
for /l %%G in (1,1,10) do if %choice1%==%%G goto Add
echo Choose between 1
echo and 10!!
ping localhost -n >nul 3
goto Start1
:Add
if %choice1%==10 goto Tie
set one=1
set /a result=%choice1%+%one%
echo.
echo I choose %result%!
echo I win!
ping localhost -n >nul 3
goto Again1
:Tie
echo.
echo I choose 10!
echo Tie!
ping localhost -n >nul 3
goto Again1
:Again1
cls
echo.
echo Wanna play again? (y/n)
set /p answer=
if %answer%==y goto Start1
if %answer%==n exit
echo Choose y or n!
ping localhost -n >nul 3
goto Again1
:Settings
cls
echo.
echo Settings menu
echo -=-=-=-=-=-=-
echo 1) Always winning
echo 2) Always losing
set /p input=
if %input%==1 goto Win
if %input%==2 goto Loss
echo Choose 1 or 2!
ping localhost -n >nul 3
goto Settings
:Loss
echo Set to always losing.
ping localhost -n >nul 3
goto Start1
:Win
echo Set to always wining.
ping localhost -n >nul 3
goto Start2
:Start2
cls
echo Let's play a game!
echo It's called NUMBER!
echo For settings, type "Sets"
echo Choose any number
echo between 1 and 10:
set /p choice2=
if %choice2%==Sets goto Settings
for /l %%G in (1,1,10) do if %choice2%==%%G goto Sub
echo Choose between 1
echo and 10!!
ping localhost -n >nul 3
goto Start2
:Sub
if %choice2%==1 goto Tie
set one=1
set /a result=%choice2%-%one%
echo.
echo I choose %result%!
echo You win!
ping localhost -n >nul 3
goto Again2
:Tie
echo.
echo I choose 1!
echo Tie!
ping localhost -n >nul 3
goto Again2
:Again2
cls
echo.
echo Wanna play again? (y/n)
set /p answer2=
if %answer2%==y goto Start2
if %answer2%==n exit
echo Choose y or n!
ping localhost -n >nul 3
goto Again2
:Again1
cls
echo.
echo Wanna play again? (y/n)
set /p answer=
if %answer%==y goto Start1
if %answer%==n exit
echo Choose y or n!
ping localhost -n >nul 3
goto Again1
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
PS.: If you find any way to improve this code or any bugs/mistakes, please let me know by commenting down below.
Code:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
@echo off
:Start1
cls
echo Let's play a game!
echo It's called NUMBER!
echo For settings, type "Sets"
echo Choose any number
echo between 1 and 10:
set /p choice1=
if %choice1%==Sets goto Settings
for /l %%G in (1,1,10) do if %choice1%==%%G goto Add
echo Choose between 1
echo and 10!!
ping localhost -n >nul 3
goto Start1
:Add
if %choice1%==10 goto Tie
set one=1
set /a result=%choice1%+%one%
echo.
echo I choose %result%!
echo I win!
ping localhost -n >nul 3
goto Again1
:Tie
echo.
echo I choose 10!
echo Tie!
ping localhost -n >nul 3
goto Again1
:Again1
cls
echo.
echo Wanna play again? (y/n)
set /p answer=
if %answer%==y goto Start1
if %answer%==n exit
echo Choose y or n!
ping localhost -n >nul 3
goto Again1
:Settings
cls
echo.
echo Settings menu
echo -=-=-=-=-=-=-
echo 1) Always winning
echo 2) Always losing
set /p input=
if %input%==1 goto Win
if %input%==2 goto Loss
echo Choose 1 or 2!
ping localhost -n >nul 3
goto Settings
:Loss
echo Set to always losing.
ping localhost -n >nul 3
goto Start1
:Win
echo Set to always wining.
ping localhost -n >nul 3
goto Start2
:Start2
cls
echo Let's play a game!
echo It's called NUMBER!
echo For settings, type "Sets"
echo Choose any number
echo between 1 and 10:
set /p choice2=
if %choice2%==Sets goto Settings
for /l %%G in (1,1,10) do if %choice2%==%%G goto Sub
echo Choose between 1
echo and 10!!
ping localhost -n >nul 3
goto Start2
:Sub
if %choice2%==1 goto Tie
set one=1
set /a result=%choice2%-%one%
echo.
echo I choose %result%!
echo You win!
ping localhost -n >nul 3
goto Again2
:Tie
echo.
echo I choose 1!
echo Tie!
ping localhost -n >nul 3
goto Again2
:Again2
cls
echo.
echo Wanna play again? (y/n)
set /p answer2=
if %answer2%==y goto Start2
if %answer2%==n exit
echo Choose y or n!
ping localhost -n >nul 3
goto Again2
:Again1
cls
echo.
echo Wanna play again? (y/n)
set /p answer=
if %answer%==y goto Start1
if %answer%==n exit
echo Choose y or n!
ping localhost -n >nul 3
goto Again1
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-