-
txt game in cmd
Hey guys thanks for all that use have done for me. I wanted to know this time how to make something simple for a txt game i'm making. I wanted to no how to make it that for example when it says: Do you want to play (y/n) is there anyway for it to reconginze the y or the n for if u put y it starts the game and if u hit n it would close it. Thanks if use can help me and if not thanks anyway.
-Dragon****0
-
If you just want a simple game for the Command Line, look into [URL="http://en.wikipedia.org/wiki/Batch_file"]Windows batch files[/URL]
-
im running it through a batch file but is there anyway for it to recongize the letter or number typed in?
-Dragon****0
-
This site should help:
[url]http://www.robvanderwoude.com/userinput.html[/url]
-
I'm running into another problem and I can't find help anywhere else.
here is my batch file code.
@echo off
c:
cls
Echo Are you ready to play Mafia Wars?
pause >nul
cls
[B][I][U]set /p y/n=(Y/N)-[/U][/I][/B]
cls
if [B][I][U]%y/n%[/U][/I][/B]==n goto exit
if [B][U][I]%y/n%[/I][/U][/B]==y goto start
:start
Echo My Attack:0
Echo My Defense:0
Echo My *****:$200
Echo My Lives:*
Echo *.Fight a rivel mobster.
Echo 2.Shop
pause >nul
[B][I][U]set /p number==
if %number%==* goto fight
if %number%==2 goto shop[/U][/I][/B]
:fight
echo *.fight rival mobster *
echo 2.fight rival mobster 2
echo *.fight rival mobster *
echo 4.fight rival mobster 4
echo 5.fight rival mobster 5
echo 6.fight rival mobster 6
[B][I][U]set /p number==Enter the number of which you want to fight-
if %number%==* goto mobster*[/U][/I][/B]
:shop
:exit
okay heres my question within the bold,underline,italics does the set /p (does this part that goes here does it have to be the same throw out them all?)==