Introduction: A Quick and Simple War Game

Picture of A Quick and Simple War Game

just copy and paste into notepad and save as "war.bat". It's all handwritten, 155 lines of code, easy game once you get it, any questions just ask and ill answer them as soon as possible

Step 1:

@echo off

title war

color 0c

set /a troops= 100000

set /a money= 10000

if %troops% equ 0 ( goto end )

set /a ammn=0

set /a monn=0

Step 2:

:start

set /p country= "name your country:"

goto menu

Step 3:

:menu

cls

echo watch out the rubbishins are attaking %country%.

echo --------------------------------------------------

echo you have %troops% troops.

echo --------------------

echo you have $%money%

echo what would you like to do.

echo A) attack

echo B) buy troops

echo c) buy world peace ($300000)

set /p choice=

if '%choice%' == 'a' goto ready

if '%choice%' == 'A' goto ready

if '%choice%' == 'b' goto pay

if '%choice%' == 'B' goto pay

if '%choice%' == 'c' goto peace

if '%choice%' == 'C' goto peace

Step 4: The Longest One to Copy

:fail

CLS

echo you don't have that many troops!!!!!

pause

goto ready

:go
cls

set /a enemy=%random%

if %army% lss %enemy% ( goto loss)

else if %army% gtr %enemy% ( goto win)

else if %army% equ %enemy% ( goto tie )

:win
echo congrats you won!!!

echo the enemy team had %enemy% troops

echo you gained $30000

echo you loss %army% troops however

set /a troops=%troops%-%enemy%

set /a money=%money+30000

set /a ammn=%army%+%ammn%

pause

goto menu

:loss
echo you lost the battle you lost %army% troops and $1000

echo the enemy team had %enemy% troops

set /a troops=%troops%-%army%

set /a money=%money%-20000

set /a ammn=%army%+%ammn%

set /a monn=%monn%+20000

pause

goto menu

:pay
cls

echo you have %troops%

echo how many would you like to buy

echo A) 1000 ($500)

echo B) 5000($1000)

echo C) 10000 ($1500)

set /p choice=

if '%choice%' == 'a' goto 1000

if '%choice%' == 'A' goto 1000

if '%choice%' == 'b' goto 5000

if '%choice%' == 'B' goto 5000

if '%choice%' == 'c' goto 10000

if '%choice%' == 'C' goto 10000

:1000
cls

echo you gained 1000 troops for the price of $500

set /a troops=%troops%+1000

set /a money=%money%-500

set /a monn=%monn%+500

pause

goto menu

:5000
CLS

echo you gained 5000 troops for the price of $1000

set /a troops=%troops%+5000

set/a money=%money%-1000

set /a monn=%monn%+1000

pause

goto menu

:10000
CLS

echo you gained 10000 troops for the price of $1500

set /a troops=%troops%+10000

set /a money=%money%-1500

set /a monn=%monn%+1500

pause

goto menu

Step 5: Final Step

:end

echo you lost all troops :(

pause

exit

:tie
CLS

echo you had the same amount of troops as your enemy

echo you did not loose money but you lost troops

set /a troops=%troops%-%army%

pause

goto menu

:ready
cls

echo you have %troops% troops

set /p army=" how many troops do you want to send out:"

if %army% lss %troops% ( goto go)

else if %army% gtr %troops% ( goto fail )

else if %army% equ %troops% ( goto tie )

:peace
cls

if %money% gtr 300000 ( goto peace2)

else if %money% equ 300000 ( goto peace2)

else if %money% lss 300000(goto no)

:no
CLS

echo you don't have that kind of money

pause

goto menu

:peace2
cls

echo good job you bought world peace

echo you spent $%monn% on war

echo you sent %ammn% troops to war

echo -----------------------------------------------

echo -----------------------------------------------

echo -----------------------------------------------

echo remember war is not a good thing, but in order

echo to have peace in the world, there needs to be one echo big victory...

echo ________________________________________________

pause

exit

and thats it. if there are any problems just go ahead and comment them bellow

Comments

DIY Hacks and How Tos (author)2017-01-14

Nice batch game. Could you share a little bit about the creation process and why you designed it the way that you did. If could be useful to other aspiring batch programmers.

About This Instructable

133views

0favorites

License:

Bio: I make my own stuff then share it. if you want something don't be afraid to ask i can see if i can make ...
More by stevenma727.:a quick and simple war game
Add instructable to: