This is a thread to discuss Day1
https://adventofcode.com/2021/day/1
REMEMBER!
It is VERY important NOT to write any public spoilers
ALWAYS keep spoiler stuff hidden inside one of these
Summary
This text will be hidden
which you can obtain by clicking on the gear icon
Good luck
BTW on of the features of AdventOfCode is that we all get given different inputs so our answers will be different.
The examples are all the same but each of us gets different inputs for us to solve
This is my first successful run at part 1
Part 1
duration = 20ms
It is very much NOT the Snap! way do do it but it works
Hopefully, we'll see some much better solutions
You'll notice that I set the result to be a list. I do this, so I can easily copy and paste it into the AdventOfCode website
First successful run at part 2
part 2
Duration = 900 ms
Project
HOF are very impressives ! 40ms VS 1400ms with a loop
Part 1
(1050ms with a warp)
(60ms)
Part 2
(3200ms with a warp)
(142ms)
i like all the solutions from everybody!
Can you edit your post to say me how much time it take to execute your code, i'm curious ! (with the big input)
project
I like your method of getting the averages.
I'd forgotten that in Snap! we don't have worry about asking for an item outside of the range of the list.
These look great - completely above my head though
And you've used recursion on day1 - Brian will like that
Can you share the link to your project plz
Just finished part 1
Part 1 Solution
Uses Recursion in a variable function so no messy inputs in block
Done part 2
Part 2 Solution
Unfortunately kinda slow
project here:Snap! 7 - dev - Build Your Own Blocks