# Russian Roulette batch file.



## usachampion (Aug 20, 2010)

Hey guys! I am trying to make a Russian roulette batch file and i have gotten all the way down to how many bullets you want to use. But I need a little help on how to make it choose yes or no randomly depending on how many bullets there are. A yes being a shot and a no being a dry fire. This is the code i have so far



______________________________________________________________
@echo off
echo Welcome to the motherland of russia!! 
echo Home of the game of russian roulette.
echo Do you wish to play?
echo.
echo yes
echo no
set _input=
set /p _input=please type your choice:

if %_input%==yes goto _A
if %_input%==no goto _B

:_A
cls
echo.
echo Good well lets get started!
pause
goto _C

:_B
GOTO :EOF

:_C
cls
echo.
echo To get started choose how many bullets you want loaded.
echo 1
echo 2
echo 3
echo 4
echo 5
echo 6
set _input=
set /p _input=choose one of the above:
if %_input% LSS 6 goto _D
if %_input%==6 goto _E

:_D
cls
echo. <------------------------------------- - (I need it to randomly generate yes and no's here.)
pause


:_E
cls
echo.
echo You are an idiot!! Why in the hell would you load 6 bullets in russian roulette??!?
echo.
echo Bang! you die.
pause
GOTO :EOF
________________________________________________________________________
This is my first post so please go easy on me. if you don't get what i'm trying to ask then please ask and i'll elaborate more.
also if you see any bugs in my program so far let me know!


----------



## Ent (Apr 11, 2009)

%random% gives a random number between 0 and 32767.

set /A _cap = %_input% * 5461
If %random% lss %_cap% (_KILL)_ Else _(SURVIVE)

_From a design point of view, you might want to add a little more input checking on the whether to play question and the bullets to load question. You will get smart alecs who try loading 13 bullets in a revolver, or -7!


----------

