Advertisement
Guest User

Untitled

a guest
Apr 21st, 2018
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.72 KB | None | 0 0
  1. def gemello(p1,p2):
  2.     #@param p1,p2: pixel
  3.     #@return bool
  4.     return getRed(p1)+getGreen(p1)+getBlue(p1)==getRed(p2)+getGreen(p2)+getBlue(p2)
  5.    
  6. def gemelloPerOgni(pix,S):
  7.     #@param pix: pixel
  8.     #@param S: sequenza di pixel
  9.     #@return bool
  10.     for p in S:
  11.         if not gemello(pix,p):
  12.            return False
  13.     return True
  14.    
  15. def existPixel(pic1,pic2):
  16.     #@param pic1: picture
  17.     #@param pic2: picture
  18.     #@return bool
  19.     seq1=getPixels(pic1)
  20.     seq2=getPixels(pic2)
  21.     for px in seq1:
  22.         if gemelloPerOgni(px,seq2):
  23.            return True
  24.     return False
  25.    
  26. def start():
  27.     pic1=makePicture(pickAFile())
  28.     pic2=makePicture(pickAFile())
  29.     c=existPixel(pic1,pic2)
  30.     print c
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement