This repository is a collaborative effort to port the code examples from Daniel Shiffman's book The Nature of Code from the JavaScript library p5.js to the Processing programming language.
The code examples are organized by chapters, starting from Chapter 0. Within each chapter, examples are numbered sequentially (e.g., Example_0_1
, Example_0_2
).
/chapter0/
Example_0_1/
Example_0_2/
...
/chapter1/
Example_1_1/
Example_1_2/
...
Each example is contained in its respective folder to make navigation straightforward. The names of the main sketche files should be the same as the folder they are in
To see how the first example in the book was ported (Example_0_1) by Dan, check out this livestream.
We welcome contributions from the community! If you'd like to help port examples to Processing, please follow these guidelines:
- Ensure the ported code adheres to Processing's syntax yet stays in the same style conventions.
- Keep the functionality and code structure as close to the original p5.js example as possible.
- Test your code to ensure it runs properly in Processing.
- Make sure to change window size from (640,240) -> (640,360) and make sure everything is still centered and looks correct in the new window size
- Replace the p5.js function
createP()
to the Processing functionprintln()
all the code examples are available in the The Nature of Code Website.
Feel free to open a pull request or raise an issue if you have questions or suggestions!