School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,475 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,752 people online right now. Registration is fast and FREE... Join Now!




Batch Loop

 

Batch Loop, In which Avia tries to figure out how to put her batch text game in a

xxxAviaxxx

4 Jul, 2009 - 01:18 PM
Post #1

New D.I.C Head
*

Joined: 2 Jul, 2009
Posts: 18


My Contributions
[b]Can someone please tell me how to put a batch game like mine in loop? I don't feel like writing a simple program over and over again.

CODE
@echo off
title Mall Game
color 0B
set /P Mallname=What is the name of your Mall?:
echo ***%Mallname%***
echo.
echo.
echo You have 1000 points!
echo.
echo.
echo You can buy two stores!
echo.
set /P Store1=What do you want your store name to be?:
echo.
echo.
echo  The store %Store1% has been created!
echo.
echo.
echo You have 500 Points.
echo.
echo.
echo You can buy 1 store.
echo.
echo.
set /P Store2=What do you want your store name to be?:
echo.
echo.
echo The store %Store2% has been created!
echo.
echo.
echo This is your store list so far:
echo.
echo %Store1%
echo %Store2%
echo.
echo.
set /P Day1=Do you want to start Day 1(type yes)?:
if %Day1% == yes (goto Day1) else (exit)
:Day1
echo ***%Mallname%***
echo.
echo.
echo Your two stores, %Store1% and %Store2%, did great!
echo They made 1000$
echo They then paid 500$ in taxes
echo.
echo.
echo You now have a total of 500$
echo.
echo.
echo You can buy one store
echo.
echo.
set /P Store3=What do you want your store name to be?:
echo.
echo.
echo The store %Store3% has been created!
echo.
echo.
echo This is your list of stores so far:
echo.
echo %Store1%
echo %Store2%
echo %store3%
echo.
echo.
set /P Day2=Do you want to start Day 2?:
if %Day2% == yes (goto Day2) else (exit)
:Day2
cls
echo ***%Mallname%***
echo.
echo.
echo Your three stores, %Store1%, %Store2%, and %store3%, did great!
echo They made 1500$
echo They then paid 750$ in taxes
echo.
echo.
echo You now have a total of 750$
echo.
echo.
echo You can buy one store
echo.
echo.
set /P Store4=What do you want your store name to be?:
echo.
echo.
echo The store %Store4% has been created!
echo.
echo.
echo This is your list of stores so far:
echo.
echo %Store1%
echo %Store2%
echo %Store3%
echo %Store4%
echo.
echo.
set /P Day3=Do you want to start Day 3?:
if %Day3% == yes (goto Day3) else (exit)
:Day3
cls
echo ***%Mallname%***
echo.
echo.
echo Your three stores, %Store1%, %Store2%, and %store3%, did great!
echo They made 2000$
echo They then paid 1000$ in taxes
echo.
echo.
echo You now have a total of 1250$
echo.
echo.
echo You can buy two stores
echo.
echo.
set /P Store5=What do you want your store name to be?:
echo.
echo.
echo The store %Store5% has been created!
echo.
echo.
echo You now have a total of 750$
echo.
echo.
echo You can buy 1 store
echo.
echo.
set /P Store6=What do you want your store name to be?:
echo.
echo.
echo The store %Store6% has been created!
echo.
echo.
echo This is your list of stores so far:
echo.
echo %Store1%
echo %Store2%
echo %store3%
echo %store4%
echo %Store5%
echo %Store6%
echo.
echo.
set /P Day4=Do you want to start Day 4?:
if %Day4% == yes (goto Day4) else (exit)
:Day4


This post has been edited by xxxAviaxxx: 4 Jul, 2009 - 01:25 PM

User is offlineProfile CardPM
+Quote Post


paperclipmuffin

RE: Batch Loop

5 Jul, 2009 - 02:28 AM
Post #2

WinWinWinWindows?
Group Icon

Joined: 16 Apr, 2009
Posts: 885



Thanked: 9 times
Dream Kudos: 400
My Contributions
CODE

:top
@echo off
title Mall Game
color 0B
set /P Mallname=What is the name of your Mall?:
echo ***%Mallname%***
echo.
echo.
echo You have 1000 points!
echo.
echo.
echo You can buy two stores!
echo.
set /P Store1=What do you want your store name to be?:
echo.
echo.
echo  The store %Store1% has been created!
echo.
echo.
echo You have 500 Points.
echo.
echo.
echo You can buy 1 store.
echo.
echo.
set /P Store2=What do you want your store name to be?:
echo.
echo.
echo The store %Store2% has been created!
echo.
echo.
echo This is your store list so far:
echo.
echo %Store1%
echo %Store2%
echo.
echo.
set /P Day1=Do you want to start Day 1(type yes)?:
if %Day1% == yes (goto Day1) else (exit)
:Day1
echo ***%Mallname%***
echo.
echo.
echo Your two stores, %Store1% and %Store2%, did great!
echo They made 1000$
echo They then paid 500$ in taxes
echo.
echo.
echo You now have a total of 500$
echo.
echo.
echo You can buy one store
echo.
echo.
set /P Store3=What do you want your store name to be?:
echo.
echo.
echo The store %Store3% has been created!
echo.
echo.
echo This is your list of stores so far:
echo.
echo %Store1%
echo %Store2%
echo %store3%
echo.
echo.
set /P Day2=Do you want to start Day 2?:
if %Day2% == yes (goto Day2) else (exit)
:Day2
cls
echo ***%Mallname%***
echo.
echo.
echo Your three stores, %Store1%, %Store2%, and %store3%, did great!
echo They made 1500$
echo They then paid 750$ in taxes
echo.
echo.
echo You now have a total of 750$
echo.
echo.
echo You can buy one store
echo.
echo.
set /P Store4=What do you want your store name to be?:
echo.
echo.
echo The store %Store4% has been created!
echo.
echo.
echo This is your list of stores so far:
echo.
echo %Store1%
echo %Store2%
echo %Store3%
echo %Store4%
echo.
echo.
set /P Day3=Do you want to start Day 3?:
if %Day3% == yes (goto Day3) else (exit)
:Day3
cls
echo ***%Mallname%***
echo.
echo.
echo Your three stores, %Store1%, %Store2%, and %store3%, did great!
echo They made 2000$
echo They then paid 1000$ in taxes
echo.
echo.
echo You now have a total of 1250$
echo.
echo.
echo You can buy two stores
echo.
echo.
set /P Store5=What do you want your store name to be?:
echo.
echo.
echo The store %Store5% has been created!
echo.
echo.
echo You now have a total of 750$
echo.
echo.
echo You can buy 1 store
echo.
echo.
set /P Store6=What do you want your store name to be?:
echo.
echo.
echo The store %Store6% has been created!
echo.
echo.
echo This is your list of stores so far:
echo.
echo %Store1%
echo %Store2%
echo %store3%
echo %store4%
echo %Store5%
echo %Store6%
echo.
echo.
set /P Day4=Do you want to start Day 4?:
if %Day4% == yes (goto Day4) else (exit)
:Day4
goto top

\/If I was helpful, please thank me by clicking on the link below\/

User is offlineProfile CardPM
+Quote Post

xxxAviaxxx

RE: Batch Loop

5 Jul, 2009 - 03:24 PM
Post #3

New D.I.C Head
*

Joined: 2 Jul, 2009
Posts: 18


My Contributions
That just resets the game.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 03:17AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month