Advertisement
nekotrap

Untitled

Sep 30th, 2021
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. def noFrags(cords, j):
  2.     x1 = cords[j][0]
  3.     y1 = cords[j][1]
  4.     for i in range(j + 1, len(cords) - 1):
  5.         x2 = cords[i][0]
  6.         y2 = cords[i][1]
  7.         if (x1 + y1 == x2 + y2) or \
  8.             (x1 - y1 == x2 - y2):
  9.             return False
  10.         if x1 == x2 or y1 == y2:
  11.             return False
  12.     return True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement