hope you guys had a great Thanksgiving!
Anyways, I've been looking around for an answer for this, but I can't seem to find one that I need.
So basically my batch file has an input in which you write a sentence. The sentence will take you to :correct as long as it has the words "Mommy Chan" in it.
@echo off
:start
set /p test=Write a sentene with the word Mommy Chan in it:
if "%test%"=="Mommy Chan" goto correct
if "%test%" NEQ "Mommy Chan" goto incorrect
:correct
cls
echo %test%
echo you did it
pause
goto start
:incorrect
cls
echo %test%
echo you didn't follow directions
pause
goto start
Now, this seems to work and brings you to :correct if the user puts in the words "Mommy Chan" for the input, and nothing else. However, say the user puts in "Not Mommy Chan" it doesn't seem to recognize the fact that the word "Mommy Chan" is included, and it takes you to :incorrect
Obviously I don't want that.
For clarification, I want it so that if you input any sentence that has the word "Mommy Chan" in it, for example: "One day Mommy Chan went shopping" it should bring you to :correct. However, it only does this if the user puts in ONLY "Mommy Chan" Otherwise it just takes you to :incorrect
Anyone have any idea on how to fix this?
Thanks in advance.
Aucun commentaire:
Enregistrer un commentaire