Author Topic: Notepad coding (not for addons)  (Read 584 times)

EDIT: I just finished the beginning of the game and it wont start the game i go through the beginning just fine but after that when I'm on the menu and i goto start it doesnt goto question1
Any syntax errors?

Code: [Select]
@echo off
:begingame
echo Hello, please type your name.
set /p name=
cls
echo Ah, so your name is %name% is that right?(y/n lower case only)
set /p letter=

if letter == y goto :menu
if letter == n goto :begingame

instructions
cls
pause
echo Hello, %name% this game is very simple, just answer the questions to win.
echo CREDITS:
echo W              W  I  L      L
echo  W     WW     W      L      L
echo   W   W  W   W    I  L      L
echo    W W    W W     I  L      L
echo     W      W      I  LLLLL  LLLLL

:menu
cls
echo    MM    MM      EEEEEE  NN    N  U   U
echo   M  M  M  M     E       N N   N  U   U
echo  M    MM    M    EEE     N  N  N  U   U
echo M            M   E       N   N N  U   U
echo M            M   EEEEEE  N    NN   UUU

echo 1) start
echo 2) instructions
echo 3) exit
set /p letter=

if %letter% == 1 goto start
if %letter% == 2 goto instructions
if %letter% == 3 goto exit

start
echo Hello %name%, here is your first question.
echo What is 16*50?
set /p letter=

if %letter% == 800 goto Good
if %letter% != 800 goto Bad


Good
echo Good job next question.
goto questionII

Bad
echo Sorry, you got it wrong closing game.
goto exit


questionII
echo Ok, %name% what is 50/20
set /p letter=

if %letter% == 2.5 goto questionIII
if %letter% != 2.5 goto Bad
« Last Edit: July 31, 2010, 12:46:47 PM by mp7964 »

I don't really know anything about coding but can't you use != instead of the >= and <= ?

I don't really know anything about coding but can't you use != instead of the >= and <= ?
Thanks, locking.

EDIT: I just finished the beginning of the game and it wont start the game i go through the beginning just fine but after that when I'm on the menu and i goto start it doesnt goto question1
Any syntax errors?

-snip-
I found out what you're doing wrong. And by the way, making batch files isn't really coding. Anyways, the labels have to have : before them, as in ':good' ':bad'

I found out what you're doing wrong. And by the way, making batch files isn't really coding. Anyways, the labels have to have : before them, as in ':good' ':bad'
ty