It's December again, which means Advent of Code starts again. Advent of Code is "an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.". My teacher thought it would be nice if me and my classmates would solve problems as well, providing it has to be done in C++ (we are even getting points for solving them!). I'm curious whether other Cemetech members are trying these puzzles as well!

Here are my solutions located: https://github.com/PeterTillema/AoE2018
I'll probably not bother when they get more difficult, but at least this first one is easy enough that it's a fun bite-size exercise.
Code:
```#!/usr/bin/env python3 import sys from collections import defaultdict from itertools import cycle a = 0 n = 0 hits = defaultdict(int, {0: 1}) for x in cycle(map(int, sys.stdin)):     n += 1     a += x     hits[a] += 1     if hits[a] == 2:         print('Found', a, 'twice at index', n)         break```
Day 2 was even easier than Day 1:

Code:
```#!/usr/bin/env python3 import sys from collections import Counter a = 0 b = 0 for l in sys.stdin:     a += (2 in Counter(l).values())     b += (3 in Counter(l).values()) print(a * b)```
I'm solving each problem with Jelly for some reason, with the input file supplied on stdin. Solutions are timed with pypy.

Day 1 Part 1 (7 bytes, .4s):
Code:
`ƈLÐ¿ỴVS`

Day 1 Part 2 (18 bytes, 8m18s):

Code:
`ƈLÐ¿ỴV©ṪLṙɼṛ/+ƲÐḶṾ`

Code:
`ƈLÐ¿ỴĠẈ2,3e€Ʋ€SP`

Code:
`ƈƈ¹Ð¿ỴṖŒcZEƇḢ€Ɗ€LÐṀ`

Day 3 Part 1 (55 bytes, 5m15s):

Code:
`‘⁹Ñ¤¦¶5ñ⁸p6ñ⁸¤ḅȷ¶+3ị⁹Ḷ+ị¶ẋȷ²¤¶ƈƈ¹Ð¿ỴṖ¹⁶eØD\$?€Ḳ\$€Vñƒ¢>1S`

Day 3 Part 2 (46 bytes, [broken?]):

Code:
`Ḋs2Ɗ€ZẎ€ṙ2<ɗ/Ạ¶ƈƈ¹Ð¿ỴṖ¹⁶eØD\$?€Ḳ¹ƇVƲ€ŒcÇÐḟẎḢ€Æṃ`

Code:
`15ịñÞ@WŻ60¡ṭɗñƇ@?¶0ị=¶6ịr⁹Ḣ¤‘ṛ¦@⁹Ṫ¤ṭ¶6ị‘;¶ƈƈ¹Ð¿ỴṖṢ¹⁶eØD\$?€Ḳ\$€VL_20ṠƊŀ@ƒ⁸ṖS\$ÐṀḢµṪ×M’\$`

Code:
`15ịñÞ@WŻ60¡ṭɗñƇ@?¶0ị=¶6ịr⁹Ḣ¤‘ṛ¦@⁹Ṫ¤ṭ¶6ị‘;¶ƈƈ¹Ð¿ỴṖṢ¹⁶eØD\$?€Ḳ\$€VL_20ṠƊŀ@ƒ⁸ṖṀ\$ÐṀḢµṪ×M’\$`

Day 5 Part 1 (11 bytes, 21s):

Code:
`ɠṖ;ŒsṪ=ɗ?/L`

Day 5 Part 2 (21 bytes, ∞d):

Code:
`ɠ,`Œtḟ@Ṗ;ŒsṪ=ɗ?/ʋ€`ẈṂ`

Day 5 Part 2 (22 bytes, 19m30s):

Code:
`ɠQ,`Œtḟ@Ṗ;ŒsṪ=ɗ?/ʋ€¹ẈṂ`

Code:
`ṖZḟ/Ṃ©ṭṪṭn®Ḣ\$Ƈ¶ƈƈ¹Ð¿Ỵf€ØAḊ€µZḟ@/ḢṭÇL’\$¿`

Code:
```«/r»/ ƈƈ¹Ð¿ỴṖḲe”-ṭØD¤\$Ƈ€¹ƇƊ€VUŒH€+\€,ÑṪẈƊ€⁼Ṣ\$ɗ¿`_@/€µÇ,þ/e€€ị“# ”ZY```

Code:
`ƈƈ¹Ð¿ỴṖḲe”-ṭØD¤\$Ƈ€¹ƇƊ€VUŒH€+\€,«/r»/ƊṪẈƊ€⁼Ṣ\$ɗÐ¿`L_2`

Code:
```+⁵µ×⁹+³×µṚ3ị 300ñþ`S3Ƥ€S3ƤŒMḢUṾ```

Day 11 Part 2 (38 bytes, 5m15):

Code:
```+⁵µ×⁹+³×µṚ3ị_5 S⁹Ƥ€S⁹Ƥ 300µñþ`çⱮµŒMḢUṾ```

Code:
`ɠḲṪ,ƈƈ¹Ð¿ỴḊṖṢṪ€¤=”#UŻ\$8¡ḄNịɗ5Ƥ⁹,ʋ/20¡ḢT_41S`

Day 12 Part 2 (47 bytes, ∞y):

Code:
`ɠḲṪ,ƈƈ¹Ð¿ỴḊṖṢṪ€¤=”#UŻ\$8¡ḄNịɗ5Ƥ⁹,ʋ/5ȷ10¡ḢT_ȷ11’S`

Code:
```UŻ\$8¡ḄNịɗ5Ƥ⁹Ñt0, i1_3x2-ṭḊŻ+ɗɼṛ ®5ȷ10 1¦S ɠḲṪ,ƈƈ¹Ð¿ỴḊṖṢṪ€¤=”#ñ/ÐLḢT+¢’S```

Code:
`ɠḲṪ,ƈƈ¹Ð¿ỴḊṖṢṪ€¤=”#UŻ\$8¡ḄNịɗ5Ƥ⁹,ʋ/¡ḢT_³Ḥ¤’S`
So, apparently the contest is over, and I'm happy to say that I finished all the challenges! A few were incredible hard and I have to admit that https://reddit.com/r/adventofcode was my favourite place to be this month I took a few ideas from Reddit and implemented, and once copied some C++ code and modified it a bit (because part b was too hard). Many puzzles were fun! I really enjoyed the Mine Cart challenge (13), and the Beverage Bandits (15) was nice as well. You can take a look at my solutions here, but please don't laugh at my horrible code

All the challenges started at 6AM for me, so I didn't get on the leaderboard, but it was still fun solving these puzzles!
It's AoC 2020 time!

Moved my Jelly solutions to Jelly 2020.
jacobly wrote:
It's AoC 2020 time!

I'm in! Anyone want to join the Cemetech private leaderboard? Join with code 387241-7e26eb8c
I've been doing this year's in Rust, and recently got around to making a repo for it: https://github.com/commandblockguy/aoc2020
It's that time of the year again (although I probably should have said something prior to the first day, whoops). You can still join the leaderboard with the code above, if you want to participate.

This year, I'm doing it in Python, and trying for speed. I've made a project template + helper module that uses advent-of-code-data to automatically download my input file and submit the result of my code. It also checks my solution function against the example problem, and runs it on the actual input file only if it succeeds. In the future I may also try to get it to automatically scrape the example problem and expected solution from the webpage.
_appears from the internet grave as is tradition at this point_ we've been doing it in z80 assembly this year because its been ages since we've actually written any z80. feels good to be writing it again, and felt like a reasonable reason to poke in and say hi here again

repo for the year is at https://github.com/faithanalog/adventofcode2021

we're kinda "cheating" by not including the raw input data to parse on the calculator, just using some vim macros to modify it into something that's basically the same data but takes up less memory. because otherwise we'd have to like compress the data and then decompress it at launch so it'd fit in a ti83 program and thats just a pain

Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

»
» All times are UTC - 5 Hours

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum