This repository is a collaborative effort to port the code examples from Daniel Shiffman's book The Nature of Code from the Processing programming language to python Mewnala.
Note: Our python library mewnala is very early and has missing functionality, so be prepared for things not working and to have to ask us lots of questions in the #libprocessing discord.
We are going to work together to make all these examples work!
You will want to set up your environment by following the instructions on the libprocessing repo. But just incase, here you go:
# have python3 installed on your system
# create a sketch folder and go inside
mkdir my-sketch-folder && cd my-sketch-folder
# create a virtual env
python -m venv .venv
# activate virtual env
source .venv/bin/activate
pip install mewnala
python my_ported_sketch.pyAfter you have mewnala set up (and tried running some example sketches!) head over to TODO.md to see what needs to be done!
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
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 -> Processing) example as possible.
- Test your code to ensure it runs properly using
Mewnala. - 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 the Processing function
println()to the pythonprint()function
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!