Advent of Code 2019 Solution Megathread - Day 12: The N-Body Problem

Jon Bristow - Dec 12 '19 - - Dev Community

We've got to mind our moons! So let's tighten our belts and drop into the orbit of Day 12.

Day 12 - The Problem

Fresh from our run-in with the police, we are more safety minded than usual. It's bad enough to be driving while distracted by giant red dots, but Jupiter's moons are swirling about willy-nilly. We need to get tracking!

Part 1 has us simulating four moons as they pull on each other with gravity. Somehow, I don't think that this is how moons normally orbit Jupiter, but whatever!

Part 2 is all about optimization. We need to simulate until it loops! This is a really big number, so we're going to need to cheat to win.

Ongoing Meta

Dev.to List of Leaderboards

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 09

Under construction

. . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player