I'm developing a batch game, and I have come across an error during testing. It's best if I show you the code:
:move
set /a chance=%RANDOM% % 4 + 1
if %chance% == 1 goto randomitem
if %chance% == 2 goto randommonster
if %chance% == 3 goto safe
if %chance% == 4 goto trap
:randomitem
cls
echo You found an item!
echo Sorry! The items mechanism hasn't been added yet!
goto main
:randommonster
cls
echo A random monster attacks you!
echo Sorry! The monsters mechanism hasn't been added yet!
goto main
:safe
cls
echo You enter another dark room with 4 corridors.
goto main
:trap
cls
echo You fall into a trap!
echo Sorry! The traps mechanism hasn't been added yet!
goto main
For some reason, instead of having a chance of doing all 4 paths, it is only doing randomitem. I don't know how to fix this, please help me!
Thanks!