Coding Challenge #77: Recursion

Опубликовано: 17 October 2024
на канале: The Coding Train
109,847
3.1k

In this coding challenge, I explore the concept of recursion to create fractal patterns in JavaScript HTML5 canvas with the p5.js library. Code: https://thecodingtrain.com/challenges...

🕹️ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/s...

🎥 Previous video:    • Coding Challenge #76: 10PRINT in p5.js  
🎥 Next video:    • Coding Challenge #78: Simple Particle...  
🎥 All videos:    • Coding Challenges  

References:
📙 The Fractal Geometry of Nature: http://amzn.to/2xiVwht

Videos:
🎥 My playlist on fractals & recursion:    • 8: Fractals - The Nature of Code  
🔴 Coding Train Live 102:    • Coding Train Live 102: Intro to ES6 C...  

Related Coding Challenges:
🚂 #14 Recursive Fractal Trees:    • Coding Challenge #14: Fractal Trees -...  
🚂 #17 Space Colonization:    • Coding Challenge #17: Fractal Trees -...  
🚂 #21 Mandelbrot Set with p5.js:    • Coding Challenge #21: Mandelbrot Set ...  

Timestamps:
0:00 Introducing today's topic
1:46 Start coding!
2:51 Write a drawCircle function
3:37 Add recursion to the drawCircle function
5:15 Add an exit condition
6:58 Self-similar fractals
10:10 Add randomness
11:45 Have fun coding some recursive fractals

Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound

🚂 Website: http://thecodingtrain.com/
👾 Share Your Creation! https://thecodingtrain.com/guides/pas...
🚩 Suggest Topics: https://github.com/CodingTrain/Sugges...
💡 GitHub: https://github.com/CodingTrain
💬 Discord: https://thecodingtrain.com/discord
💖 Membership: http://youtube.com/thecodingtrain/join
🛒 Store: https://standard.tv/codingtrain
🖋️ Twitter:   / thecodingtrain  
📸 Instagram:   / the.coding.train  

🎥 Coding Challenges:    • Coding Challenges  
🎥 Intro to Programming:    • Start learning here!  

🔗 p5.js: https://p5js.org
🔗 p5.js Web Editor: https://editor.p5js.org/
🔗 Processing: https://processing.org

📄 Code of Conduct: https://github.com/CodingTrain/Code-o...

This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecod...

#recursion #fractals #beginners #javascript #p5js