Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Problema slide4b n84
- def swapColumn(pict, numCol):
- # @param pict: Picture
- # @param numCol: Int. Numero delle colonne
- columnWidth = getWidth(pict)/numCol
- for i in range(0, getWidth(pict), 2*columnWidth):
- for x in range(i, min(getWidth(pict), i+columnWidth)):
- for y in range(getHeight(pict)):
- pixelColA = getPixel(pict, x, y)
- pixelColB = getPixel(pict, min(getWidth(pict)-1, x+columnWidth), y)
- colorA = getColor(pixelColA)
- colorB = getColor(pixelColB)
- setColor(pixelColA, colorB)
- setColor(pixelColB, colorA)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement