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 th...
For further actions, you may consider blocking this person and/or reporting abuse
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 :)
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 :)
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 :)
This felt like a big step down in difficulty from graph traversals and CPU madness!
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'!
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...)
Aw yeah something simple again! Maybe even a little bit too simple? 😄
Anyway, in JavaScript:
Check my repo for my input.
By the way, here's the language count for day 7 (it could be subject to change as it was a kind of complex challenge):
JavaScript × 3
Python × 2
C × 1
Clojure × 1
Java × 1
Swift × 1
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
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):
Woohoo! Had some time to knock together a solution during lunch! It also contains what I feel like is my most Rust-y code I've ever written, where I
fold,zip,map, andinto_iterall in a few lines. I'm still upset at the obscene hoops I had to go through to read a file and parse each character to a digit. But baby steps...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.Functional JS style today
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.
Another Python hack...
Part 1
Part 2
This was a nice and simple solution as long as you remembered how to pivot a list of lists. Kotlin's builtin
minByandcountfunctions also simplify things a lot.Here's a version of part1 that does everything in two passes of the list instead of four.
Ascii art is relaxing comparing it IntCode computers <3