这是我能想到的办法了 很明显错的无语复制代码
- @echo off
- if %1==w goto w
- if %1==s goto s
- if %1==a goto a
- if %1==d goto d
- if %1==%1 goto end
- :w
- cls
- set "a="&set "b="
- echo %a%
- echo %b%
- goto end
- :s
- cls
- set "a="&set "b="
- echo %a%
- echo %b%
- goto end
- :a
- cls
- set "a="&set "b="
- echo %a%
- echo %b%
- goto end
- :d
- cls
- set "a="&set "b="
- echo %a%
- echo %b%
- goto end
- :end
复制代码
- @echo off
- title 游戏
- color EC
- mode con:cols=30 lines=15
- :c
- set x=1
- set y=1
- set z=s59
- :g
- cls
- if "s%x%%y%"=="s33" goto die
- if "s%x%%y%"=="s23" (
- if "%s%"=="w" (set x=3)
- if "%s%"=="a" (set y=4)
- if "%s%"=="s" (set x=1)
- if "%s%"=="d" (set y=2)
- )
- if "s%x%%y%"=="s24" (
- if "%s%"=="w" (set x=3)
- if "%s%"=="a" (set y=5)
- if "%s%"=="s" (set x=1)
- if "%s%"=="d" (set y=3)
- )
- if "s%x%%y%"=="s43" (
- if "%s%"=="w" (set x=5)
- if "%s%"=="a" (set y=4)
- if "%s%"=="s" (set x=3)
- if "%s%"=="d" (set y=2)
- )
- if "s%x%%y%"=="s44" (
- if "%s%"=="w" (set x=5)
- if "%s%"=="a" (set y=5)
- if "%s%"=="s" (set x=3)
- if "%s%"=="d" (set y=3)
- )
- if "s%x%%y%"=="s59" goto OK
- if %x% lss 1 set x=1
- if %x% gtr 7 set x=7
- if %y% lss 1 set y=1
- if %y% gtr 9 set y=9
- set s11=□
- set s12=□
- set s13=□
- set s14=□
- set s15=□
- set s16=□
- set s17=□
- set s18=□
- set s19=□
- set s21=□
- set s22=□
- set s23=■
- set s24=■
- set s25=□
- set s26=□
- set s27=□
- set s28=□
- set s29=□
- set s31=□
- set s32=□
- set s33=▲
- set s34=□
- set s35=□
- set s36=□
- set s37=□
- set s38=□
- set s39=□
- set s41=□
- set s42=□
- set s43=■
- set s44=■
- set s45=□
- set s46=□
- set s47=□
- set s48=□
- set s49=□
- set s51=□
- set s52=□
- set s53=□
- set s54=□
- set s55=□
- set s56=□
- set s57=□
- set s58=□
- set s59=☆
- set s61=□
- set s62=□
- set s63=□
- set s64=□
- set s65=□
- set s66=□
- set s67=□
- set s68=□
- set s69=□
- set s71=□
- set s72=□
- set s73=□
- set s74=□
- set s75=□
- set s76=□
- set s77=□
- set s78=□
- set s79=□
- set s%x%%y%=[]
- echo.
- echo.
- echo ┏━━━━━━━━━┓
- echo ┃%s11%%s12%%s13%%s14%%s15%%s16%%s17%%s18%%s19%┃
- echo ┃%s21%%s22%%s23%%s24%%s25%%s26%%s27%%s28%%s29%┃
- echo ┃%s31%%s32%%s33%%s34%%s35%%s36%%s37%%s38%%s39%┃
- echo ┃%s41%%s42%%s43%%s44%%s45%%s46%%s47%%s48%%s49%┃
- echo ┃%s51%%s52%%s53%%s54%%s55%%s56%%s57%%s58%%s59%┃
- echo ┃%s61%%s62%%s63%%s64%%s65%%s66%%s67%%s68%%s69%┃
- echo ┃%s71%%s72%%s73%%s74%%s75%%s76%%s77%%s78%%s79%┃
- echo ┗━━━━━━━━━┛
- echo.
- choice /c wasd /m #WASD移动#
- if errorlevel 1 set s=w
- if errorlevel 2 set s=a
- if errorlevel 3 set s=s
- if errorlevel 4 set s=d
- if "%s%"=="w" (goto w)
- if "%s%"=="a" (goto a)
- if "%s%"=="s" (goto s)
- if "%s%"=="d" (goto d)
- :w
- set /a x=%x%-1
- goto g
- :a
- set /a y=%y%-1
- goto g
- :s
- set /a x=%x%+1
- goto g
- :d
- set /a y=%y%+1
- goto g
- :OK
- cls
- echo 恭喜过关!
- echo 按任意键重新开始
- pause>nul
- goto c
- :die
- cls
- echo 你一头扎进了火海......
- echo 离开了这个世界......
- echo 按任意键重新开始
- pause>nul
- goto c
欢迎光临 批处理之家 (http://bbs.bathome.net/) | Powered by Discuz! 7.2 |