0
@echo off
:start
cls
color e
echo YOU HAVE WON 1,000,000ドル! WHAT WILL YOU DO? 
echo.
echo =================
echo -Take it (1)
echo -Leave it (2)
echo -Double it (3)
echo =================
echo.
set /p INPUT=Please specify your answer: 
If /i "%INPUT%" == "1" goto 1
If /i "%INPUT%" == "2" goto 2
If /i "%INPUT%" == "3" goto 3
If /i "%INPUT%" == "Jonah" goto Jonah
If /i "%INPUT%" == "" goto Wrong

I have a strange problem. Above is a code and for some reason, when I type in "INPUT" something like 'Aiden' it would think it meant '1'. Is there a way to make every wrong answer goto wrong. (Wrong answers like Aiden which isn't even specified there. But not only Aiden, any other thing).

asked Aug 13, 2016 at 23:28

1 Answer 1

2

After your if statements you need to put a catch-all GOTO statement so if none of the others work, it will go to wrong instead of just continuing into the block right below

@echo off
:start
cls
color e
echo YOU HAVE WON 1,000,000ドル! WHAT WILL YOU DO? 
echo.
echo =================
echo -Take it (1)
echo -Leave it (2)
echo -Double it (3)
echo =================
echo.
set /p INPUT=Please specify your answer: 
If /i "%INPUT%" == "1" goto 1
If /i "%INPUT%" == "2" goto 2
If /i "%INPUT%" == "3" goto 3
If /i "%INPUT%" == "Jonah" goto Jonah
goto Wrong
answered Aug 13, 2016 at 23:35
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.