Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
Xiemens
- Posts: 1
- Joined: 21 Mar 2013 07:31
#1
Post
by Xiemens » 21 Mar 2013 07:36
Help me, i started using batch in notepad ++ a few days ago and its working really well except one problem. Here's the problem.
Code: Select all
:north3
cls
echo You find yourself in a forest where do you go? North, South, West or East?
set /p y= " > "
if /I "%y%" == "North" goto play
if /I "%y%" == "South" goto play
if /I "%y%" == "West" goto play
if /I "%y%" == "East" goto east2
if not /I "%y%" == "North" goto play
if not /I "%y%" == "South" goto play
if not /I "%y%" == "West" goto play
if not /I "%y%" == "East" goto play
If i write something like narth or adfgaidfg it doesnt get me back to play or in this case north3.
What did i do wrong?! Please, help!
-
mfm4aa
- Posts: 70
- Joined: 13 Feb 2013 14:02
- Location: Europe
#2
Post
by mfm4aa » 21 Mar 2013 08:06
Here we go:
Code: Select all
:north3
cls
echo You find yourself in a forest where do you go? North, South, West or East?
set /p "y= > "
if /I "%y%"=="North" goto :play
if /I "%y%"=="South" goto :play
if /I "%y%"=="West" goto :play
if /I "%y%"=="East" goto :east2
goto :north3
This isn't a batch related issue.