Stop
Continue
Go
/* 20 Random Points Connected by Lines This example draws 20 random points and connects them with lines. We use arrays to remember where the points are. */ function setup(){ //no special setup needed } function draw(){ //arrays to hold coordinates of points var x=[]; var y=[]; var i,j; //index for for loop //get random coordinates for (i=0;i<20;i=i+1){ x[i]=width*random(); y[i]=height*random(); } //draw the points for (i=0;i<20;i=i+1){ point(x[i],y[i]); } /* We will draw so many lines that they will get jumbled. If we make them slightly transparent, it will look better. */ color(0,0,0,0.25); /* Draw points between lines. The index i will take on values 0,1,2...19. The index j will tak on i+1, i+2,...19. */ for (i=0;i<20;i=i+1) for (j=i+1;j<20;j=j+1){ line(x[i],y[i],x[j],y[j]); } }
default
3024-day
3024-night
ambiance
base16-dark
base16-light
blackboard
cobalt
eclipse
elegant
erlang-dark
lesser-dark
mbo
mdn-like
midnight
monokai
neat
night
paraiso-dark
paraiso-light
pastel-on-dark
rubyblue
solarized dark
solarized light
the-matrix
tomorrow-night-eighties
twilight
vibrant-ink
xq-dark
xq-light