Advertisement
Guest User

Untitled

a guest
Dec 13th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. def squarePict(pict, x):
  2. #@param pict: picture
  3. #@param x: int
  4.    if(getWidth(pict)==getHeight(pict)):
  5.       for i in range(getWidth(pict)):
  6.          for j in range(getHeight(pict)):
  7.             pxc=getPixel(pict, x, i)
  8.             pxr=getPixel(pict, j, x)
  9.             c=getColor(pxc)
  10.             r=getColor(pxr)
  11.             setColor(pxc, r)
  12.             setColor(pxr, c)
  13.       show(pict)
  14.    else: show(pict)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement