Fixed bug in consecutive count

This commit is contained in:
Simon Cambier 2022-07-01 20:20:57 +02:00
parent 0276d70de3
commit 529703b7e4
3 changed files with 12 additions and 8 deletions

View File

@ -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,
--

View File

@ -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

View File

@ -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