Live data from Hacker News

Advent of Code 2019

adventofcode.com

101–110 of 124 posts

Re: Advent of Code 2019

#101
Day 2 part 2, what is it actually asking?

I can't tell from the description what the actual puzzle is...

Is it that I need to generate a program that generates the output 19690720 when run through the function that was written in part 1?

Re: Advent of Code 2019

#102
post #101

Day 2 part 2, what is it actually asking? I can't tell from the description what the actual puzzle is... Is it that I need to generate a program that generates the output 19690720 when run through the function that was written in part 1?

In the first problem they told you what numbers to put in position 1 and 2. In the second problem you want to find the specific numbers for position 1 and 2 that yield the desired output.

Re: Advent of Code 2019

#103
post #101

Day 2 part 2, what is it actually asking? I can't tell from the description what the actual puzzle is... Is it that I need to generate a program that generates the output 19690720 when run through the function that was written in part 1?

you need to find value of memory[1] & memory[2] where memory is the program from first part, which gets you 19690720

Re: Advent of Code 2019

#104
post #102
post #101

Day 2 part 2, what is it actually asking? I can't tell from the description what the actual puzzle is... Is it that I need to generate a program that generates the output 19690720 when run through the function that was written in part 1?

In the first problem they told you what numbers to put in position 1 and 2. In the second problem you want to find the specific numbers for position 1 and 2 that yield the desired output.

Ah ok, thanks!

My reading comprehension obviously needs some work :P

Re: Advent of Code 2019

#105
post #101

Day 2 part 2, what is it actually asking? I can't tell from the description what the actual puzzle is... Is it that I need to generate a program that generates the output 19690720 when run through the function that was written in part 1?

you need to find value of memory[1] & memory[2] where memory is the program from first part, which gets you 19690720

Thanks, five minutes to write the code and get an answer, half an hour staring at it wondering what on earth I was actually supposed to do....

Feel like a bit of an idiot.

Re: Advent of Code 2019

#106
post #86

I'm trying to use J and still struggle with the second part of day 1. Any other J users?

I have found a solution someone posted [0]

It looks similar to what I though I had to write, but I will have to reread it and the documentation to understand it well.

And day 2 seems a bit too complex with my meager J knowledge. OTOH with the J interpreter for android and its terseness it seems the most suited language for programming on a phone, so I will probably stick to it.

[0] https://www.reddit.com/r/adventofcode/comments/e4axxe/2019_d...

Re: Advent of Code 2019

#108
post #105

Earlier quoted context omitted.

you need to find value of memory[1] & memory[2] where memory is the program from first part, which gets you 19690720

Thanks, five minutes to write the code and get an answer, half an hour staring at it wondering what on earth I was actually supposed to do.... Feel like a bit of an idiot.

So, just like most days as a programmer?

Re: Advent of Code 2019

#109
post #56
post #27

Earlier quoted context omitted.

Learning new environments can be painful so it’s good it starts off easy. I’m trying to solve them with Swift Playgrounds on the iPad, for example. And I can’t figure out how to create a simple text file for the data.

I solved the first part using the examples. Swift is nice. func calcFuel(_ mass:Int) -> Int {mass / 3 - 2} let z0 = massList.map(calcFuel).reduce(0, +) or simply ... let z1 = massList.map({$0 / 3 - 2}).reduce(0, +) Any idea how to read the data on the iPad?

I copy my session cookie and send a web request for the inputs. I should write some sort of caching code though..

Re: Advent of Code 2019

#110
post #27
post #14

Many of the comments are about the event as a whole, but I'd like to commend the author for the day 1 puzzle, which I think is very cleverly written. Many people (including myself) use these as an opportunity to try out learning a new language, and the first puzzle does a good job of making sure you know enough basic operations for some of the puzzles coming up. The puzzle itself wasn't very difficult, you could do i…

Learning new environments can be painful so it’s good it starts off easy. I’m trying to solve them with Swift Playgrounds on the iPad, for example. And I can’t figure out how to create a simple text file for the data.

I couldn't figure it out on a Mac. Then I Googled it, and decided I'm better off solving this in languages I know (whatever I feel like today: JS, Python, Java, perhaps even Erlang) or in a language that has a reasonable standard library (Rust) than in this mess: https://twitter.com/dmitriid/status/1201441652507844608
Post reply on HN