get rid of capitals

This commit is contained in:
Felix Van der Jeugt 2021-12-03 08:04:04 +01:00
parent 1f013dc0c3
commit 3db67bd012
No known key found for this signature in database
GPG key ID: 58B209295023754D
6 changed files with 0 additions and 0 deletions

10
day01/part1.lua Normal file
View file

@ -0,0 +1,10 @@
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)

10
day01/part2.lua Normal file
View file

@ -0,0 +1,10 @@
local count = 0
local a, b, c
for line in io.lines(arg[3]) do
d = tonumber(line)
if a ~= nil and a + b + c < b + c + d then
count = count + 1
end
a, b, c = b, c, d
end
print(count)