Advertisement
Guest User

Untitled

a guest
Apr 25th, 2015
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. def check_legal(self):
  2. div = int(math.sqrt(self.BoardSize))
  3. for x in range(0,div):
  4. for i in range(0,div):
  5. j=self.CurrentGameBoard[x][i]
  6. for k in range(0,div):
  7. if (j==self.CurrentGameBoard[x][k] and k!=i):
  8. return false
  9. for x in range(0,div):
  10. for i in range(0,div):
  11. j=self.CurrentGameBoard[i][x]
  12. for k in range(0,div):
  13. if (j==self.CurrentGameBoard[k][x] and k!=i):
  14. return false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement