Processing 特训(Fractals) - 8

明确概念

Fractal: a rough or fragmented geometric shape that can be split into parts, each of which is a reduced-size copy of the whole. 

Recursion: the repeated application of a rule to successive results.

明确功能

1.通过递归画一个雪花折叠图

2.通过递归画一个树状图

功能设计

类:Tree

属性:root, angle

方法:branch

伪代码

setup(){

}

draw(){

    tree.branch();

}

class Tree{

    定义属性

    Tree(){}

    定义方法

}

正式代码

见:

Processing/Fractals at master · JoeyQiang/Processing · GitHub

代码优化

1.随机角度,随机长度

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 12,136评论 0 10
  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 13,402评论 0 23
  • 我爱钱,我的生活需要钱。在我买过无数的课,希望各种方式赚钱的时候,发现,理财是我最值得的努力方向。感谢长投学堂,带...
    yushuqiongzhi阅读 1,358评论 1 0
  • spring-session揭秘
    萧萧飞叶阅读 1,066评论 0 0
  • 静童年记忆大多是美好的。静小学是养母领着她过去报名的,但初中、高中到大学都是静一个人去报名、确认上哪学校。 农村在...
    语中阅读 1,683评论 0 1