It looks a bit like the n-queens problem, to me.
Definition of the n-queens problem:
Place n queens on an n*n chessboard so that no queen is on the same diagonal or in the same row or column as any other queen.
The coordinate pts (x, y) you are choosing could represent a queen at the...