Hooray! A reason to make cool gifs^TM.
Day 8 - The Problem
In order to finish booting a Elvish Mars Rover, they sent us a picture of the password. Credit where credit is due, the elves managed to at least encrypt the image file, so they have some security sensibility at least. Unfortunately, we have to build our own decryptor.
Humblebrag: I was out partying all day (playing board games!), and I want people to have a place to post. I'll update with a snappy summary when I finish the problem (probably tomorrow).
Part 1 was a simple counting problem. The main hurdle seemed to be correctly chunking the input data into the proper layers.
Part 2 also seemed strangely straightforward compared to Day 07, but maybe the list comprehension sugar of my chosen language simplified more than I realized.
Phew! I'm catching back up to where I wanted to be faster than I expected.
Ongoing Meta
Dev.to List of Leaderboards
-
120635-5c140b9a
- provided by Linda Thompson
If you were part of Ryan Palo's leaderboard last year, you're still a member of that!
If you want me to add your leaderboard code to this page, reply to one of these posts and/or send me a DM containing your code and any theming or notes you’d like me to add. (You can find your private leaderboard code on your "Private Leaderboard" page.)
I'll edit in any leaderboards that people want to post, along with any description for the kinds of people you want to have on it. (My leaderboard is being used as my office's leaderboard.) And if I get something wrong, please call me out or message me and I’ll fix it ASAP.
There's no limit to the number of leaderboards you can join, so there's no problem belonging to a "Beginner" and a language specific one if you want.
Neat Statistics
I'm planning on adding some statistics, but other than "what languages did we see yesterday" does anyone have any ideas?
Languages Seen On Day 07
- javascript x 3
- python x 2
- c
- clojure
- haskell
- kotlin
- swift
Top comments (23)
Such a big contrast with yesterday and especially friday.
Quick and dirty Python solution:
Hi Sarah,
this one is driving me crazy. I've got exact the same solution you have, but I don't know how to submit it.
I've tried submitting the solution as a string of "0" and "1", but that doesn't work. Same for a string of spaces and "1".
Is there something I'm not seeing?
Any help would be appreciated :)
If you print it like in my example, it should display letters. For example
Would be a C. Just type the letters in as a solution :)
Thanks Sarah. That did the trick. Glad to be past this one. Lots of catching up to do :)
Glad I could help :) I’m very far behind as well, have been out sick the past week and a half so didn’t get much done lately. Good thing I have two weeks of vacation coming up.
Part 1:
Should be an integer number. Mine was in the 10e4 range.
Part 2
This answer should be a string of capital letters. (Regex:
[A-Z]+
) Mine was 5 letters longYou’ll have to use your monkey meat based ocr system unless you’re a maniac who has a python one on hand.
Thanks Jon. A bit of squinting helped :)
Finally somthing which doesn't involve with opcode :P
Solution in swift
Finally, a problem made for FP again.
First, a small utility function to partition an encoded image into its layers:
Part 1:
Part 2:
(Full code: github.com/jkoenig134/AdventOfCode...)
This one was pretty straightforward for me, aside from a silly mistake at the end which was making my image a mess. I'm much happier about the puzzles now that I've given myself permission to skip any that involve the word 'intcode'!
This felt like a big step down in difficulty from graph traversals and CPU madness!
Felt like a Kotlin day today. Pretty simple compared to yesterday.
Using my native programming language, Perl:
Part 1
Part 2
Both solutions use the transliteration operator
tr///
a lot. It's because it not only replaces characters one for one, but also returns the number of given characters in a string.SO much less difficult than yesterday. It took me a while to read the instructions correctly (need to sleep), but then I was away :D
Horray, a day I could finish! ;) I've been quite as I'm still struggling to solve part 2 for both day 6 and day 7....taking a break from those for a few days! (So I say, anyways lol)
JavaScript solution below - I used the Chalk library to colorize my text so the image was easier to read, and grabbed a screenshot. A little sad my image didn't spell out anything obvious, like I saw some other people's on the subreddit! My little terminal snowman makes me happy though. lol :)
Also certain this could have been done in fewer passes through the layers, but it was still very fast so not concerned about it.
Nice to have an easier problem after 2/5/7. :)
Did it in Ruby this time (I'm a few days behind, so I'm working on catching up):