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)
|
||||
0
2025/Day10/full
Normal file
0
2025/Day10/full
Normal file
3
2025/Day10/test
Normal file
3
2025/Day10/test
Normal file
@@ -0,0 +1,3 @@
|
||||
[.##.] (3) (1,3) (2) (2,3) (0,2) (0,1) {3,5,4,7}
|
||||
[...#.] (0,2,3,4) (2,3) (0,4) (0,1,2) (1,2,3,4) {7,5,12,7,2}
|
||||
[.###.#] (0,1,2,3,4) (0,3,4) (0,1,2,4,5) (1,2) {10,11,11,5,10,5}
|
||||
Reference in New Issue
Block a user