Created
October 6, 2025 05:31
-
-
Save WilliamLivingood/bffeb2e7db634ce52ad0c5f5c66aa512 to your computer and use it in GitHub Desktop.
Random Length, Angle, and Systems
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| LSystem desy3() { | |
| float moveDist = random(10, 40); | |
| float rotateAngle = random(20, 60); | |
| float scaleFactor = 1.9f; | |
| String axiom = "F"; | |
| // Create any production rules | |
| HashMap<Character, String> rules = new HashMap<>(); | |
| String[] produc = new String[] { "FF-[-F+F]F+[+F-F]F", "F+F--F+F[+F-F]", "F+F--F+F[-F][+F]F" }; | |
| rules.put('F', produc[(int) random(produc.length)]); | |
| // Create and return the Lsystem | |
| return new LSystem(axiom, rules, moveDist, rotateAngle, scaleFactor); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment