Something went wrong. Try again.
Code for the Advent of Code event
aoc advent-of-code
Something went wrong. Try again.
282 B · 18 lines
Lua
at main
12345678910111213141516171819local input = io.open("input.txt", "r")
local floor = 0
local char
repeat char = input:read(1) if char == "(" then floor = floor + 1 elseif char == ")" then floor = floor - 1 enduntil not char
print("Santa is on floor " .. floor)
input:close()