edit: you can still join in! You can catch up to the puzzles being released at any time. it's not a race, but a marathon
edit 2: We have a leaderboard
Hey guys, this year Advent of Code started.
Every day of december up to the 25, a small coding puzzle will be released. For example, today's (the first one) is pretty simple:
The puzzle gives you as input a long list of numbers, the weights of each module.
So basically you just read all the numbers from a file, line by line, then calculate the fuel and add the total.
Once you get that right, you get access to a second puzzle, a little more complicated
Which is largely the same solution as for the first part, just with one little recursive function added (or, whatever method you use).
The puzzles start easy and ramp up to way crazier; but never anything with graphics, or using any weird library. The inputs are always ascii text at most.
You can sign up with a github account, google account or twitter account.
Sorry I forgot to make this thread earlier! But you can still join in.
Come on, let's save Santa.
edit 2: We have a leaderboard
Hidden content
You need to reply to this thread in order to see this content.
Hey guys, this year Advent of Code started.
Advent of Code 2019
adventofcode.com
Every day of december up to the 25, a small coding puzzle will be released. For example, today's (the first one) is pretty simple:
The Elves quickly load you into a spacecraft and prepare to launch.
At the first Go / No Go poll, every Elf is Go until the Fuel Counter-Upper. They haven't determined the amount of fuel required yet.
Fuel required to launch a given module is based on its mass. Specifically, to find the fuel required for a module, take its mass, divide by three, round down, and subtract 2.
For example:
- For a mass of 12, divide by 3 and round down to get 4, then subtract 2 to get 2.
- For a mass of 14, dividing by 3 and rounding down still yields 4, so the fuel required is also 2.
- For a mass of 1969, the fuel required is 654.
- For a mass of 100756, the fuel required is 33583.
The Fuel Counter-Upper needs to know the total fuel requirement. To find it, individually calculate the fuel needed for the mass of each module (your puzzle input), then add together all the fuel values.
What is the sum of the fuel requirements for all of the modules on your spacecraft?
The puzzle gives you as input a long list of numbers, the weights of each module.
So basically you just read all the numbers from a file, line by line, then calculate the fuel and add the total.
Once you get that right, you get access to a second puzzle, a little more complicated
During the second Go / No Go poll, the Elf in charge of the Rocket Equation Double-Checker stops the launch sequence. Apparently, you forgot to include additional fuel for the fuel you just added.
Fuel itself requires fuel just like a module - take its mass, divide by three, round down, and subtract 2. However, that fuel also requires fuel, and that fuel requires fuel, and so on. Any mass that would require negative fuel should instead be treated as if it requires zero fuel; the remaining mass, if any, is instead handled by wishing really hard, which has no mass and is outside the scope of this calculation.
Which is largely the same solution as for the first part, just with one little recursive function added (or, whatever method you use).
The puzzles start easy and ramp up to way crazier; but never anything with graphics, or using any weird library. The inputs are always ascii text at most.
You can sign up with a github account, google account or twitter account.
Sorry I forgot to make this thread earlier! But you can still join in.
Come on, let's save Santa.
Last edited: