MS DOS input incorrectly redirecting - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

MS DOS input incorrectly redirecting

do I'm trying to give the user a choice of where thye go, but no matter what they press, it always goes to :ATTACKSPIDER
Note: this is an exerpt of only the malfunctioning code.

:OUTSIDEHOUSE
CLS
ECHO.
IF %SPIDER%==0 (
ECHO You are outside your house. It looks like a small tan brick hut.
ECHO A bit off you can see the town and the forest.
ECHO 1-Go inside your house.
ECHO 2-Go to town.
ECHO 3-Go to Forest.
ECHO 4-Go to back of house.
SET /P CHOICE=TYPE
IF /I '%CHOICE%'=='1' GOTO BEDROOM
IF /I '%CHOICE%'=='2' GOTO TOWN
IF /I '%CHOICE%'=='3' GOTO FOREST
IF /I '%CHOICE%'=='4' GOTO HOUSEBACK
)
IF %SPIDER%==1 (
ECHO You are outside your house. It looks like a small tan brick hut.
ECHO A bit off you can see the town and the forest.
ECHO You also notice a 10ft wide black spider by the side of your house.
ECHO 1-Go inside your house.
ECHO 2-Go to town.
ECHO 3-Go to Forest.
ECHO 4-Go to back of house.
ECHO 5-Attack Spider
ECHO 6-Use Magic Muffin On Spider
SET /P CHOICE=TYPE
IF /I '%CHOICE%'=='1' GOTO BEDROOM
IF /I '%CHOICE%'=='2' GOTO TOWN
IF /I '%CHOICE%'=='3' GOTO FOREST
IF /I '%CHOICE%'=='4' GOTO HOUSEBACK
IF /I '%CHOICE%'=='5' GOTO ATTACKSPIDER
IF /I '%CHOICE%'=='6' GOTO MUFFINONSPIDER
)

:ATTACKSPIDER
CLS
ECHO.
IF %GUN%==0 (
ECHO You do not have a weapon capable of defeating the spider.
ECHO You are punted so hard you time warp into a 7-11.
PAUSE
GOTO 711
)
IF %GUN%==1 (
ECHO You Defeat Spider with the gun. Spider flees.
ECHO The spider drops a rusty key.
SET KEY=1
SET SPIDER=0
PAUSE
GOTO OUTSIDEHOUSE
)

any help on why this is happening would be greatly apprecitated
Sign In or Register to comment.