I made a similar tutorial for RSA and DH in Easylang—a learning and teaching programming language I developed myself. What makes things a bit difficult is that Easylang doesn't support big numbers.
The physics in the simulation was faulty, that should be better now. Of course there are less collisions in 3D than in 2D. And this catapulting of stars is also an artifact in the discrete computer simulation
@design choices: The graphic primitives built into the language - this is not useful for a general purpose language - but in beginner language this is an important motivating factor.
The aim is to offer beginners a simple and interesting entry into programming. IMO there is an unoccupied niche for this between Scratch and Python. In the days of home computer BASIC, it was easier to learn programming - you switched on the computer and with a few lines of BASIC code you could magically create a nice sine wave on the screen. Nowadays, beginners are often overwhelmed by all the complexity.
It shouldn't be that complicated. I tried it once with gravity and without limits on the edges. The cluster of stars moved around in 2d space and stars were repeatedly catapulted out, which then disappeared. Maybe you need a super gravity (black hole) in the center to keep it stable.
Hello author here. I'm a little surprised to see this on the front page of Hacker News. This is just a simple demo for my educational programming language Easylang. You can easily edit the code and increase the particle count for example. In the IDE you can then create a link with the code embedded in the URL.