I'm trying to make armor and weapon buying and selling systems in my game, but I'm a beginner programmer and have no idea how to use the 'for' statement. I have some functional code at the moment, but it's absolutely enormous and junky. I want to try to use a for statement to shorten it, but I don't know how. Can someone help me? Thanks. I'm currently using this junk code:
cls
echo What armor do you want to change to?
echo[
echo 1. None
echo 2. Leather
echo 3. Wooden
echo 4. Stone
echo 5. Bronze
echo 6. Iron
echo 7. Titanium
echo 8. Adamantium
echo[
choice /c 12345678 /m "What'll it be, %name%?"
if %errorlevel%==8 (
cls
set armor=Adamantium
echo It is done!
pause
goto start
)
if %errorlevel%==7 (
cls
set armor=Titanium
echo It is done!
pause
goto start
)
if %errorlevel%==6 (
cls
set armor=Iron
echo It is done!
pause
goto start
)
if %errorlevel%==5 (
cls
set armor=Bronze
echo It is done!
pause
goto start
)
if %errorlevel%==4 (
cls
set armor=Stone
echo It is done!
pause
goto start
)
if %errorlevel%==3 (
cls
set armor=Wooden
echo It is done!
pause
goto start
)
if %errorlevel%==2 (
cls
set armor=Leather
echo It is done!
pause
goto start
)
cls
set armor=None
echo It is done!
pause
goto start