Fixed bug in consecutive count
This commit is contained in:
parent
0276d70de3
commit
529703b7e4
12
board.lua
12
board.lua
|
@ -144,17 +144,19 @@ function Board.new()
|
|||
end,
|
||||
|
||||
count_consecutives = function(self, line)
|
||||
local count = 0
|
||||
local top = 0
|
||||
local current = 0
|
||||
local last = 0
|
||||
for v in all(line) do
|
||||
if v ~= last then
|
||||
last = 0
|
||||
else
|
||||
top = max(current, top)
|
||||
current = 1
|
||||
last = v
|
||||
count += 1
|
||||
else
|
||||
current += 1
|
||||
end
|
||||
end
|
||||
return count
|
||||
return top
|
||||
end,
|
||||
|
||||
--
|
||||
|
|
4
main.lua
4
main.lua
|
@ -101,9 +101,9 @@ function _init()
|
|||
printh(" ")
|
||||
printh("*************")
|
||||
printh(" ")
|
||||
local date = stat(80)..stat(81)..stat(82)..stat(85)
|
||||
local date = stat(80)..stat(81)..stat(82)
|
||||
-- srand(date)
|
||||
srand(20227149)
|
||||
-- srand(20227149)
|
||||
printh(date)
|
||||
mouse_x = 0
|
||||
mouse_y = 0
|
||||
|
|
|
@ -14,6 +14,8 @@ function state_loading()
|
|||
"sCAFFOLDING RAY-TRACING ALGORITHM",
|
||||
"sWEEPING PARTICLES",
|
||||
"pRESSURIZING USER INTERFACE",
|
||||
"sHAKING RED AND BLUE PAINT BUCKETS",
|
||||
"gATHERING GRAVITY",
|
||||
"sERIALIZING BOARD MATRIX",
|
||||
"bACKPORTING e2e ENCRYPTION",
|
||||
}
|
||||
|
@ -102,7 +104,7 @@ function state_loading()
|
|||
local function _update()
|
||||
board:lock_tiles()
|
||||
|
||||
messages_x -= 5
|
||||
messages_x -= 4
|
||||
if loaded then
|
||||
set_state(states.game, board)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user