Lunchtime coding challenges
Last week, I was asked for some help with a simple coding problem; to simulate the orbit of a moon around a planet. It's not a hard thing to write and with a little school-level geometry and the solution is simple (the hard part being that school was 25+ years ago).
I didn't want to do this to for any reason other than it sounded like a bit of fun, and I think that it's necessary to sometimes take a break from your day job and distract yourself with a different problem.
These little coding challenges are good for a few reasons:
1. Building a small project gives instant gratification.
2. Doing something different can help clear your head.
3. They let you learn new techniques.
4. You can play with unfamiliar parts of a language.
Here's the end result.
If you're interested, the source is available on github:
git clone https://github.com/adam-cant-run/planetary-oscillator