adventofcode-2021/Day01/Part1.lua
Felix Van der Jeugt 9a85919a6f
day 1
2021-12-01 08:03:56 +01:00

11 lines
200 B
Lua

local count = 0
local previous
for number in io.lines(arg[3]) do
number = tonumber(number)
if previous ~= nil and previous < number then
count = count + 1
end
previous = number
end
print(count)