Last active
July 6, 2017 15:45
-
-
Save jahpd/79d2c5a6f3e1bd77d3afc0e7111c088a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n = 19 | |
a = {x:[],y:[]} for i in [0..n-1] | |
update = (a, fn) -> | |
for _n in [0..a.length-1] | |
for key,val of a[_n] | |
fn(_n,key,val) | |
@text a[_n], 10, (_n+1)*(n/@width) | |
callback = (n, k, v) -> | |
v = @random (if k is 'x' then @width else (if k is 'y' then @height)) | |
@setup = -> | |
@createCanvas 480, 360 | |
# Log is some preadded variable | |
@textFont log | |
@textSize 20 | |
update a, callback | |
@draw = -> | |
@background 0 | |
@noFill() | |
for i in [0..a.length-1] | |
@stroke @random 255, @random 255, @random 255 | |
@bezier(a[i].x[0], a[i].y[0], a[i].x[1], a[i].y[1],a[i].x[2],a[i].y[2],a[i].x[3],a[i].y[3]) | |
update a, callback |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment