Hide
Stay up to dateembedded code automagically updates, each snippet and article has a feed Join Siafoo Now or Learn More

Nodebox Repetition Tutorial, "For" loops and Ovals Atom Feed 0

In Brief Sample code first seen in the Nodebox Repetition Tutorial. This snippet introduces the use of "for" loops in combination with randomized size and position parameters to generate probabilistic patterns of ovals.... more
# 's
 1size(400,400)
2
3fill(0,0.6,0.9,0.1)
4stroke(0,0.6,0.9)
5strokewidth(0.25)
6
7for i in range(100):
8
9 x = random(WIDTH)
10 y = random(HEIGHT)
11 r = random(50,100)
12
13 oval(x,y,r,r)

Sample code first seen in the Nodebox Repetition Tutorial. This snippet introduces the use of "for" loops in combination with randomized size and position parameters to generate probabilistic patterns of ovals.

http://www.siafoo.net/image/88