Define a Python function
(
n = NB("def_with_random_walk", 1200, 800);
n.py("
def the_box(font_size):
x = random(10, 50)
y = 20
width = 20
height = 40
offset = 16
q = 5
fontsize(font_size)
translate(random(10, 50), random(10, 50))
push()
skew(random(-50, 50))
rotate(random(-200, 200))
text(\"I am a box\", x + offset - 70 + random(-20, 20), y ++ offset + 40 + random(-20, 20))
pop()
nofill()
stroke(0)
strokewidth(0.25)
fill(random(), random(), 0, 0.096)
rect(x, y, width, height)
rect(x + offset, y + offset, width, height)
fill(1, random(), random())
line(x, y, x + offset, y + offset)
line(x, y + offset + y + q, x + offset, y + offset + offset + y + q)
line(x + width, y, x + offset + width, y + offset)
line(x + width, y + offset + y + q, x + offset + width, y + offset + offset + y + 5)
for i in range(11):
the_box(random(8, 16))
"
);
n.renderAndDisplayImage(3);
)