I am attempting to use Batch Script to write a basic trivia game to run within the DOS CMD on my laptop. It was just an experimental thing so I could practice using Batch Script some more.
The first question will execute with no issues but I can not get the second question to execute. It continues to say, "goto unexpected at this time". Is there something that I need to look at in order to fix this?
Thank you for your assistance.
Code:
@echo off
color 02
title PaleScream's Trivia Quiz
echo.
echo - - - - - - - - - - - - - - -
echo.
echo Welcome to PaleScream's Trivia Quiz
echo.
echo - - - - - - - - - - - - - - -
echo.
pause
cls
echo Who is that little green guy in Star Wars
echo 1 Yoda
echo 2 Darth Vader
echo 3 Luke
set /p starwars=choice1~3
if %starwars%==1 goto Correct
if %starwars%==2 goto Incorrect
if %starwars%==3 goto Incorrect
:Correct
echo You got it right!!
pause
cls
goto continued
:Incorrect
echo Sorry you got it wrong!!
pause
goto end
:continued
echo What is the national animal of Scotland?
echo 1 Reindeer
echo 2 Unicorn
echo 3 Valais Blackneck Goat
set /p ScotlandAnimal = choice1~3
if %ScotlandAnimal%==1 goto incorrect
if %ScotlandAnimal%==2 goto correct
if %ScotlandAnimal%==3 goto incorrect
echo ----------------------------------
:correct
echo You got it right!!
pause
goto continued
:incorrect
echo Sorry, try again.
pause
goto end
:continued
cls
echo you made it to the end
pause
:end