我正在尝试用批处理创建一个简单的猜数游戏。但是,我从来没有能够正确使用括号。代码是:
@echo off
::This is a game that has you guess a random number.
Title Random Number Game
set number=%random%
:guess
set /p guess1= Guess the number I'm thinking of!
if %guess1%LSS%number% (
echo Higher!
goto guess
)
if %guess1%GTR%number% (
echo Lower!
goto guess
)
echo You got it! Awesome Job!
无论我的猜测是高于还是低于数字,输入后,cmd返回,“(此时不是预期的。”我该如何解决这个问题?