[Tutor] skipping ahead within a loop

Clay Wiedemann clay.wiedemann at gmail.com
Thu Mar 15 15:27:01 CET 2007


If  doing a loop, how can one skip forward a specific amount randomly
determined within the loop?
Below is a boiled down version of what I am trying (HEIGHT and random
come from NodeBox). I imagine a simple solution is out there, my
searches failed me


for y in range(HEIGHT):
	linewidth = random(3, 9)
	# drawlines, etc.
	y += linewidth 	# this is what does not work



Thanks,
Clay


More information about the Tutor mailing list