https://adventofcode.com
This is a thread to discuss Day 1 (which started on 1st December at 05:00 UTC ) ![:slight_smile: :slight_smile:](https://forum.snap.berkeley.edu/images/emoji/apple/slight_smile.png?v=12)
https://adventofcode.com/2023/day/1
REMEMBER!
It is VERY important NOT to write any public spoilers ![:slight_smile: :slight_smile:](https://forum.snap.berkeley.edu/images/emoji/apple/slight_smile.png?v=12)
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
![image](https://cdn.forum.snap.berkeley.edu/original/2X/8/83dd1d2da37c061226dad8b305769df5a7be3093.png)
Good luck ![:slight_smile: :slight_smile:](https://forum.snap.berkeley.edu/images/emoji/apple/slight_smile.png?v=12)
FYI one of the features of Advent of Code 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
I manged to do the 1st part in 10 minutes - a new record for me ![:slight_smile: :slight_smile:](https://forum.snap.berkeley.edu/images/emoji/apple/slight_smile.png?v=12)
Part 1
![image](https://cdn.forum.snap.berkeley.edu/original/3X/9/7/97a0f13c86505bf6c2e482ee6d980405748299a4.png)
But this years Day 1 part 2 is going to take quite a big longer!
[edit] 10:00UTC I manged to get the right result from the test data but I've not got the right result using my data! This is worst thing to happen and it's going to take quite a big of debugging to see why there is this discrepancy ![:frowning: :frowning:](https://forum.snap.berkeley.edu/images/emoji/apple/frowning.png?v=12)
[edit] 11:18 UTC - found my error - just need to come up with solution ![:slight_smile: :slight_smile:](https://forum.snap.berkeley.edu/images/emoji/apple/slight_smile.png?v=12)
Finally managed it ![:slight_smile: :slight_smile:](https://forum.snap.berkeley.edu/images/emoji/apple/slight_smile.png?v=12)
I might just stick to part 1s this year ![:slight_smile: :slight_smile:](https://forum.snap.berkeley.edu/images/emoji/apple/slight_smile.png?v=12)
Part 2
https://snap.berkeley.edu/snap/snap.html#present:Username=cymplecy&ProjectName=aoc23Day1
Part 1 was very easy, but part 2 really made me think. I mean, I was able to get the correct answer for the example, but not for my actual input. I had to spend a while trying to figure out how to debug it.
Part 1
Part 2
Project (although you can just drag and drop the script images into snap, and then just set the "input" variable.)
Snap! Build Your Own Blocks
If anyone wants to, you can join the snap leaderboard just go here, then enter 1492847-2e9c76cd
.
this is my first time doing aoc, got part 1 in 5-10 minutes
part 1
![untitled script pic (36)](https://cdn.forum.snap.berkeley.edu/original/3X/c/3/c345a736b837869365f8d9db38cb9ffa565e893e.png)
i made part 2, but its really slow and i dont wanna wait for it to finish so i guess no star for me
Part 2
Your part 2 looks much more elegant than mine ![:slight_smile: :slight_smile:](https://forum.snap.berkeley.edu/images/emoji/apple/slight_smile.png?v=12)
The best part is, it was mostly made on an ipad.
Part 1 ... working on Part 2.
Part 1
![untitled script pic - 2023-12-01T132430.092](https://cdn.forum.snap.berkeley.edu/original/3X/4/3/4374817f6a249f78e337116931b903c3f56dfe4a.png)
Its a bit tricky - certainly the hardest Day 1 part 2 ever!
I thought I could
![Advent of Code 2023 script pic](https://cdn.forum.snap.berkeley.edu/original/3X/7/3/737c93db3e873d74659b201fd2ef12149622b7b7.png)
but I keep getting the wrong answer. Hmmm...
We all did when we first ran it on real data ![:frowning: :frowning:](https://forum.snap.berkeley.edu/images/emoji/apple/frowning.png?v=12)
In other news - I saw someone toot something and I've adapted it to Snap! and now included it in my project above
The person was very clever to come up with it ![:slight_smile: :slight_smile:](https://forum.snap.berkeley.edu/images/emoji/apple/slight_smile.png?v=12)
I just looked at it, and it is very clever. I wish I thought of that.
for part 2, i had to devlop this block (return a list of found positions)
new block
![advent of code-2023-day01 script pic](https://cdn.forum.snap.berkeley.edu/original/3X/d/f/df03e2359ddff284ebc30a00e0e64eefd37be984.png)
![advent of code-2023-day01 script pic (1)](https://cdn.forum.snap.berkeley.edu/original/3X/9/e/9e1664e73f8139ee661f9c9a25c060def70872a4.png)
I think this block could be more elegant if it used recursion but I can't figure out how to do that in this specific case
project
project
Yep, I've made one of those and I noticed @ego-lay_atman-bay had as well
That's escalated quickly !
I was originally using the position of block in the strings multiline input library, but then I ran into an issue where there were repeated numbers, so I had to make a positions of block (and I really like how clever I made it).