nature-of-code / Nature-of-Code-Website-Archive

Repo for web files for nature of code
https://noc-processing-archive.netlify.app/
111 stars 21 forks source link

2.9 float G not declared #14

Closed anystar closed 2 years ago

anystar commented 11 years ago

Edit: Most of my problems come from attempting to implement as I read, which this book is really not designed for. Am I right?

In 2.9 Gravitational Attraction we have a variable for gravity, G. But in our Attractor class it is not delcared until later on by the end. At the end there is a complete code example of the Attractor class that does have it.

When we first create the Attractor class, add float G; under PVector location;

Quickest way to find the section is by Ctrl F for "tying mass to size"

Thanks, Alan.

shiffman commented 2 years ago

10 years later I have fixed this in the 2nd edition! https://github.com/nature-of-code/book-website-2nd-edition