get rid of capitals
This commit is contained in:
parent
1f013dc0c3
commit
3db67bd012
6 changed files with 0 additions and 0 deletions
10
day01/part1.lua
Normal file
10
day01/part1.lua
Normal 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
10
day01/part2.lua
Normal 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)
|
Loading…
Add table
Add a link
Reference in a new issue