diff --git a/lua/src/lib/utils.lua b/lua/src/lib/utils.lua index 13896510..259e9c66 100644 --- a/lua/src/lib/utils.lua +++ b/lua/src/lib/utils.lua @@ -23,7 +23,7 @@ local function get_answer(id) local type_ = row[2] local length = tonumber(row[3]) local value = row[4] - + if type_ == 'str' then return value elseif type_ == 'int' then diff --git a/lua/test.lua b/lua/test.lua index a1a2cd8d..5d799953 100644 --- a/lua/test.lua +++ b/lua/test.lua @@ -74,21 +74,16 @@ end local get_answer = loadlib("utils").get_answer -- Problems configuration: filename -> {expected_answer, is_slow} -local problems = { - ["p0001.lua"] = {get_answer(1), false}, - ["p0002.lua"] = {get_answer(2), false}, - ["p0003.lua"] = {get_answer(3), false}, - ["p0004.lua"] = {get_answer(4), false}, - ["p0005.lua"] = {get_answer(5), false}, - ["p0006.lua"] = {get_answer(6), false}, - ["p0007.lua"] = {get_answer(7), false}, - ["p0008.lua"] = {get_answer(8), false}, - ["p0009.lua"] = {get_answer(9), false}, - ["p0010.lua"] = {get_answer(10), false}, - ["p0011.lua"] = {get_answer(11), false}, - ["p0013.lua"] = {get_answer(13), false}, - ["p0014.lua"] = {get_answer(14), false}, - ["p0015.lua"] = {get_answer(15), false}, +local problems = {} + +for i = 1, 11 do + problems[string.format("p%04d.lua", i)] = {get_answer(i), false} +end +for i = 13, 15 do + problems[string.format("p%04d.lua", i)] = {get_answer(i), false} +end + +local more_problems = { ["p0017.lua"] = {get_answer(17), false}, ["p0028.lua"] = {get_answer(28), false}, ["p0034.lua"] = {get_answer(34), false}, @@ -96,6 +91,10 @@ local problems = { ["p0836.lua"] = {get_answer(836), false}, } +for _, v in ipairs(more_problems) do + table.insert(problems, v) +end + -- Fast testing loop for file_name, config in pairs(problems) do if not config[2] then