-1
我想做一個文本冒險,但我有點無知如何得到一個if/else語句與變量一起工作。在我的代碼可能犯了一些錯誤:批處理。試圖使文本冒險,如果其他工作
@ echo off
color 0a
echo This is a text adventure! to play, read through the story and at certain points you get to make decisions.
echo Remember, selecting an invalid option will automatically be counted as option 2!
echo have fun
pause
cls
echo You wake up in a dimly lit room. You can't seem to remember anything. Anything about you or how you got here, that is.
echo You walk towards the door. It is locked.
echo 1)Force the door open.
echo 2) look around for another means of escape.
set /p escape=
if %escape% = 1
cls
echo you get the door open, but an orc comes in and smashes your face.
echo get rekt buddy, game over.
pause
exit
else
goto dungeon
:dungeon
cls
echo well done.
pause
exit
不知所措,請閱讀'if'的幫助(在新的命令提示符窗口中輸入「if /?')? – aschipfl