When I was playing around with randomizing numbers in a certain limit, I had the idea for a game that I now call Double Dice.
@echo off
rem Double Dice by Jarjee 6/1/07
title Double Dice!
:S
echo Double Dice!
set money=100
echo.
:1
echo How much do you wager?
set /p wager=You have $%money%:
if /I %wager%==save goto :Score
if /I %wager%==highscore goto :High
if /I %wager%==help goto :Help
if /I %wager%==delete goto :Del
if /I %wager%==clear goto :Cls
if %wager% LSS 0 echo You can't wager a negative! &goto :1
if %wager% GTR %money% echo You don't have that money! &goto :1
set /a money="money-wager"
set /a DICE1=%random% %%6 + 1 >nul
echo You rolled a %DICE1%.
set /a DICE2=%random% %%6 + 1 >nul
echo You rolled a %DICE2%
if %DICE1%==%DICE2% goto :WIN!
echo.
if %money%==0 goto :F
goto :1
:F
echo Do you want to play again?(y/n)
set /p input=(y/n):
if /I %input%==y Cls &goto :S
if /I %input%==n goto :GO
goto :F
:WIN!
echo.
echo You Win! Here's your winnings!
echo.
set mem=%wager%
set /a wager="wager*6+wager"
set /a money="money+wager"
set /a wager="wager-mem"
echo You've won $%wager%!
set wager=0
echo.
goto :1
:GO
echo.
echo.
ping 127.0.0.1 -n 1 >nul
echo.
echo.
ping 127.0.0.1 -n 1 >nul
echo.
echo.
ping 127.0.0.1 -n 1 >nul
echo.
echo.
ping 127.0.0.1 -n 1 >nul
echo.
echo.
ping 127.0.0.1 -n 1 >nul
echo.
echo.
ping 127.0.0.1 -n 1 >nul
echo.
echo.
ping 127.0.0.1 -n 1 >nul
echo.
echo.
ping 127.0.0.1 -n 1 >nul
echo.
echo.
ping 127.0.0.1 -n 1 >nul
echo.
echo.
ping 127.0.0.1 -n 1 >nul
echo.
echo.
ping 127.0.0.1 -n 1 >nul
echo.
echo.
echo GAME OVER
echo.
echo.
ping 127.0.0.1 -n 1 >nul
echo.
echo.
ping 127.0.0.1 -n 1 >nul
echo.
echo.
ping 127.0.0.1 -n 1 >nul
echo.
echo.
ping 127.0.0.1 -n 1 >nul
echo.
echo.
ping 127.0.0.1 -n 1 >nul
echo.
echo.
ping 127.0.0.1 -n 1 >nul
echo.
echo.
ping 127.0.0.1 -n 1 >nul
echo.
echo.
ping 127.0.0.1 -n 1 >nul
echo.
echo.
ping 127.0.0.1 -n 1 >nul
echo.
echo.
ping 127.0.0.1 -n 1 >nul
echo.
echo.
ping 127.0.0.1 -n 1 >nul
echo.
echo.
:Score
set /p name=Type your name here:
echo %Name% : $%Money%>>Highscore.data
exit
:High
echo.
rem My thanks to SideWinder!
for /F "delims=" %%i in (Highscore.data) do @echo %%i
echo.
goto :1
:Help
echo.
echo Double Dice is a game of chance. If you get the same number twice,
echo the wager that you bet is returned sixfold. Otherwise you get nothing.
echo There are few commands in this program:
echo Save: This enters your profile into the highscore chart
echo Highscore: This loads the highscore if it is present
echo Delete: Removes the Highscore
echo Clear: Clears the screen
echo Help: Returns this information form.
echo.
goto :1
:Del
cls
del Highscore.data
goto :1
:Cls
cls
goto :1
This game covers keywords that you can type in during a wager. The help can be read by typing help in the wager input during a game. Also, if you can help with the high score, it would be appreciated (I want the score to go in numerical order, largest first.) Any suggestions will be helpful.
Are there another .bat based games out there?