Eser Aygün

Home Page

Computer

Music

Photos

eseraygun.com

E-mail Address

login

14.02.2012 · Print · History · Edit

L-system Fractal Generator for js1k

Computer.LsystemFractalGeneratorForJS1K History

Hide minor edits - Show changes to markup

14.02.2012 by 212.101.96.3 -
Changed lines 7-8 from:

The script that I wrote for js1k contest executes given L-system code and generates fractals on the screen. It supports turning (+ and ), drawing (lowercase letters) and push/pop ([ and ]) operators.

to:

The script that I wrote for js1k contest executes given L-system code and generates fractals on the screen. It supports turning (+ and ), drawing (lowercase letters) and push/pop ([ and ]) operators.

Added lines 99-109:

User's Discoveries

Swiss Cross by Forrest Oliphant

iters: 6
angle: 90
start: "x-ff-x"
x: "xf+fx-ff-xf+fx"
09.02.2012 by 85.97.244.82 -
Changed lines 23-27 from:

iters:5 angle:45 start:"X" X:"+ff++f++f--f++f++ff" f:"fff[-ffX][+fX]"

to:

iters: 5 angle: 45 start: "X" X: "+ff++f++f--f++f++ff" f: "fff[-ffX][+fX]"

09.02.2012 by 85.97.244.82 -
Added lines 20-28:

Fractal of Love by me

iters:5
angle:45
start:"X"
X:"+ff++f++f--f++f++ff"
f:"fff[-ffX][+fX]"
09.02.2012 by 85.97.244.82 -
Changed line 17 from:
X: "Y"
A rewriting rule. In each iteration all Xs in the current string are substituted with Ys.
to:
X: "Y"
A rewrite rule. In each iteration all Xs in the current string are substituted with Ys.
09.02.2012 by 85.97.244.82 -
Changed line 7 from:

The script that I wrote for js1k contest generates given L-system code on the screen. It supports turning (+ and ), drawing (lowercase letters) and push/pop ([ and ]) operators.

to:

The script that I wrote for js1k contest executes given L-system code and generates fractals on the screen. It supports turning (+ and ), drawing (lowercase letters) and push/pop ([ and ]) operators.

09.02.2012 by 85.97.244.82 -
Changed line 13 from:
angle: Θ
The turning angle in degrees. For example, 60 or 90.
to:
angle: Θ
The turning angle in degrees.
09.02.2012 by 85.97.244.82 -
Changed lines 17-18 from:
X: "Y"
A rewriting rule. In each iteration all Xs in the current string is substituted with Ys.
to:
X: "Y"
A rewriting rule. In each iteration all Xs in the current string are substituted with Ys.
Changed line 21 from:

Koch curve

to:

Koch snowflake

Changed line 23 from:

iters: 6

to:

iters: 5

Changed line 25 from:

start: "f"

to:

start: "f--f--f"

Changed line 29 from:

Sierpinski triangle from Wikipedia

to:

Dragon curve

Changed lines 31-35 from:

iters: 8 angle: 60 start: "f" f: "g-f-g" g: "f+g+f"

to:

iters: 12 angle: 90 start: "fX" X: "X+Yf+" Y: "-fX-Y"

Changed line 38 from:

Fractal plant from Wikipedia

to:

Gosper curve

Changed lines 40-44 from:

iters: 6 angle: 25 start: "+++X" X: "f+[[X]-X]-f[-fX]+X" f: "ff"

to:

iters: 5 angle: 60 start: "Xf" X: "X+Yf++Yf-fX--fXfX-Yf+" Y: "-fX+YfYf++Yf+fX--fX-Y"

Changed line 47 from:

Fractal plant by Adrian Mariano

to:

Moore curve

Added lines 49-57:

iters: 7 angle: 90 start: "L" L: "-Rf+LfL+fR-" R: "+Lf−RfR−fL+" @]

Sierpinski triangle

[@

Changed lines 59-62 from:

angle: 18 start: "+++++X" X: "f[+X]f[-X]+X" f: "ff"

to:

angle: 60 start: "f" f: "g-f-g" g: "f+g+f"

Changed line 65 from:

Another fractal plant by Adrian Mariano

to:

Fractal plant from Wikipedia

Changed lines 67-70 from:

iters: 4 angle: 22.5 start: "++++F" F: "FF-[-F+F+F]+[+F-F-F]"

to:

iters: 6 angle: 25 start: "+++X" X: "f+[[X]-X]-f[-fX]+X" f: "ff"

Changed line 74 from:

Spacefilling tile

to:

Fractal plant by Adrian Mariano

Changed lines 76-84 from:

iters: 7 angle: 36 start: "Q" P: "--FR++++FS--FU"

"FT++FR----FS++"

R: "++FP----FQ++FT" S: "FU--FP++++FQ--" T: "+FU--FP+" U: "-FQ++FT-"

to:

iters: 8 angle: 18 start: "+++++X" X: "f[+X]f[-X]+X" f: "ff" @]

Another fractal plant by Adrian Mariano

[@ iters: 4 angle: 22.5 start: "++++f" f: "ff-[-f+f+f]+[+f-f-f]"

09.02.2012 by 85.97.244.82 -
Changed lines 7-8 from:

The script that I wrote for js1k contest generates given L-system code on the screen. It supports turning (+ and ), drawing (F and G) and push/pop ([ and ]) operators.

to:

The script that I wrote for js1k contest generates given L-system code on the screen. It supports turning (+ and ), drawing (lowercase letters) and push/pop ([ and ]) operators.

Changed line 21 from:

Right-angled Koch Curve from Wikipedia

to:

Koch curve

Changed lines 23-26 from:

iters: 4 angle: 90 start: "F" F: "F+F−F−F+F"

to:

iters: 6 angle: 60 start: "f" f: "f+f--f+f"

Changed lines 33-35 from:

start: "F" F: "G-F-G" G: "F+G+F"

to:

start: "f" f: "g-f-g" g: "f+g+f"

Changed lines 43-44 from:

X: "F+[[X]-X]-F[-FX]+X" F: "FF"

to:

X: "f+[[X]-X]-f[-fX]+X" f: "ff"

Changed line 47 from:

Fractal plant by Adrian Mariano

to:

Fractal plant by Adrian Mariano

Changed lines 52-53 from:

X: "F[+X]F[-X]+X" F: "FF"

to:

X: "f[+X]f[-X]+X" f: "ff"

Added lines 62-74:

@]

Spacefilling tile

[@ iters: 7 angle: 36 start: "Q" P: "--FR++++FS--FU"

"FT++FR----FS++"

R: "++FP----FQ++FT" S: "FU--FP++++FQ--" T: "+FU--FP+" U: "-FQ++FT-"

09.02.2012 by 85.97.244.82 -
Added lines 45-61:

@]

Fractal plant by Adrian Mariano

iters: 8
angle: 18
start: "+++++X"
X: "F[+X]F[-X]+X"
F: "FF"

Another fractal plant by Adrian Mariano

[@ iters: 4 angle: 22.5 start: "++++F" F: "FF-[-F+F+F]+[+F-F-F]"

09.02.2012 by 85.97.244.82 -
Changed line 29 from:

Right-angled Koch curve from Wikipedia

to:

Sierpinski triangle from Wikipedia

Changed lines 31-32 from:

iters: 4 angle: 90

to:

iters: 8 angle: 60

Changed lines 34-35 from:

F: "F+F−F−F+F"

to:

F: "G-F-G" G: "F+G+F"

Changed line 38 from:

Sierpinski triangle from Wikipedia

to:

Fractal plant from Wikipedia

Changed lines 40-44 from:

iters: 8 angle: 60 start: "F" F: "G-F-G" G: "F+G+F"

to:

iters: 6 angle: 25 start: "+++X" X: "F+[[X]-X]-F[-FX]+X" F: "FF"

09.02.2012 by 85.97.244.82 -
Added lines 1-52: