I am just writing a silly little program, but the problem I'm having seems quite generic.
Here is the part of the code that is causing me problems:
Warning: the code opens a google search.
set /a c=0
:Longcat
CLS
Echo.
ECHO *****************************************************************
ECHO.
echo How LONG is this cat?
echo.
echo *****************************************************************
Echo.
timeout 5 >nul
If %c%==0 start https://www.google.com/search?q=LongCat
set /a c=%c%+1
If %c%==10 goto incorrect
Set /p cat=
If %cat%==long goto correct
goto Longcat
:correct
Echo correct
pause
Goto geometric
:incorrect
echo incorrect
pause
goto geometric
When I enter single word responses for /p cat=
, like big
or tall
, the program works fine (continues to GOTO LONGCAT
).
But as soon as I use a 2 word answer, like very big
, I get an error:
big==long was unexpected at this time.
Does anyone have an explanation or a fix for this?