修复小程序2048之前在删goto时造成的逻辑错误

This commit is contained in:
MrZ626
2021-04-13 00:26:02 +08:00
parent ca68a8ef87
commit 832c09980a

View File

@@ -128,16 +128,16 @@ local function squash(L)
local moved=false
while true do
p2=p1+1
while not L[p2]do
while not L[p2]and p2<5 do
p2=p2+1
end
if p2==5 then
p1=p1+1
if p1==4 then
return L[1],L[2],L[3],L[4],moved
else
p1=p1+1
end
break
end
end
else
if not L[p1]then--air←2
L[p1],L[p2]=L[p2],false
moved=true
@@ -157,6 +157,7 @@ local function squash(L)
p1=p1+1
end
end
end
end
local function reset()
for i=1,16 do board[i]=false end