在对基于文本的游戏进行批量编码时,“___在此时出乎意料”的问题

时间:2011-07-14 03:47:46

标签: batch-file

在尝试对输入做输入和结果时,我一直都会遇到这个问题。我不知道这是什么问题,我想知道这样,每当我通过重新编程来解决它时,我就不必解决这个难题。这是代码的样子:

:A1
cls
type A1intro.txt

echo.
echo.
set input=5
set /p input=NOW WHAT? 
if %input%==HELP goto A1HELP
if %input%==LOOK goto A1LOOK
if %input%==LOOK AT BED goto A1BED ***this is where it says 'A1 not expected' once I type LOOK AT BED in the input***

goto A1


:A1BED ***So, this is where the A1 bed goes to and where the issue is with the code. No other command does this except this one. The others are identical in their coding.***

cls
type A1bed.txt
echo.
echo.
pause
goto A1

2 个答案:

答案 0 :(得分:5)

你需要围绕比较报价?

if "%input%"=="LOOK AT BED" goto A1BED

答案 1 :(得分:0)

是的,您需要在第11行附近引用,否则cmd.exe认为您的比较字符串只是LOOK