Solved I'm having problems making a quiz game

May 20, 2012 at 10:20:16
Specs: Windows 7
@echo off
:menu
echo menu
echo 1) start
if%input%==1 goto one
goto one
:one
echo what kind of mammal lays eggs?
echo a)dog
echo b)platypus
echo c)otter
if%input%==b goto two
goto two
:two
echo hi
@pause


this is what I'm doing except for the second problem and it is not opening. could you tell me what i did wrong.


See More: Im having problems making a quiz game

Report •


#1
May 21, 2012 at 02:24:40
You visual basic..... it will be a lot easier.

Samsung ML3310 Monochrome Printer

Lincolnshire Web Design


Report •

#2
May 21, 2012 at 05:15:59
You aren't ever setting %input%.
Use:

set /p var=prompt

Tony


Report •

#3
May 21, 2012 at 10:03:44
✔ Best Answer
::modified a bit, ran fine for me.
echo Menu
echo ------------------------------
echo - 1) Initiate program
echo - 2) Exit
echo -------------------------------
SET /P input="ENTER CHOICE: "
set /a input = %input%
if %input%==2 goto ends
if %input%==1 goto one
cls
echo Please enter one of the selections above, thankyou
goto menu

:one
set input=
echo What kind of mammal lays eggs?
echo a)dog
echo b)platypus
echo c)otter
set /p input="Please make a selection: "
if %input% equ b goto two
if %input% equ B goto two
cls
echo Answer incorrect, please retry.
goto one

:two
echo Congratulations you have selected b)platypus, which is the correct answer
pause
:ends
cls
echo This program will now close
pause

mike


Report •

Related Solutions


Ask Question