A bank holiday weekend project in which I reimplement a simple gravity simulator that I loved to play with in high school. The original was in Java, and this one is in Go.
The program randomly generates a number masses on the screen. After that, each body simply follows Newton's laws of motion and universal gravitation; also, the masses merge together if they come too close to each other. Even with this basic setup, interesting behaviours can sometimes emerge, e.g. a smaller body orbiting a larger one.
