Forgot to commit the last few days
This commit is contained in:
24
2025/Day10/Day10.lua
Normal file
24
2025/Day10/Day10.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
-- 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)
|
||||
Reference in New Issue
Block a user