edit:

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:

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

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.

**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 leaderboardedit 2: We have a leaderboard

### Leaderboard - Advent of Code 2019

adventofcode.com

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 puzzle gives you as input a long list of numbers, the weights of each module.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 givenmoduleis based on itsmass. 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 requirementsfor all of the modules on your spacecraft?

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).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 fuelalsorequires fuel, andthatfuel requires fuel, and so on. Any mass that would requirenegative fuelshould instead be treated as if it requireszero fuel; the remaining mass, if any, is instead handled bywishing really hard, which has no mass and is outside the scope of this calculation.

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: