Project Description: This project focuses on efficiently generating the Koch Curve using Scratch by implementing a recursive custom block. Instead of creating separate blocks for each generation, I used a single custom block with the parameters length and iteration to control both the size of each segment and the number of recursive steps. The program follows the Koch pattern by dividing each line segment into thirds and recursively drawing four smaller segments with specific angle turns (60° and 120°), continuing until the iteration value reaches zero, where a straight line is drawn. This approach reflects the emphasis on using custom blocks and recursion to simplify and shorten code while still producing higher generations of the fractal. By using recursion, the code becomes more efficient and scalable, allowing the user to generate increasingly complex versions of the Koch Curve without rewriting large sections of code :).
Strengths: A strength of my project is that I used a single recursive custom block instead of creating separate blocks for each generation. This made my code shorter, more organized, and easier to manage. Using the parameters length and iteration allowed the same block to handle all levels of the Koch Curve, which improved efficiency and reduced repetition.
Understandings: Through this project, I learned how recursion can be used to create complex patterns like the Koch Curve by repeating the same process on smaller segments. I also understood how custom blocks make code more efficient by avoiding duplication and making it easier to adjust values like iteration to change the level of detail. This helped me see how breaking a problem into smaller parts can simplify programming.
Coding Key:
"What generation would you like to create?" (Answer: any whole number (1-100) though after iteration 10 might be glitchy).