25 lines
510 B
Lua
25 lines
510 B
Lua
-- Advent of Code 2025 - Day 10 - Bas Grolleman
|
|
require("functions")
|
|
local filename = "Day10/test"
|
|
print("Day 10")
|
|
|
|
local input = {}
|
|
for line in io.lines(filename) do
|
|
local switches = string.match(line, "%[([#.]+)%]")
|
|
local buttons = {}
|
|
for b in string.gmatch(line, "%(([%d,]+)%)") do
|
|
local sw = {}
|
|
for j in string.gmatch(b, "%d+") do
|
|
table.insert(sw, tonumber(j))
|
|
end
|
|
table.insert(buttons, sw)
|
|
end
|
|
|
|
table.insert(input, {
|
|
switches = switches,
|
|
buttons = buttons,
|
|
})
|
|
end
|
|
|
|
print_table(input)
|