Learning Materials
Work Log
(After you’ve watched the videos for next week on functions...) How might you make something loop without using a for loop or a while loop? (Hints: https://en.wikipedia.org/wiki/Lather,_rinse,_repeat
lather, rinse, repeat
hint.
the repeat
part is where it makes it do everything all over again.
it also reminded me of asking for 3 more wishes when granted 3 wishes.
I think I took it at face value and didn’t give much thought to it when I learned about this concept for the first time.
lather, rinse
part (=the core action of the function): draws one checkrepeat
part : calls itself to draw another check
Create a pattern by making something with a lot of repetition. Is the resulting pattern easy to see or hard to see? What would it mean to create the illusion of pattern? Can you predict what the pattern will be when you run your code or does it surprise you?
1st idea: I wanted to draw something with a fractal pattern in nature - a fern, like this one:
2nd idea: so I opted to draw a staircase pattern.
I decided to use the same recursive function structure I used for the previous exercise.
at first, I created a function that would create one step and made it recursive. I tested it out until it worked.
https://editor.p5js.org/jinnie75/sketches/7LXgZUHj-
Then, using the looping logic of draw, I wanted it to make it start drawing staircases starting from any random point with varying step sizes with different greyscale colors.
https://editor.p5js.org/jinnie75/sketches/KeZQTldF_
Screen Recording 2024-09-29 at 8.14.31 PM.mov
I made the frameRate intentionally slow, but after some time there is a certain grid pattern (maybe like a bird’s eye view of New York?) on the screen. In time, the screen becomes merely a greyscale blob.
answers to the prompt:
room for improvement: I did this assignment on a rainy day and the work turned out a tad gloomy. I would like to retry my fern Idea and create a whole garden out of it.