Getting issues
This commit is contained in:
+9
-5
@@ -5,11 +5,15 @@ function state_game()
|
||||
local timer_clue = 0
|
||||
|
||||
local function show_clues()
|
||||
-- local result = board:is_valid()
|
||||
-- if result ~= true and result ~= false then
|
||||
-- local rule,what,where = unpack(result)
|
||||
-- --printh("Rule: " .. rule .. " " .. what .. " " .. where[1].. " " .. where[2])
|
||||
-- end
|
||||
local issues = board:get_issues(true)
|
||||
for issue in all(issues) do
|
||||
local type, err, row, pos, other = unpack(issue)
|
||||
if err == "identical" and count(row,0)>0 then
|
||||
goto continue
|
||||
end
|
||||
printh(type .. " " .. err .. " " .. pos)
|
||||
::continue::
|
||||
end
|
||||
end
|
||||
|
||||
local function draw_selected_tile()
|
||||
|
||||
+2
-3
@@ -27,6 +27,7 @@ function state_loading()
|
||||
local removing_tile = 0
|
||||
|
||||
local create_board = cocreate(function()
|
||||
local start = time()
|
||||
repeat
|
||||
board:reset()
|
||||
repeat
|
||||
@@ -35,8 +36,6 @@ function state_loading()
|
||||
until board:is_complete()
|
||||
until board:is_valid()
|
||||
|
||||
printh("b: " .. time())
|
||||
|
||||
-- Remove tiles that can be removed
|
||||
local previous = {board:get_tiles_copy()} -- initial state
|
||||
local size = board:get_size()*board:get_size()
|
||||
@@ -64,7 +63,7 @@ function state_loading()
|
||||
deli(previous)
|
||||
end
|
||||
end -- end while
|
||||
printh("c: " .. time())
|
||||
printh("board generated in "..time()-start.." seconds")
|
||||
|
||||
board:set_tiles(previous[#previous])
|
||||
printh(board:tostring())
|
||||
|
||||
Reference in New Issue
Block a user