Batch movement
Posted: 21 Apr 2017 13:44
I can't seem to figure out how to create movement like Snake.bat i think i got it a little bit but i cant figure out the rest. Here's what i got:
Thank you, BatNoob
Code: Select all
:setup
@echo off
set lsp=
set char=X
set rsp=
set wall=#
:1
cls
for /l %%a In (1 1 11) do (<nul set /p "=%wall%")
echo.
for /l %%a In (1 1 4) do (echo %wall%%lsp% %rsp%%wall%)
echo %wall%%lsp%%char%%rsp%%wall%
for /l %%a In (1 1 4) do (echo %wall%%lsp% %rsp%%wall%)
for /l %%a In (1 1 11) do (<nul set /p "=%wall%")
echo.
choice /c ADS /m "S resets"
if %ERRORLEVEL% == 1 (CALL:Left) ELSE if %ERRORLEVEL% == 2 (CALL:Right) Else (goto :setup)
goto :1
pause
exit /b
:Left
set lsp=%lsp:~0,-1%
set rsp=%rsp:~0,+1%
GOTO:EOF
:Right
set rsp=%rsp:~0,-1%
set lsp=%lsp:~0,+1%
GOTO:EOF
Thank you, BatNoob