日期:2014-05-17 浏览次数:20699 次
@echo off&rem 俄罗斯方块游戏,由netbenton编写,在bathome首发,完成时间:2009年9月25日 ver 2.0
if "%1" equ "para2" goto :para2
set "d-v=for %%a in (!str!) do set/a one=0x%%a,x=one/4+n,y=one%%4+m&(for %%b in ("r!x!.!y!") do if "!%%~b!" equ " " (set r!x!.!y!=■) else (set err=1))"
::函数d-v,把str中的图标数据,放置到总坐标空间中,如果有覆盖,则err=1。调用方法:(%d-v%)
::变量使用:one x y
set "d-e=set aec=!cr!!cr! ┌───────────┐!cr!&(for /l %%a in (2,1,#) do for %%b in ("│!ebuf:@=%%a!│ !ebu%%a!") do set aec=!aec! %%~b!cr!)&cls&echo;!aec! └───────────┘"
::函数d-e,把总坐标空间显示出来,调用方法:(%d-e:#=行数%)
set ebu4=第!guan!关
set ebu6=总分:!fen!
set cr=^
::各种图标定义
set ga1=0 1 5 6
set ga2=1 4 5 8
::■■
:: ■■
set gb1=1 2 4 5
set gb2=0 4 5 9
:: ■■
::■■
set za1=4 5 6 7
set za2=1 5 9 d
::■■■■
set qa1=1 5 9 8
set qa2=0 4 5 6
set qa3=0 1 4 8
set qa4=0 1 2 6
::■■
:: ■
:: ■
set qb1=0 4 8 9
set qb2=0 1 2 4
set qb3=0 1 5 9
set qb4=2 4 5 6
::■■
::■
::■
set ta1=0 1 4 5
::■■
::■■
set sa1=0 1 2 5
set sa2=1 4 5 9
set sa3=1 4 5 6
set sa4=0 4 5 8
:: ■
::■■■
set tw1=0 1
set tw2=0 4
set on1=0
set on2=0
set sh1=1 4 5 6 9
set sh2=1 4 5 6 9
set ao1=0 1 2 4 6
set ao2=0 1 4 8 9
set ao3=0 4 5 6 2
set ao4=0 1 5 8 9
set tt1=0 1 2 5 9
set tt2=0 4 8 5 6
set tt3=1 5 8 9 a
set tt4=2 4 5 6 a
::cdef
::89ab
::4567
::0123
echo 0 2 >%~n0.tmp
start "aswd" %0 para2
::起动控制窗口
set k3=k%%=mx,k+
set k4=down
set k1=m-
set k2=m+
set k5=t+
::按键定义
setlocal enabledelayedexpansion
for /l %%a in (0,1,10) do (set "ebuf=!ebuf!^!r@.%%a^!")
for %%a in (sa_4 ta_1 qb_4 qa_4 za_2 ga_2 gb_2 tw_2 on_2 sh_2 ao_4 tt_4) do (
for /f "tokens=1,2 delims=_" %%b in ("%%a") do (
set _%%b=%%c
for /l %%d in (1,1,%%c) do set/a nx+=1&set ran!nx!=%%b%%d
)
)
::定义各种图型的可变型数,及单个图的随机号
:restart
for /l %%a in (0,1,18) do (for /l %%b in (0,1,10) do set r%%a.