行的垃圾行标签键从[11]改为garbage
This commit is contained in:
@@ -1,37 +1,37 @@
|
||||
local FREEROW={}
|
||||
local L={}--Storage
|
||||
local _=0--Length
|
||||
local len=0--Length
|
||||
function FREEROW.reset(num)
|
||||
if num<_ then
|
||||
for i=_,num+1,-1 do
|
||||
if num<len then
|
||||
for i=len,num+1,-1 do
|
||||
L[i]=nil
|
||||
end
|
||||
elseif num>_ then
|
||||
for i=_+1,num do
|
||||
elseif num>len then
|
||||
for i=len+1,num do
|
||||
L[i]={0,0,0,0,0,0,0,0,0,0}
|
||||
end
|
||||
end
|
||||
_=num
|
||||
len=num
|
||||
end
|
||||
function FREEROW.get(val,type)--type: nil=norm, true=garbage
|
||||
if _==0 then
|
||||
function FREEROW.get(val,ifGarbage)
|
||||
if len==0 then
|
||||
for i=1,10 do
|
||||
L[i]={0,0,0,0,0,0,0,0,0,0}
|
||||
end
|
||||
_=_+10
|
||||
len=len+10
|
||||
end
|
||||
local t=L[_]
|
||||
local t=L[len]
|
||||
for i=1,10 do t[i]=val end
|
||||
t[11]=type
|
||||
L[_]=nil
|
||||
_=_-1
|
||||
t.garbage=ifGarbage==true
|
||||
L[len]=nil
|
||||
len=len-1
|
||||
return t
|
||||
end
|
||||
function FREEROW.discard(t)
|
||||
_=_+1
|
||||
L[_]=t
|
||||
len=len+1
|
||||
L[len]=t
|
||||
end
|
||||
function FREEROW.getCount()
|
||||
return _
|
||||
return len
|
||||
end
|
||||
return FREEROW
|
||||
@@ -46,7 +46,7 @@ local function check_LVup(P)
|
||||
end
|
||||
P.field[i][P:RND(10)]=0
|
||||
end
|
||||
P.field[i][11]=true
|
||||
P.field[i].garbage=true
|
||||
end
|
||||
P.garbageBeneath=10
|
||||
for i=1,10 do
|
||||
|
||||
@@ -988,7 +988,7 @@ do--Player.drop(P)--Place piece
|
||||
if cc>0 then
|
||||
for i=cc,1,-1 do
|
||||
_=P.clearedRow[i]
|
||||
if P.field[_][11]then
|
||||
if P.field[_].garbage then
|
||||
P.garbageBeneath=P.garbageBeneath-1
|
||||
gbcc=gbcc+1
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user