标题: [游戏娱乐] 批处理版推箱子 [打印本页]
作者: netbenton 时间: 2009-8-26 04:03 标题: 批处理版推箱子
本帖最后由 netbenton 于 2011-8-4 00:43 编辑
发贴前先引用他人一句话:
记得几年前,《推箱子》在PC机上刮起了一股不小的益智类游戏的旋风,现在许多资深玩家也都对《推箱子》赞不绝口,可见有深度的益智类游戏是非常受大家欢迎的。
推箱子游戏出现在计算机中最早起源于1994年台湾省李果兆开发的仓库世家,又名仓库番,箱子只可以推, 不可以拉, 而且一次只能推动一个,胜利条件就是把所有的箱子都推到目的地。
推箱子游戏是一种老少皆宜的益智游戏,既可以开发青少年学生的智力,又可以防止老年痴呆症,全家一起攻关还可以促进家庭和睦,何乐而不为?
虽然这种游戏已经很多,但是批处理的玩法是别有情趣哦!
看!批处理版推箱子游戏登场!!!!
砖块快点扔过来。。。呵呵!!
2009-08-27进一步精简代码,并做好了10关,
大家都来试试能不能全部通过。
2009-08-29再次改进,摆脱了choice.exe 的依赖,只有一个文件,增加已经通过的关记录,请看代码:
2009-09-13 更新
增加了几关其中有一关为超大地图(cn-dos)一网友提供,
增强了对大地图的支持(指一屏以外的)
2010-05-28 更新
引入了一个字符保存4个记录信息的方法,目前用只第一行文本可支持300关做记录- @goto :begin @1@0000000000000000000000000000000000000000000此为用户记录保存行,请不要删移!
- e 100 cd 16 86 c4 b4 02 cd 10 b4 4C CD 21
- g
- :begin
- @echo off
- pushd "%~dp0"
- chcp 437 >nul
- graftabl 936 >nul
- color 2f
- set "a=i83=10;i1=7;i72=1;i80=3;i75=2;i77=4;i73=8;i81=9;i57=5;i28=6;c1=n-;c2=m-;c3=n+;c4=m+;∷=^^!r!n!.!m!^^!-∷;☆=^^!r!n!.!m!^^!-☆;▓∷=▓-∷;▓☆=★-∷;★∷=▓-☆;★☆=★-☆;原=∷
- set %a:;=&set %
- setlocal enabledelayedexpansion
- for /f "tokens=2,3 delims=囧" %%a in (%~nx0) do (
- set var=!var!%%a
- if "%%b" equ "" (
- set lev!n!=!var!
- set/a n+=1
- set var=
- )
- )
- set a=a=■;b=∷;c=▓;d=☆;e=★;f=大;tc=abcdefg;tn=1234567890;g=;/a end=n,z=8180,x=0,n=0,m=0;$a=
- set cr=^
-
- &set %a:;=&set %
- set/p ygx=< %~nx0 >nul
- for /f "tokens=2,3 delims=@" %%a in ("!ygx!") do (
- set lev=%%a
- set ygx=%%b
- )
- set hhoo=@f1111@e1110@d1101@c1100@b1011@a1010@91001@81000@70111@60110@50101@40100@30011@20010@10001@00000@
- ::定义数据,用于16进制和二进制的互换
- for /l %%a in (0,1,40) do (
- for %%b in ("!ygx:~%%a,1!") do (
- set ygn=!hhoo:*@%%~b=!
- set yg=!yg!!ygn:~,4!
- ) )
- set ygx=
- ::16进制转二进制
-
- set/a n0=0,n9=17,m0=-1
- set yg=0!yg!
- goto :skend
- :restart
- endlocal&set lev=%lev%&set yg=%yg%
- :skend
- cls&setlocal enabledelayedexpansion
- set str=!lev%lev%!
- for /l %%a in (1,1,14) do (set/a "y=(z-x)/2+x"
- for %%b in (!y!) do if "!str:~%%b,1!" equ "" (set/a z=y) else (set/a x=y)
- )
- for /l %%a in (0,1,!x!) do (set/a t=%%a+1
- for %%b in (!t!) do (
- for /f "tokens=1-3 delims=-" %%1 in ("!str:~%%a,1!-!str:~%%b,1!-!n!") do (
- if "!tc:%%1=!" neq "!tc!" (
- if "!tn:%%2=!" neq "!tn!" (set k=%%2) else (set k=1)
- for /l %%k in (1,1,!k!) do (set r!n!.!m!=!%%1!&set rr!%%1!=!n!.!m!
- if "!%%1!" equ "☆" set "ke=!ke!^!r!n!.!m!^!"
- set /a m+=1
- )
- ) else (if "%%1" equ " " set /a n+=1,m=0)
- )
- ))
- setlocal enabledelayedexpansion
- for /l %%a in (1,1,!n!) do set lev%%a=
- set /a n=!rr大:.=,m=!
- set ji=%ke%&set ji=!ji:☆=★!
- if "!yg:~%lev%,1!" equ "1" (set cyg=☆已过☆) else set cyg=
- title 批处理推箱子 第%lev%关 !cyg!
- :loop
- (
- if !n! geq !n9! set /a n0=n-17,n9=n
- if !n0! lss 0 set /a n0=0,n9=17
- if !n! lss !n0! set /a n0=n,n9=n+17
- if !m! geq !m9! set /a m0=m-34,m9=m
- if !m0! lss 0 set /a m0=0,m9=34
- if !m! lss !m0! set /a m0=m,m9=m+34
- set/a en0=n0-2,em0=m0-2,en9=n9+2,em9=m9+2
- if "!m0!!m9!" neq "%m0%%m9%" (
- set ebs=
- for /l %%b in (!em0!,1,!em9!) do (
- set "ebs=!ebs!^!@%%b^!^^^!$a^!@%%b^!^^^!
- )
- )
- )
- for /l %%a in (!en0!,1,!en9!) do (
- for %%c in ("!ebs:@=r%%a.!") do (
- for %%d in ("%%~c") do (set ebuf=!ebuf!%%~d!cr!)
- )
- )
- if "%ke%" equ "!ji!" cls&echo;!ebuf! &call :dtxs 恭喜您通过了%lev%关!! 1300&pause&goto me9
- set ebuf=!ebuf!方向键移动,空格后退一步,回车重来, Pu上一关,Pd下一关,Esc退出,Del删除记录。玩法:用“大”把“▓”全部推到“☆”内为过关
- set/p=!ebuf!<nul
- set ebuf=
- debug <%~nx0 >nul
- set in=!i%errorlevel%!
- if !in! equ 0 goto :loop
- if !in! gtr 4 goto :me%in%
- set/a sm=m,sn=n,!c%in%!=1,bm=m,bn=n,!c%in%!=1
- for /f "tokens=1,2" %%a in ("!r%bn%.%bm%! !r%bn%.%bm%!!r%n%.%m%!") do (
- for %%c in ("!%%a!!%%b!") do (
- for /f "tokens=1,2 delims=-" %%1 in (%%c) do (
- if "!%%b!" neq "" set save=r%sn%.%sm%=!r%sn%.%sm%!^&set r%bn%.%bm%=!r%bn%.%bm%!^&set r%n%.%m%=!r%n%.%m%!^&set 原=%原%^&set/a m=%sm%,n=%sn%
- set r%sn%.%sm%=!原!&set r%bn%.%bm%=大&set r%n%.%m%=%%1&set/a m=bm,n=bn&set 原=%%2
- goto :loop
- )
- set/a m=sm,n=sn
- )
- )
- goto :loop
- :me5
- if defined save (
- set r%n%.%m%=%原%
- set %save%
- set save=
- )
- goto :loop
- :me6
- endlocal&goto :restart
- :me7
- for /l %%a in (1,4,161) do (
- for %%b in ("!yg:~%%a,4!") do (
- for /f "delims=#" %%c in ("!hhoo:%%~b@=#!") do set ygn=%%~c
- set ygq=!ygq!!ygn:~-1!
- ) )
- ::2进制转16进制
-
- set a=a 10d`db "@%lev%@!ygq!"``w`q
- (echo %a:`=&echo;%) |debug %~nx0 >nul
- exit /b
- ::保存记录并退出
- :me8
- set/a lev-=2
- :me9
- set/a lev+=1
- if !lev! equ !end! set lev=1
- if !lev! equ 0 set/a lev=end-1
- set/a var=lev-1
- endlocal&(if %in% leq 4 set yg=!yg:~,%var%!1!yg:~%lev%!)&set lev=%lev%&goto :restart
- :me10
- endlocal&set yg= &set lev=1
- for /l %%a in (1,1,41) do set yg=!yg!0000
- goto :restart
-
- ::动态显示字符串
- :dtxs 字符串 速率
- setlocal enabledelayedexpansion
- set "say=%1 "
- for /l %%a in (1,1,40) do if "!say:~%%a!" neq "" set n=%%a
- set /a m=76-n
- for /l %%a in (1,1,80) do (set spacs=!spacs! &set tgs=!tgs!)
- for /l %%b in (1,1,!n!) do (
- for /l %%a in (70,-2,1) do (
- set sayq=!say:~,%%b!!spacs:~,%%a!!say:~%%b,1!
- set /p=!tgs!!sayq:~,%m%! <nul
- for /l %%c in (1,%%a,%2) do ver >nul
- ))
- goto :eof
-
-
- :囧a9a ab8a ab4d2fba ab2a2b4a ab2a4b2a aba2b5a ab4c2b2a ab8a ab8a a9a
- :囧a8g ab3ab2a abdbcdba a2ca2b2a ab2a2ca2 abdfb3a ab2ab3a a8
- :囧g4a7 g3a2b2abfa g3ab3ab2a g3acbcbcba g3abca2b2a ga3bcbaba2 gad5b2a ga9
- :囧g3a6 ga3b4a a2dbca2ba2 ad2cbcb2fa ad2bcbcba2 a5b3a g4a5
- :囧a6 abfb2a abcaba abcb2a abcba2 a3ba4 gab2ab2a gad3b2a gab5a ga7
- :囧a9a3 ab9ba aba7bfa2 abab9a abab2cb3ab2a abc2ba5b2a a3b2agabd3a g2a4gab4a g7a6
- :囧ga9 gab2a2b3a gab3cb3a gacba3bca gabad3aba a2bad3aba2 abcb2cb2cba ab5ab2fa a9a2
- :囧g2a5 g2ab3a a3cdca5 ab3dbcb3a aba2ca2bfba ab3dba5 a3bdba g2ab3a g2a5
- :囧ga4g2a5 a2b2ag2ab3a abcba4cb2a ab2cd4bcba a2b4abfba2 ga9a
- :囧a9a ad2b6a ad2cb2ab2a ab2aca2ba2 abcb5a a5baba g2abcbfba g2ab5a g2a7
- :囧a6ga5 ab4a3b3a abc2b5afa abcbad3b3a ab3a8 a5
- :囧ga5 gab3a a2bcbag2a4 ab4a4b2a abcb6cda ab3a5cda a5g3abfa g8a4
- :囧g7a5 g7adb2a g7adaba a8daba abfbcbcb2cba abababab2a3 ab8a a9a
- :囧a5 ab3a4 abababda ab4cba3 a3bacdb2a ab3afb3a ababa6 ab3a a5
- :囧a9a4 abdb2db2dbdba5 ab9b6a5 abdabda2badb9a aba2b2a9a2b3a abcbcb9b6a abcb3cbcba7b3a ab3cb2a4g5a5 a4bcba g3abfba g3a5
- :囧ga4g5 gab2a a2dfa abdca6 abc2bcb2a2 abd2b4a2 a4b2a4 g3a4
- :囧g5a4g a6b2a abcb2cb2a abab2daba2 ab2dbadfba a2cabdcb2a gab3a5 ga5
- :囧g5a6g g5ab4a ga5ba2ba2 gabcb2cb2cba a2badada2dba abcb2cda2dba ab2d2bcfbca2 a8b2a g7a4
- :囧a9g2 ab7a ab2cbcbca a2baca2ba gabd2bd2a2 ga2d2bd2ba g2aba2caba2 g2acbcbcb2a g2ab6fa g2a9
- :囧a5g7 ab3a8 abfdbdbdbdba a2bababababa gabcbcbcbcba ga6b2a3 g6a4
- :囧g4a4g a5b2a abcb3ca ab2dadba a2ba3ba2 gabdadb2a gacbfbcba gab2a5 ga4
- :囧g2a8g a3b2fb3a ab3cbcb2a ab2cbcbcba a5ca5 g3a2bdbd2a g3ab2dab2a g3abdb3da g3a4b2a2 g6a4
- :囧a9g ab2fb4a ac7a ad3ad3a ad7a ac3bc3a ab7a a9
- :囧a9ag ab8a2 abcacacacfa adbdcd3cda adbdcd3cda abcacacaca2 ab8a a9a
- :囧a2 a9a ab2ab2ad2a afbcbcbdba ab3cb2cba abababadba a9a
- :囧g9g7a4g9g2 g5a5g3a4b2a a4gab3a6b4a9a ab2a3bab8ab9b2a abcd5ababcbabad2ab4c2aba ab2a2d3cb2abcabad2b2a2b3cba3 ab4ca2cabacbcbad2ab2a2cabcb2a abcacb3cb2abcb2ad2b3ab2cbcb2a a2b3a3cabad3a2d2ab2abcacb3a ga2ba2bab3ad2a3bdb3abcbcba3 a3bab2a9ab2ab2ab3a4 ab7a2b6ab2ab4a6 abcacacbab3cbcb2a9ab2a adcdb2cbab2cbcbcb8cb3ca ad3a2b2a5ca9b2dadba a4b3a6bdbd2ab3a2ba3ba2 g3ab2db2cbab2dab2adaca2bdadb2a g3a3d2bcbabdb3dab4acb3cba g3a3c2bcbaba2b2a2dacbab2a5 ga3bdcdbab3a6b3a2ba2 gab2cd3ca5g4adacab2a gab3a2dcbag6a2b5a2 ga6b3a囧@
- :囧g6abdaca3 g6a5g6ab4a g9g8afba3 g9g8a4
- :囧g9g7a4 g5a5g3a4b2a a4gab3a6b4a9a ab2a3bab8ab9b2a abcd5ababcbabad2ab4c2aba ab2a2d3cb2abcabad2b2a2b3cba3 ab4ca2cabacbcbad2ab2a2cabcb2a abcacb3cb2abcb2ad2b3ab2cbcb2a a2b3a3cabad3a2d2ab2abcacb3a ga2ba2bab3ad2a3bdb3abcbcba3 a3bab2a9ab2ab2ab3a4 ab7a2b6ab2ab4a6 abcacacbab3cbcb2a9ab2a adcdb2cbab2cbcbcb8cb3ca ad3a2b2a5ca9b2dadba a4b3a6bdbd2ab3a2ba3ba2 g3ab2db2cbab2dab2adaca2bdadb2a g3a3d2bcbabdb3dab4acb3cba g3a3c2bcbaba2b2a2dacbab2a5 ga3bdcdbab3a6b3a2ba2 gab2cd3ca5g4adacab2a gab3a2dcbag6a2b5a2 ga6b3ag6ab囧@
- :囧daca3 g6a5g6ab4a g9g8afba3 g9g8aba2g9g9g9g9g3a7 g9g8ab2ag9g9g9g9g3adbdbda g9g8ab2ag9g9g9g9g3ab5a g9g8ab2ag9g9g9g9g3adbdbda g9g8ab2ag9g9g9g9g3ab5a g9g8ab2ag9g9g9g9g3adb4a g9g8ab2ag9g9g9g9g3a4ba2 g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g2a7g9g6aba g9g8ab2ag9g9g2ab5ag9g6aba g9g8ab2ag9g9g2囧@
- :囧ab5ag9g6aba g9g8ab2ag9g9g2acbcbcag9g6aba g9g8ab2ag9g9g2ab5ag9g6aba g9g8ab2ag9g9g2acbcbcag9g6aba g9g8ab2a9a9a4b5a9a8ba g9g8ab4cb9b9b9b9b6a g9g8ab9b9b9b9b9b2a g9g8a9a9a9a9a9a4
复制代码
作者: 小勇12 时间: 2009-8-26 05:05
太强了,看别人的C语言推箱子我都看了n久才看懂,哎高手就是不一样 沙发
作者: canyuexiaolang 时间: 2009-8-26 07:51
啊啊啊啊啊啊啊啊啊、、我家Choice命令怎么用不了
作者: yslyxqysl 时间: 2009-8-26 08:35
看得不太舒服 空的地方就不需要字了吧
作者: yslyxqysl 时间: 2009-8-26 08:40
Bug:
wasd移动,b后退一步,r重新开始,
g下一关,q退出。
第6关 不存在。。。
请按任意键继续. . .
第7关 不存在。。。
请按任意键继续. . .
第8关 不存在。。。
请按任意键继续. . .
第9关 不存在。。。
请按任意键继续. . .
第10关 不存在。。。
请按任意键继续. . .
第11关 不存在。。。
请按任意键继续. . .
第12关 不存在。。。
请按任意键继续. . .
作者: yslyxqysl 时间: 2009-8-26 08:41
感觉很熟悉...
作者: yzq189424658 时间: 2009-8-26 10:13
啊啊啊..啊..
高手啊..我什么时候才能有这点啊.
作者: netbenton 时间: 2009-8-26 20:39
修正了一些BUG,并改了一点算法,精简了代码,一大堆if用for代替了,此方法应该算是查表转换法吧
回:yslyxqysl
6楼的那个是从你的 [走迷宫] 那里盗版的,呵呵,被你抓着了... 呵呵!!
[ 本帖最后由 netbenton 于 2009-8-26 20:42 编辑 ]
作者: netbenton 时间: 2009-8-29 14:36
改进了,不需要choice.exe 了,关级文件也集成到程序内了,而且只有3K多一点,呵呵,这次没有尾巴给抓咯!
作者: 523066680 时间: 2009-8-29 17:30
我感觉很好。额,这个,打不打算记录关卡啊。
下次打开才能继续玩。
这样的话,记得上次搞两个批处理对话的时候 net 有个很好的记录方式的不用临时文件。
我那次用任务计划记录字符了,简直浪费系统资源。
先看看你咋弄,我有很恶搞的方法。
作者: netbenton 时间: 2009-8-29 19:32
增加了记录功能,存到数据文件
(已经在顶楼更新)
作者: netbenton 时间: 2009-9-30 00:07 标题: 推箱子源码解释
批处理推箱子源码解释:
1、数据定义的紧凑格式的使用
先把变量定义集放到变量:(要注意分隔符是唯一的,这里用“;”号)
set a=a=i75;b=i79;str=abc
这样变量a的值为:a=i75;b=i79;str=abc
利用预处理时变量值替换:
set %a:;=&set %
相当于以下语句被执行:
set a=i75&set b=i79&set str=abc
或者:
set a=i75
set b=i79
set str=abc
如果要定义的变量很多,综合从占用空间和可读性上看,此法有明显的优势。
2、推条子程序实现算法
1). 读取关级数据放到数组:lev(n)
改变n的值,即为改变关级,这里 n=%lev%
2). 把当前关地图数据还原并存到二维数组:r(n).(m),
(一) 把值为坑“☆”的变量名r(n).(m),集放到变量ke,并把“☆”的个数存到变量ji,同时转为“★”;
%ke%扩展后就是源值为坑“☆”的所有二维变量的实时的值了;只要%ke% 等于 !ji! 表明过关了
(二) 按行把二维变量名存为数组:r(n)
%r(n)%扩展后即为第n行的所有二维数组的实时值
3). 变量ebuf作为显示缓存,所有要显示的内容全部存到ebuf,一次性用echo !ebuf!全部显示完成。
因为for 变更 %%a 在扩展后,会再次扩展!号变量,所以:
for /l %%a in (1,1,!r!) do for %%b in ("!r%%a!") do set ebuf=!ebuf! %%~b!cr!
上面依次把:1到!r!行的变量名数组r(n)扩展后的值,全部存到显示缓存ebuf内,并且加上了换行符!cr!
4).首先定义好按上下左右所进行的操作:
"c1=n-;c2=m-;c3=n+;c4=m+"
这样就可以通过下面代码:
set/a sm=m,sn=n,!c%in%!=1,bm=m,bn=n,!c%in%!=1
分别取得按了 上/下/左/右 后,源点:sm.sn,步进一:bm.bn,步进二:m.n,三个坐标的值
for /f "tokens=1,2" %%a in ("!r%bn%.%bm%! !r%bn%.%bm%!!r%n%.%m%!") do (
取出三个坐标的值并摆开为:(步进一 => %%a) (步进一+步进二 =>%%b) 例如:%%a=▓ %%b=▓∷
for %%c in ("!%%a!!%%b!") do (
%%a %%b 经再扩展后,组后到%%c, 接上例:!▓! =>空, !▓∷! =>▓-∷
则: ▓-∷ => %%c
for /f "tokens=1,2 delims=-" %%1 in (%%c) do (
摆开为:%%1=▓,%%2=∷
接下来就 if 判断了,根据各种情况把三个点和一个“大”站的!源!点的值重新调整
注意:有一点,如果%%c的值为空,如 %%b=▓■ 为时,则这个for将是空转,即连里面的if语句也不会被执行,
使得后面的 set/a m=sm,n=sn 被执行了
3、关级数据压缩与还原
1).压缩,因全角为双字节,用单字转换后可以少一半,如果 ▓=a,zf=▓,则:set zf=!%af%! 就可转过来了
如果不只一个连续的则在字母后跟个数字表示个数,超过9则另起一组,如:a11,则拆为a9a2
2).还原,引用:囧开头的好处,
for /f "tokens=2* delims=囧" %%a in (%~nx0) do (set lev!n!=%%a&set/a n+=1)
这样在读取时可以减去了对其它非数据行的读取,加快了速度
同样的方法把字符转换回来,再把搂字作为for /l 计数重复即可全部转换
if "!tn:%%2=!" neq "!tn!" (set k=%%2) else (set k=1)
for /l %%k in (1,1,!k!) do (
上面的!k!即为字符个数
4、摆脱choice.exe 和 刷屏不闪
就是用debug.exe 来替了,但是这个是通常所有dos系统都会自带的,所以。。三方。。。
debug <%~nx0>nul
调用自身作为管道输入,第一行是出错的,真正有用的只有两行
e 100 cd 16 86 c4 b4 02 cd 10 b4 4C CD 21 写入代码
g 执行
这里面进行了键读取,把当前光标位置设为第一行,第一列,并把按键数据作为返回码到:%errorlevel%
定义:"a=i83=10;i1=7;i72=1;i80=3;i75=2;i77=4;i73=8;i81=9;i57=5;i79=6"
执行:set in=!i%errorlevel%!
就根据定义得到按键情况,如果示定义的则为空
平时写批处理要回到第一行显示时,只有用cls,然后再显示,显然速度也很快,还是觉得有点闪。
直接把光标重置到第一行,第一列,并没有清屏,再次显示时是在原来的基础上的,所以少了闪的感觉
如果看汇编源码,很简单,把debug <%~nx0>nul后面的>nul去掉,再在e 行和g 行间加入一行u 就可以了
5、玩家记录保存,与读取
这里是把记录存在批处理的第一行,
1).读取
set/p yg=< %~nx0 >nul
取第一行到变量 yg
set yg=!yg:~13,52!
set lev=%yg=&rem %
因为当前关记录和已过关的记录是以@为分隔的,这样可以只所@前面的给lev,@后面的被rem 掉了
set yg= !yg:* =!
只取已过关的数据,并且保持前后必须有空格
这样已经所当前关,及已过经过了的关的数据全部读取到变量了
2).保存
set a=a 10d`db "!lev!@!yg! "``w`q
(echo %a:`=&echo;%)|debug %~nx0 >nul
经扩展为:
(echo a 10d&echo;db "!lev!@!yg! "&echo;&echo;w&echo;q)|debug %~nx0 >nul
实际上是把以下命令行递给debug 去执行:
a 10d
db "!lev!@!yg! "
w
q
利用了debug 的a命令输入汇编指令时,可以用db 定义字符串,然后直接用W命令可以写打开的文件
并且批处理程序在执行过程中,是可以修改自身的
作者: a4188809b 时间: 2009-10-2 14:48
长玩的游戏 ! 貌似 还有个是 贪吃蛇!
作者: netbenton 时间: 2010-5-28 22:02
2010-05-28 更新
引入了一个字符保存4个记录信息的方法,目前用只第一行文本可支持对300关做记录
下面是16进制与2进制数据串互相转换的方法:
-
- set hhoo=@f1111@e1110@d1101@c1100@b1011@a1010@91001@81000@70111@60110@50101@40100@30011@20010@10001@00000@
- ::定义数据,用于16进制和二进制的互换
- for /l %%a in (0,1,40) do (
- for %%b in ("!ygx:~%%a,1!") do (
- set ygn=!hhoo:*@%%~b=!
- set yg=!yg!!ygn:~,4!
- ) )
- set ygx=
- ::16进制转二进制
-
-
- for /l %%a in (1,4,161) do (
- for %%b in ("!yg:~%%a,4!") do (
- for /f "delims=#" %%c in ("!hhoo:%%~b@=#!") do set ygn=%%~c
- set ygq=!ygq!!ygn:~-1!
- ) )
- ::2进制转16进制
复制代码
[ 本帖最后由 netbenton 于 2010-5-28 22:04 编辑 ]
作者: Little_quiz2 时间: 2011-1-4 14:53
进入以后乱码,然后一按键就无响应了,怎么办?
作者: netbenton 时间: 2011-8-4 00:47
不知道为什么会丢掉了一行关健的空白行,已经改好了。
还加入了过关时字符串飞入显示效果...
作者: cjiabing 时间: 2011-8-4 02:11
回复 16# netbenton
呵呵,难得见你在,好久没见你了啊!~
作者: cutebe 时间: 2013-1-17 15:05
18 关我是玩不过去,还有26关的倒数第三区域也不会。
但 26 关(倒数二关)与 27 关(最后一关)却是没可能玩过去。这两关类似,最后一关只是在倒二基础上加了点东西。都是将一些小图当作区域组成一幅大图,有些区域前面关卡已经出现过,有些没有。
就 26 关来说,最后一个区域没有机会。因为有11个五角星目标地点,也只有11个箱子。但有个小区域无论如何推都至少有一个箱子会到死角出不来。
▓■▓
▓ ▓
这个小区域开始只有下方两个箱子可推。如果向这个小区域中心推就会有三个箱子成死箱子,如果向左推左边的箱子只能在三个格子区域磨或是进入死角,若向右推呢右边的又直接进入死角,所以变成不可能完成的任务了。
或许楼主没注意到,又或许再往右敲掉一块■就OK了。
作者: 522235677 时间: 2013-4-3 10:59
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
╖╜╧≥╝ⁿ╥╞╢»ú¼┐╒╕±║≤═╦╥╗▓╜ú¼╗╪│╡╓╪└┤ú¼ Pu╔╧╥╗╣╪ú¼d╧┬╥╗╣╪ú¼Esc═╦│÷ú¼Del╔╛│2╝╟┬╝
μ╖¿ú║╙├í░┤≤í▒░╤í░¿êí▒╚½▓┐═╞╡╜í░íεí▒─┌╬¬╣2╣╪'debug' is not recognized as an in
nal or external command,
operable program or batch file.
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
╖╜╧≥╝ⁿ╥╞╢»ú¼┐╒╕±║≤═╦╥╗▓╜ú¼╗╪│╡╓╪└┤ú¼ Pu╔╧╥╗╣╪ú¼Pd╧┬╥╗╣╪ú¼Esc═╦│÷ú¼Del╔╛│2╝╟┬╝
μ╖¿ú║╙├í░┤≤í▒░╤í░¿êí▒╚½▓┐═╞╡╜í░íεí▒─┌╬¬╣2╣╪'debug' is not recognized as an in
nal or external command,
operable program or batch file.
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
╖╜╧≥╝ⁿ╥╞╢»ú¼┐╒╕±║≤═╦╥╗▓╜ú¼╗╪│╡╓╪└┤ú¼ Pu╔╧╥╗╣╪ú¼Pd╧┬╥╗╣╪ú¼Esc═╦│÷ú¼Del╔╛│2╝╟┬╝
μ╖¿ú║╙├í░┤≤í▒░╤í░¿êí▒╚½▓┐═╞╡╜í░íεí▒─┌╬¬╣2╣╪'debug' is not recognized as an in
nal or external command,
operable program or batch file.
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
╖╜╧≥╝ⁿ╥╞╢»ú¼┐╒╕±║≤═╦╥╗▓╜ú¼╗╪│╡╓╪└┤ú¼ Pu╔╧╥╗╣╪ú¼Pd╧┬╥╗╣╪ú¼Esc═╦│÷ú¼Del╔╛│2╝╟┬╝
μ╖¿ú║╙├í░┤≤í▒░╤í░¿êí▒╚½▓┐═╞╡╜í░íεí▒─┌╬¬╣2╣╪'debug' is not recognized as an in
nal or external command,
operable program or batch file.
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
ííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííííí
╖╜╧≥╝ⁿ╥╞╢»ú¼┐╒╕±║≤═╦╥╗▓╜ú¼╗╪│╡╓╪└┤ú¼ Pu╔╧╥╗╣╪ú¼Pd╧┬╥╗╣╪ú¼Esc═╦│÷ú¼Del╔╛│2╝╟┬╝
μ╖¿ú║╙├í░┤≤í▒░╤í░¿êí▒╚½▓┐═╞╡╜í░íεí▒─┌╬¬╣2╣╪'debug' is not recognized as an in
nal or external command,
operable program or batch file.
作者: cjiabing 时间: 2013-4-3 20:39
回复 19# 522235677
囧~!遇到个会用英文表达的人!~
作者: 522235677 时间: 2013-4-6 12:21
回复 20# cjiabing
什么意思,我打开后就是这样乱码乱跳
作者: 狱渊 时间: 2013-4-28 19:48
回复 1# netbenton
虽然游戏简单 不过没想到原来是这么复杂啊 厉害 支持啊
作者: 尘丶 时间: 2015-8-15 16:16
有没提示- -好难
作者: 路过 时间: 2015-10-1 21:08
有些关怎么完也过不去。
作者: winload 时间: 2015-10-7 22:58
还是挺好玩的,虽然界面效果粗糙。呵呵!
作者: netbenton 时间: 2022-1-7 17:49
64位版本。
win 7
win 8
win xp
要用到三方,MK.exe- :#a
- @goto :#b%goto%
- 5@ 4 3 2 1 此行为记录数据行,请不要删移! 5 6 7 8 9 10 11 14 13
- :#b
-
- @echo off
- pushd "%~dp0"
- chcp 936 >nul
- mode con: cols=78 lines=25
-
- set "a=i1038=1;i1040=3;i1037=2;i1039=4;i1033=8;i1034=9;i13232=5;i11313=6;i12727=7;i1046=10;c1=n-;c2=m-;c3=n+;c4=m+;∷=^^!r!n!.!m!^^!-∷;☆=^^!r!n!.!m!^^!-☆;□∷=□-∷;□☆=★-∷;★∷=□-☆;★☆=★-☆;原=∷
- set %a:;=&set %
- setlocal enabledelayedexpansion
-
- for /f "tokens=2,3 delims=囧" %%a in (%~nx0) do (
- set var=!var!%%a
- if "%%b" equ "" (
- set lev!n!=!var!
- set/a n+=1
- set var=
- )
- )
-
- set a=a=■;b=∷;c=□;d=☆;e=★;f=♀;tc=abcdefg;tn=1234567890;g=;/a end=n,z=8180,x=0,n=0,m=0;$a=
- set cr=^
-
- &set %a:;=&set %
- (
- set/p yg=
- set/p yg=
- set/p yg=
- )< "%~nx0" >nul
-
- set lev=%yg:@=&rem %
- set yg= !yg:* =!
- set/a n0=0,n9=17,m0=-1
-
-
- goto :skend
- :restart
- endlocal&set lev=%lev%&set yg=%yg%
- :skend
- cls&setlocal enabledelayedexpansion
- set str=!lev%lev%!
- for /l %%a in (1,1,14) do (set/a "y=(z-x)/2+x"
- for %%b in (!y!) do if "!str:~%%b,1!" equ "" (set/a z=y) else (set/a x=y)
- )
-
- for /l %%a in (0,1,!x!) do (set/a t=%%a+1
- for %%b in (!t!) do (
- for /f "tokens=1-3 delims=-" %%1 in ("!str:~%%a,1!-!str:~%%b,1!-!n!") do (
- if "!tc:%%1=!" neq "!tc!" (
- if "!tn:%%2=!" neq "!tn!" (set k=%%2) else (set k=1)
- for /l %%k in (1,1,!k!) do (set r!n!.!m!=!%%1!&set rr!%%1!=!n!.!m!
- if "!%%1!" equ "☆" set "ke=!ke!^!r!n!.!m!^!"
- set /a m+=1
- )
- ) else (if "%%1" equ " " set /a n+=1,m=0)
- )
- ))
- setlocal enabledelayedexpansion
- for /l %%a in (1,1,!n!) do set lev%%a=
-
- set /a n=!rr♀:.=,m=!
- set ji=%ke%&set ji=!ji:☆=★!
-
- if "!yg: %lev% =!" neq "!yg!" (set cyg=☆已过☆) else set cyg=
- title 批处理推箱子 第%lev%关 !cyg!
- :loop
-
- (
- if !n! geq !n9! set /a n0=n-17,n9=n
- if !n0! lss 0 set /a n0=0,n9=17
- if !n! lss !n0! set /a n0=n,n9=n+17
-
- if !m! geq !m9! set /a m0=m-33,m9=m
- if !m0! lss 0 set /a m0=0,m9=33
- if !m! lss !m0! set /a m0=m,m9=m+33
-
- set/a en0=n0-2,em0=m0-2,en9=n9+2,em9=m9+2
-
- if "!m0!!m9!" neq "%m0%%m9%" (
- set ebs=
- for /l %%b in (!em0!,1,!em9!) do (
- set "ebs=!ebs!^!@%%b^!^^^!$a^!@%%b^!^^^!
- )
- )
- )
-
- for /l %%a in (!en0!,1,!en9!) do (
- for %%c in ("!ebs:@=r%%a.!") do (
- for %%d in ("%%~c") do (set ebuf=!ebuf!%%~d!cr!)
- )
- )
-
- if "%ke%" equ "!ji!" cls&echo !ebuf! 恭喜你过关了!&pause&goto :me9
- set ebuf=!ebuf!方向键移动,空格后退一步,回车重来, Pu上一关,Pd下一关,Esc退出,Del删除记录。玩法:用“♀”把“□”全部推到“☆”内为过关
-
-
-
-
-
-
- set/p=.!ebuf!<nul
- set ebuf=
- set in=0
- for /f "tokens=1-5" %%1 in ('mk.exe /w /c 5000') do set/a in=!i%%1%%2%%3!
- cls
-
- if !in! equ 0 goto :loop
- if !in! gtr 4 goto :me%in%
- set/a sm=m,sn=n,!c%in%!=1,bm=m,bn=n,!c%in%!=1
- for /f "tokens=1,2" %%a in ("!r%bn%.%bm%! !r%bn%.%bm%!!r%n%.%m%!") do (
- for %%c in ("!%%a!!%%b!") do (
- for /f "tokens=1,2 delims=-" %%1 in (%%c) do (
- if "!%%b!" neq "" set save=r%sn%.%sm%=!r%sn%.%sm%!^&set r%bn%.%bm%=!r%bn%.%bm%!^&set r%n%.%m%=!r%n%.%m%!^&set 原=%原%^&set/a m=%sm%,n=%sn%
- set r%sn%.%sm%=!原!&set r%bn%.%bm%=♀&set r%n%.%m%=%%1&set/a m=bm,n=bn&set 原=%%2
- goto :loop
- )
- set/a m=sm,n=sn
- )
- )
- goto :loop
-
- :me5
- if defined save (
- set r%n%.%m%=%原%
- set %save%
- set save=
- )
- goto :loop
-
- :me6
- endlocal&goto :restart
-
- :me7
-
- (
- echo;:#a
- echo;@goto :#b%%goto%%
- echo;%lev%@%yg%
- more +3 "%~nx0"
- )>"%~n0.tmp"
- set goto=_OK
- del "%~nx0"&ren "%~n0.tmp" "%~nx0"&goto :#a
- 修改批处理本身,需避免出错
-
- :#b_OK
- exit /b
-
- :me8
- set/a lev-=2
- :me9
- set/a lev+=1
- if !lev! equ !end! set lev=1
- if !lev! equ 0 set/a lev=end-1
- endlocal&(if %in% leq 4 for %%a in (!lev!) do set "yg= !lev!!yg: %%~a = !")&set lev=%lev%&goto :restart
-
- :me10
- endlocal&set yg=&set lev=1
- for /l %%a in (1,1,52) do set yg=!yg!
- goto :restart
-
- :囧a9a ab8a ab4d2fba ab2a2b4a ab2a4b2a aba2b5a ab4c2b2a ab8a ab8a a9a
- :囧a8g ab3ab2a abdbcdba a2ca2b2a ab2a2ca2 abdfb3a ab2ab3a a8
- :囧a9a4 abdb2db2dbdba5 ab9b6a5 abdabda2badb9a aba2b2a9a2b3a abcbcb9b6a abcb3cbcba7b3a ab3cb2a4g5a5 a4bcba g3abfba g3a5
- :囧ga4g5 gab2a a2dfa abdca6 abc2bcb2a2 abd2b4a2 a4b2a4 g3a4
- :囧g5a4g a6b2a abcb2cb2a abab2daba2 ab2dbadfba a2cabdcb2a gab3a5 ga5
- :囧g5a6g g5ab4a ga5ba2ba2 gabcb2cb2cba a2badada2dba abcb2cda2dba ab2d2bcfbca2 a8b2a g7a4
- :囧a9g2 ab7a ab2cbcbca a2baca2ba gabd2bd2a2 ga2d2bd2ba g2aba2caba2 g2acbcbcb2a g2ab6fa g2a9
- :囧a5g7 ab3a8 abfdbdbdbdba a2bababababa gabcbcbcbcba ga6b2a3 g6a4
- :囧g4a4g a5b2a abcb3ca ab2dadba a2ba3ba2 gabdadb2a gacbfbcba gab2a5 ga4
- :囧g2a8g a3b2fb3a ab3cbcb2a ab2cbcbcba a5ca5 g3a2bdbd2a g3ab2dab2a g3abdb3da g3a4b2a2 g6a4
- :囧a9g ab2fb4a ac7a ad3ad3a ad7a ac3bc3a ab7a a9
- :囧a9ag ab8a2 abcacacacfa adbdcd3cda adbdcd3cda abcacacaca2 ab8a a9a
- :囧a2 a9a ab2ab2ad2a afbcbcbdba ab3cb2cba abababadba a9a
- :囧g9g7a4g9g2 g5a5g3a4b2a a4gab3a6b4a9a ab2a3bab8ab9b2a abcd5ababcbabad2ab4c2aba ab2a2d3cb2abcabad2b2a2b3cba3 ab4ca2cabacbcbad2ab2a2cabcb2a abcacb3cb2abcb2ad2b3ab2cbcb2a a2b3a3cabad3a2d2ab2abcacb3a ga2ba2bab3ad2a3bdb3abcbcba3 a3bab2a9ab2ab2ab3a4 ab7a2b6ab2ab4a6 abcacacbab3cbcb2a9ab2a adcdb2cbab2cbcbcb8cb3ca ad3a2b2a5ca9b2dadba a4b3a6bdbd2ab3a2ba3ba2 g3ab2db2cbab2dab2adaca2bdadb2a g3a3d2bcbabdb3dab4acb3cba g3a3c2bcbaba2b2a2dacbab2a5 ga3bdcdbab3a6b3a2ba2 gab2cd3ca5g4adacab2a gab3a2dcbag6a2b5a2 ga6b3a囧@
- :囧g6abdaca3 g6a5g6ab4a g9g8afba3 g9g8a4
- :囧g9g7a4 g5a5g3a4b2a a4gab3a6b4a9a ab2a3bab8ab9b2a abcd5ababcbabad2ab4c2aba ab2a2d3cb2abcabad2b2a2b3cba3 ab4ca2cabacbcbad2ab2a2cabcb2a abcacb3cb2abcb2ad2b3ab2cbcb2a a2b3a3cabad3a2d2ab2abcacb3a ga2ba2bab3ad2a3bdb3abcbcba3 a3bab2a9ab2ab2ab3a4 ab7a2b6ab2ab4a6 abcacacbab3cbcb2a9ab2a adcdb2cbab2cbcbcb8cb3ca ad3a2b2a5ca9b2dadba a4b3a6bdbd2ab3a2ba3ba2 g3ab2db2cbab2dab2adaca2bdadb2a g3a3d2bcbabdb3dab4acb3cba g3a3c2bcbaba2b2a2dacbab2a5 ga3bdcdbab3a6b3a2ba2 gab2cd3ca5g4adacab2a gab3a2dcbag6a2b5a2 ga6b3ag6ab囧@
- :囧daca3 g6a5g6ab4a g9g8afba3 g9g8aba2g9g9g9g9g3a7 g9g8ab2ag9g9g9g9g3adbdbda g9g8ab2ag9g9g9g9g3ab5a g9g8ab2ag9g9g9g9g3adbdbda g9g8ab2ag9g9g9g9g3ab5a g9g8ab2ag9g9g9g9g3adb4a g9g8ab2ag9g9g9g9g3a4ba2 g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g2a7g9g6aba g9g8ab2ag9g9g2ab5ag9g6aba g9g8ab2ag9g9g2囧@
- :囧ab5ag9g6aba g9g8ab2ag9g9g2acbcbcag9g6aba g9g8ab2ag9g9g2ab5ag9g6aba g9g8ab2ag9g9g2acbcbcag9g6aba g9g8ab2a9a9a4b5a9a8ba g9g8ab4cb9b9b9b9b6a g9g8ab9b9b9b9b9b2a g9g8a9a9a9a9a9a4
复制代码
作者: netbenton 时间: 2022-1-7 18:11
win10
32位,64位
不闪屏。
要用到三方 mk.exe- :#a
- @goto :#b%goto%
- 5@ 4 3 2 1 此行为记录数据行,请不要删移! 5 6 7 8 9 10 11 14 13
- :#b
-
- @echo off
- pushd "%~dp0"
- chcp 936 >nul
- mode con: cols=78 lines=25
-
- for /F "tokens=1 delims=#" %%a in ('"prompt #$E# & echo on & for %%b in (1) do rem"') do set "esc=%%a"
- set #=%esc%[
- echo;%#%?25l
-
-
- set "a=i1038=1;i1040=3;i1037=2;i1039=4;i1033=8;i1034=9;i13232=5;i11313=6;i12727=7;i1046=10;c1=n-;c2=m-;c3=n+;c4=m+;∷=^^!r!n!.!m!^^!-∷;☆=^^!r!n!.!m!^^!-☆;□∷=□-∷;□☆=★-∷;★∷=□-☆;★☆=★-☆;原=∷
- set %a:;=&set %
- setlocal enabledelayedexpansion
-
- for /f "tokens=2,3 delims=囧" %%a in (%~nx0) do (
- set var=!var!%%a
- if "%%b" equ "" (
- set lev!n!=!var!
- set/a n+=1
- set var=
- )
- )
-
- set a=a=■;b=∷;c=□;d=☆;e=★;f=♀;tc=abcdefg;tn=1234567890;g=;/a end=n,z=8180,x=0,n=0,m=0;$a=
- set cr=^
-
- &set %a:;=&set %
- (
- set/p yg=
- set/p yg=
- set/p yg=
- )< "%~nx0" >nul
-
- set lev=%yg:@=&rem %
- set yg= !yg:* =!
- set/a n0=0,n9=17,m0=-1
-
-
- goto :skend
- :restart
- endlocal&set lev=%lev%&set yg=%yg%
- :skend
- cls&setlocal enabledelayedexpansion
- set str=!lev%lev%!
- for /l %%a in (1,1,14) do (set/a "y=(z-x)/2+x"
- for %%b in (!y!) do if "!str:~%%b,1!" equ "" (set/a z=y) else (set/a x=y)
- )
-
- for /l %%a in (0,1,!x!) do (set/a t=%%a+1
- for %%b in (!t!) do (
- for /f "tokens=1-3 delims=-" %%1 in ("!str:~%%a,1!-!str:~%%b,1!-!n!") do (
- if "!tc:%%1=!" neq "!tc!" (
- if "!tn:%%2=!" neq "!tn!" (set k=%%2) else (set k=1)
- for /l %%k in (1,1,!k!) do (set r!n!.!m!=!%%1!&set rr!%%1!=!n!.!m!
- if "!%%1!" equ "☆" set "ke=!ke!^!r!n!.!m!^!"
- set /a m+=1
- )
- ) else (if "%%1" equ " " set /a n+=1,m=0)
- )
- ))
- setlocal enabledelayedexpansion
- for /l %%a in (1,1,!n!) do set lev%%a=
-
- set /a n=!rr♀:.=,m=!
- set ji=%ke%&set ji=!ji:☆=★!
-
- if "!yg: %lev% =!" neq "!yg!" (set cyg=☆已过☆) else set cyg=
- title 批处理推箱子 第%lev%关 !cyg!
- :loop
-
- (
- if !n! geq !n9! set /a n0=n-17,n9=n
- if !n0! lss 0 set /a n0=0,n9=17
- if !n! lss !n0! set /a n0=n,n9=n+17
-
- if !m! geq !m9! set /a m0=m-33,m9=m
- if !m0! lss 0 set /a m0=0,m9=33
- if !m! lss !m0! set /a m0=m,m9=m+33
-
- set/a en0=n0-2,em0=m0-2,en9=n9+2,em9=m9+2
-
- if "!m0!!m9!" neq "%m0%%m9%" (
- set ebs=
- for /l %%b in (!em0!,1,!em9!) do (
- set "ebs=!ebs!^!@%%b^!^^^!$a^!@%%b^!^^^!
- )
- )
- )
-
- for /l %%a in (!en0!,1,!en9!) do (
- for %%c in ("!ebs:@=r%%a.!") do (
- for %%d in ("%%~c") do (set ebuf=!ebuf!%%~d!cr!)
- )
- )
-
- if "%ke%" equ "!ji!" cls&echo !ebuf! 恭喜你过关了!&pause&goto :me9
- set ebuf=!ebuf!方向键移动,空格后退一步,回车重来, Pu上一关,Pd下一关,Esc退出,Del删除记录。玩法:用“♀”把“□”全部推到“☆”内为过关
-
-
-
-
-
-
- set/p=%#%1;1H!ebuf!<nul
- set ebuf=
- set in=0
- for /f "tokens=1-5" %%1 in ('mk.exe /w /c 5000') do set/a "in=!i%%1%%2%%3!"
-
-
- if !in! equ 0 goto :loop
- if !in! gtr 4 goto :me%in%
- set/a sm=m,sn=n,!c%in%!=1,bm=m,bn=n,!c%in%!=1
- for /f "tokens=1,2" %%a in ("!r%bn%.%bm%! !r%bn%.%bm%!!r%n%.%m%!") do (
- for %%c in ("!%%a!!%%b!") do (
- for /f "tokens=1,2 delims=-" %%1 in (%%c) do (
- if "!%%b!" neq "" set save=r%sn%.%sm%=!r%sn%.%sm%!^&set r%bn%.%bm%=!r%bn%.%bm%!^&set r%n%.%m%=!r%n%.%m%!^&set 原=%原%^&set/a m=%sm%,n=%sn%
- set r%sn%.%sm%=!原!&set r%bn%.%bm%=♀&set r%n%.%m%=%%1&set/a m=bm,n=bn&set 原=%%2
- goto :loop
- )
- set/a m=sm,n=sn
- )
- )
- goto :loop
-
- :me5
- if defined save (
- set r%n%.%m%=%原%
- set %save%
- set save=
- )
- goto :loop
-
- :me6
- endlocal&goto :restart
-
- :me7
-
- (
- echo;:#a
- echo;@goto :#b%%goto%%
- echo;%lev%@%yg%
- more +3 "%~nx0"
- )>"%~n0.tmp"
- set goto=_OK
- del "%~nx0"&ren "%~n0.tmp" "%~nx0"&goto :#a
- 修改批处理本身,需避免出错
-
- :#b_OK
- exit /b
-
- :me8
- set/a lev-=2
- :me9
- set/a lev+=1
- if !lev! equ !end! set lev=1
- if !lev! equ 0 set/a lev=end-1
- endlocal&(if %in% leq 4 for %%a in (!lev!) do set "yg= !lev!!yg: %%~a = !")&set lev=%lev%&goto :restart
-
- :me10
- endlocal&set yg=&set lev=1
- for /l %%a in (1,1,52) do set yg=!yg!
- goto :restart
-
- :囧a9a ab8a ab4d2fba ab2a2b4a ab2a4b2a aba2b5a ab4c2b2a ab8a ab8a a9a
- :囧a8g ab3ab2a abdbcdba a2ca2b2a ab2a2ca2 abdfb3a ab2ab3a a8
- :囧a9a4 abdb2db2dbdba5 ab9b6a5 abdabda2badb9a aba2b2a9a2b3a abcbcb9b6a abcb3cbcba7b3a ab3cb2a4g5a5 a4bcba g3abfba g3a5
- :囧ga4g5 gab2a a2dfa abdca6 abc2bcb2a2 abd2b4a2 a4b2a4 g3a4
- :囧g5a4g a6b2a abcb2cb2a abab2daba2 ab2dbadfba a2cabdcb2a gab3a5 ga5
- :囧g5a6g g5ab4a ga5ba2ba2 gabcb2cb2cba a2badada2dba abcb2cda2dba ab2d2bcfbca2 a8b2a g7a4
- :囧a9g2 ab7a ab2cbcbca a2baca2ba gabd2bd2a2 ga2d2bd2ba g2aba2caba2 g2acbcbcb2a g2ab6fa g2a9
- :囧a5g7 ab3a8 abfdbdbdbdba a2bababababa gabcbcbcbcba ga6b2a3 g6a4
- :囧g4a4g a5b2a abcb3ca ab2dadba a2ba3ba2 gabdadb2a gacbfbcba gab2a5 ga4
- :囧g2a8g a3b2fb3a ab3cbcb2a ab2cbcbcba a5ca5 g3a2bdbd2a g3ab2dab2a g3abdb3da g3a4b2a2 g6a4
- :囧a9g ab2fb4a ac7a ad3ad3a ad7a ac3bc3a ab7a a9
- :囧a9ag ab8a2 abcacacacfa adbdcd3cda adbdcd3cda abcacacaca2 ab8a a9a
- :囧a2 a9a ab2ab2ad2a afbcbcbdba ab3cb2cba abababadba a9a
- :囧g9g7a4g9g2 g5a5g3a4b2a a4gab3a6b4a9a ab2a3bab8ab9b2a abcd5ababcbabad2ab4c2aba ab2a2d3cb2abcabad2b2a2b3cba3 ab4ca2cabacbcbad2ab2a2cabcb2a abcacb3cb2abcb2ad2b3ab2cbcb2a a2b3a3cabad3a2d2ab2abcacb3a ga2ba2bab3ad2a3bdb3abcbcba3 a3bab2a9ab2ab2ab3a4 ab7a2b6ab2ab4a6 abcacacbab3cbcb2a9ab2a adcdb2cbab2cbcbcb8cb3ca ad3a2b2a5ca9b2dadba a4b3a6bdbd2ab3a2ba3ba2 g3ab2db2cbab2dab2adaca2bdadb2a g3a3d2bcbabdb3dab4acb3cba g3a3c2bcbaba2b2a2dacbab2a5 ga3bdcdbab3a6b3a2ba2 gab2cd3ca5g4adacab2a gab3a2dcbag6a2b5a2 ga6b3a囧@
- :囧g6abdaca3 g6a5g6ab4a g9g8afba3 g9g8a4
- :囧g9g7a4 g5a5g3a4b2a a4gab3a6b4a9a ab2a3bab8ab9b2a abcd5ababcbabad2ab4c2aba ab2a2d3cb2abcabad2b2a2b3cba3 ab4ca2cabacbcbad2ab2a2cabcb2a abcacb3cb2abcb2ad2b3ab2cbcb2a a2b3a3cabad3a2d2ab2abcacb3a ga2ba2bab3ad2a3bdb3abcbcba3 a3bab2a9ab2ab2ab3a4 ab7a2b6ab2ab4a6 abcacacbab3cbcb2a9ab2a adcdb2cbab2cbcbcb8cb3ca ad3a2b2a5ca9b2dadba a4b3a6bdbd2ab3a2ba3ba2 g3ab2db2cbab2dab2adaca2bdadb2a g3a3d2bcbabdb3dab4acb3cba g3a3c2bcbaba2b2a2dacbab2a5 ga3bdcdbab3a6b3a2ba2 gab2cd3ca5g4adacab2a gab3a2dcbag6a2b5a2 ga6b3ag6ab囧@
- :囧daca3 g6a5g6ab4a g9g8afba3 g9g8aba2g9g9g9g9g3a7 g9g8ab2ag9g9g9g9g3adbdbda g9g8ab2ag9g9g9g9g3ab5a g9g8ab2ag9g9g9g9g3adbdbda g9g8ab2ag9g9g9g9g3ab5a g9g8ab2ag9g9g9g9g3adb4a g9g8ab2ag9g9g9g9g3a4ba2 g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g9g9g6aba g9g8ab2ag9g9g2a7g9g6aba g9g8ab2ag9g9g2ab5ag9g6aba g9g8ab2ag9g9g2囧@
- :囧ab5ag9g6aba g9g8ab2ag9g9g2acbcbcag9g6aba g9g8ab2ag9g9g2ab5ag9g6aba g9g8ab2ag9g9g2acbcbcag9g6aba g9g8ab2a9a9a4b5a9a8ba g9g8ab4cb9b9b9b9b6a g9g8ab9b9b9b9b9b2a g9g8a9a9a9a9a9a4
复制代码
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |