Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def setup():
- size(800, 800)
- background(255)
- def draw():
- b=1
- def contaparole(x):
- parole=0
- a=x.split(" ")
- for i in a:
- if (i!=""):
- parole=parole+1
- return parole
- def mousePressed():
- x=1
- y=1
- linee = loadStrings("poesia.txt")
- for linea in linee:
- nump = contaparole(linea)
- if nump % 2== 0:
- stroke(255,117,020)
- a=random(250)
- line(x,y,x+a,y)
- if x<400:
- x=x+a
- else:
- x=x-a
- elif nump % 3== 0:
- stroke(117,255,020)
- a=random(250)
- line(x,y,x,y+a)
- if y<400:
- y=y+a
- else:
- y=y-a
- else:
- stroke(020,117,255)
- a=random(250)
- line(x,y,x+a,y+a)
- if x<400:
- x=x+a
- y=y+a
- else:
- x=x-a
- y=y-a
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement