整理代码,goto标签名字统一格式方便理解
This commit is contained in:
@@ -146,11 +146,11 @@ local function getScore(field,cb,cy)
|
||||
|
||||
for i=cy+#cb-1,cy,-1 do
|
||||
for j=1,10 do
|
||||
if field[i][j]==0 then goto continue end
|
||||
if field[i][j]==0 then goto CONTINUE_notFull end
|
||||
end
|
||||
discardRow(rem(field,i))
|
||||
clear=clear+1
|
||||
::continue::
|
||||
::CONTINUE_notFull::
|
||||
end
|
||||
if #field==0 then return 1e99 end--PC
|
||||
for x=1,10 do
|
||||
|
||||
@@ -100,11 +100,11 @@ function copyBoard(page)--Copy the [page] board
|
||||
for x=1,10 do
|
||||
if F[y][x]~=0 then
|
||||
H=y
|
||||
goto topFound
|
||||
goto BREAK_topFound
|
||||
end
|
||||
end
|
||||
end
|
||||
::topFound::
|
||||
::BREAK_topFound::
|
||||
|
||||
--Encode field
|
||||
for y=1,H do
|
||||
|
||||
@@ -28,7 +28,7 @@ function Player.createLockFX(P)
|
||||
local y=P.curY+i-1
|
||||
local L=P.clearedRow
|
||||
for j=1,#L do
|
||||
if L[j]==y then goto continue end
|
||||
if L[j]==y then goto CONTINUE_skip end
|
||||
end
|
||||
y=-30*y
|
||||
for j=1,#CB[1]do
|
||||
@@ -36,7 +36,7 @@ function Player.createLockFX(P)
|
||||
ins(P.lockFX,{30*(P.curX+j-2),y,0,t})
|
||||
end
|
||||
end
|
||||
::continue::
|
||||
::CONTINUE_skip::
|
||||
end
|
||||
end
|
||||
function Player.createDropFX(P,x,y,w,h)
|
||||
@@ -513,11 +513,11 @@ function Player.lock(P)
|
||||
for k=1,#dest,2 do
|
||||
if x==dest[k]+1 and y==dest[k+1]+1 then
|
||||
rem(dest,k)rem(dest,k)
|
||||
goto success
|
||||
goto BREAK_success
|
||||
end
|
||||
end
|
||||
dest=nil
|
||||
::success::
|
||||
::BREAK_success::
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -660,8 +660,8 @@ function Player.hold(P,ifpre)
|
||||
SFX.play("finesseError")
|
||||
do return end
|
||||
--<for-end>
|
||||
|
||||
::BREAK_success::
|
||||
|
||||
P.spinLast=false
|
||||
P.spinSeq=0
|
||||
local hb=P:getBlock(C.id)
|
||||
@@ -998,13 +998,13 @@ do--Player.drop(P)--Place piece
|
||||
--Row filled
|
||||
for x=1,10 do
|
||||
if P.field[h][x]<=0 then
|
||||
goto notFull
|
||||
goto CONTINUE_notFull
|
||||
end
|
||||
end
|
||||
cc=cc+1
|
||||
P.clearingRow[cc]=h-cc+1
|
||||
P.clearedRow[cc]=h
|
||||
::notFull::
|
||||
cc=cc+1
|
||||
P.clearingRow[cc]=h-cc+1
|
||||
P.clearedRow[cc]=h
|
||||
::CONTINUE_notFull::
|
||||
end
|
||||
|
||||
--Create clearing FX
|
||||
@@ -1062,11 +1062,11 @@ do--Player.drop(P)--Place piece
|
||||
for testY=CY+y,#P.field do
|
||||
if P:solid(testX,testY)then
|
||||
finesse=true
|
||||
goto BERAK
|
||||
goto BERAK_roofFound
|
||||
end
|
||||
end
|
||||
end
|
||||
::BERAK::
|
||||
::BERAK_roofFound::
|
||||
end
|
||||
|
||||
--Remove rows need to be cleared
|
||||
|
||||
@@ -40,11 +40,11 @@ local function checkBoard(b,p)
|
||||
for i=1,8 do
|
||||
for j=1,3 do
|
||||
if b[lines[i][j]]~=p then
|
||||
goto nextLine
|
||||
goto CONTINUE_testNextLine
|
||||
end
|
||||
end
|
||||
do return true end
|
||||
::nextLine::
|
||||
::CONTINUE_testNextLine::
|
||||
end
|
||||
end
|
||||
local function full(L)
|
||||
|
||||
@@ -71,21 +71,21 @@ function scene.keyDown(key)
|
||||
elseif key=="v"and kb.isDown("lctrl","rctrl")or key=="cV"then
|
||||
local str=sys.getClipboardText()
|
||||
local args=SPLITSTR(str:sub((str:find(":")or 0)+1),"!")
|
||||
if #args<4 then goto fail end
|
||||
if #args<4 then goto THROW_fail end
|
||||
if not(
|
||||
pasteQuestArgs(args[1])and
|
||||
pasteSequence(args[2])and
|
||||
pasteMission(args[3])
|
||||
)then goto fail end
|
||||
)then goto THROW_fail end
|
||||
repeat table.remove(FIELD)until #FIELD==0
|
||||
FIELD[1]=newBoard()
|
||||
for i=4,#args do
|
||||
if not pasteBoard(args[i],i-3)and i<#args then goto fail end
|
||||
if not pasteBoard(args[i],i-3)and i<#args then goto THROW_fail end
|
||||
end
|
||||
freshMiniFieldVisible()
|
||||
LOG.print(text.importSuccess,COLOR.green)
|
||||
do return end
|
||||
::fail::LOG.print(text.dataCorrupted,COLOR.red)
|
||||
::THROW_fail::LOG.print(text.dataCorrupted,COLOR.red)
|
||||
elseif key=="escape"then
|
||||
SCN.back()
|
||||
else
|
||||
|
||||
@@ -211,12 +211,12 @@ function scene.keyDown(key)
|
||||
local F=FIELD[page]
|
||||
for i=20,1,-1 do
|
||||
for j=1,10 do
|
||||
if F[i][j]<=0 then goto nextLine end
|
||||
if F[i][j]<=0 then goto CONTINUE_notFull end
|
||||
end
|
||||
SYSFX.newShade(3,200,660-30*i,300,30)
|
||||
SYSFX.newRectRipple(3,200,660-30*i,300,30)
|
||||
rem(F,i)
|
||||
::nextLine::
|
||||
::CONTINUE_notFull::
|
||||
end
|
||||
if #F~=20 then
|
||||
repeat
|
||||
|
||||
@@ -80,12 +80,12 @@ function scene.touchMove()
|
||||
if B.ava then
|
||||
for i=1,#L,2 do
|
||||
if(L[i]-B.x)^2+(L[i+1]-B.y)^2<=B.r^2 then
|
||||
goto continue
|
||||
goto CONTINUE_nextKey
|
||||
end
|
||||
end
|
||||
PLAYERS[1]:releaseKey(n)
|
||||
end
|
||||
::continue::
|
||||
::CONTINUE_nextKey::
|
||||
end
|
||||
end
|
||||
function scene.keyDown(key)
|
||||
|
||||
@@ -61,12 +61,12 @@ function scene.touchMove()
|
||||
if B.ava then
|
||||
for i=1,#L,2 do
|
||||
if(L[i]-B.x)^2+(L[i+1]-B.y)^2<=B.r^2 then
|
||||
goto continue
|
||||
goto CONTINUE_nextKey
|
||||
end
|
||||
end
|
||||
PLAYERS[1]:releaseKey(n)
|
||||
end
|
||||
::continue::
|
||||
::CONTINUE_nextKey::
|
||||
end
|
||||
end
|
||||
function scene.keyDown(key)
|
||||
|
||||
Reference in New Issue
Block a user