Skip to content

Add N-body gravity simulator series (Go, Programming for Lovers) - #962

Open
phcompeau wants to merge 1 commit into
practical-tutorials:masterfrom
phcompeau:add-p4l-gravity-simulator-go
Open

phcompeau wants to merge 1 commit into
practical-tutorials:masterfrom
phcompeau:add-p4l-gravity-simulator-go

Conversation

@phcompeau

Copy link
Copy Markdown

What is this?

A three-part Go code-along from Programming for Lovers. Part 1 introduces structs and methods, including pointer receivers. Part 2 organizes the simulation's data types, reads initial systems from file, draws bodies and trails to a canvas, and renders the result as an animated GIF. Part 3 builds a gravity physics engine from Newton's laws (acceleration, velocity, and position updates) and runs the finished program from the command line to animate Jupiter's moons and several periodic three-body orbits. Each part has a video and full code, and the starter code (file I/O and drawing helpers plus data files) is a free download.

Checklist

  • This PR adds/fixes exactly one tutorial (or is a docs/tooling-only change).
  • Free and open -- no paywall, login wall, or required newsletter signup.
  • Project-based -- following it, the reader builds a complete, working artifact.
  • I searched README.md for this URL and title -- it is not already listed.
  • Entry uses - [Title](https://...) format, placed under the correct section (nested - [Part N](...) for multi-part series).
  • No URL shorteners.
  • I ran python3 scripts/check_readme.py lint locally and it exits 0.
  • Relationship disclosure: I am the author. I (Phillip Compeau) wrote Programming for Lovers.

Lint and check-diff exit 0, and check-links on the three added URLs returns 200 for each.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant