Advertisement
MaxDvc

lineCheck

Nov 8th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. def lineCheck(pict,k):
  2. #@param:
  3. #   pict: picture;
  4. #   k: int;
  5.     width = getWidth(pict)
  6.     height = getHeight(pict)
  7.     a = False
  8.     for y in range(0,height):
  9.         s = 0
  10.         for x in range(0,width):
  11.             pix = getPixel(pict,x,y)
  12.             r = getRed(pix)
  13.             s = s+r
  14.         if s == k:
  15.             a = True
  16.     if a:
  17.       return True
  18.     else:
  19.       return False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement