Malaysian
front-end web engineer
Recurse Center alum
```javascript
// recursive fibonacci function
function fib(n){
if(n == 0){
return 0;
}
if(n == 1){
return 1;
}
return fib(n-2) + fib(n-1);
}
// call it
fib(4)
```
repetition
in a self-similar way
Aristid Lindenmayer
a string rewriting system
axiom
|
A
|
rules
|
A → AB
B → A
|
axiom
|
A
|
rules
|
A → AB
B → A
|
|
n |
string |
0 | A |
1 | AB |
2 | ABA |
3 | ABAAB |
4 |
ABAABABA |
|
describing recursive patterns
symbol |
do thing |
F |
draw a line |
+ |
rotate clockwise by angle |
- |
rotate counterclockwise by angle |
symbol |
do thing |
F |
draw a line |
+ |
rotate clockwise by angle |
- |
rotate counterclockwise by angle |
[ |
save current state |
] |
restore saved state |
Y = -FX-Y X = X+YF+ |
→ |
|
simple rules |
→ |
beautiful paterns |