修之前删goto的时候导致hisPool算法爆炸(也不知道怎么爆的,不管了)
This commit is contained in:
@@ -120,20 +120,17 @@ local seqGenerators={
|
|||||||
-- Pick a mino from pool
|
-- Pick a mino from pool
|
||||||
local tryTime=0
|
local tryTime=0
|
||||||
local r
|
local r
|
||||||
repeat-- ::REPEAT_pickAgain::
|
repeat
|
||||||
local pickAgain
|
|
||||||
r=_poolPick()-- Random mino-index in pool
|
r=_poolPick()-- Random mino-index in pool
|
||||||
|
local duplicated
|
||||||
for i=1,len do
|
for i=1,len do
|
||||||
if r==history[i] then
|
if r==history[i] then
|
||||||
tryTime=tryTime+1
|
duplicated=true
|
||||||
if tryTime<hisLen then
|
break
|
||||||
pickAgain=true
|
|
||||||
break-- goto REPEAT_pickAgain
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if not pickAgain then break end
|
tryTime=tryTime+1
|
||||||
until true
|
until not duplicated or tryTime>hisLen
|
||||||
|
|
||||||
-- Give mino to player & update history
|
-- Give mino to player & update history
|
||||||
if history[1]~=0 then
|
if history[1]~=0 then
|
||||||
|
|||||||
Reference in New Issue
Block a user