Advertisement
Guest User

esercizio1

a guest
Dec 14th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. def newLine(pic,x,y,c):
  2.  #@param pic: picture
  3.  #@param x , y: int
  4.  #@param c: color
  5.  if x>=getWidth(pic)-1 or x<0 or y>=getHeight(pic)-1 or y<0:
  6.   print 'parameter error'
  7.   return
  8.  for param in range(x,getWidth(pic)):
  9.   if x!=getWidth(pic)-1 and y!=getHeight(pic)-1:
  10.    px=getPixel(pic,x,y)
  11.    setColor(px,c)
  12.    x+=1
  13.    y+=1
  14.   elif x==getWidth(pic)-1 or y==getHeight(pic)-1:
  15.    show(pic)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement