Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def problema1(A,x,y,c):
- #@param A:picture
- #@param x:integer
- #@param y:integer
- #@param c:color
- if x<0 or x>=getWidth(A) or y<0 or y>=getHeight(A):
- print "input non valido"
- return -1
- else:
- for i in range(0,getWidth(A)-x):
- if y+i<getHeight(A):
- setColor(getPixel(A,i+x,i+y),c)
- repaint(A)
- def problema2(M,x,y):
- #@param M:matrix
- #@param x:integer
- #@param y:integer
- #@param c:color
- if x<0 or x>=len(M[y]) or y<0 or y>=len(M):
- print "input non valido"
- return -1
- else:
- for i in range(0,len(M)-y):
- if x+i<len(M[y]):
- M[y+i][x+i]=0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement