Skip to content

Instantly share code, notes, and snippets.

@cggonzal
Created January 6, 2019 20:27
Show Gist options
  • Save cggonzal/1849c9d665f7c86cd8c2adfd23e60464 to your computer and use it in GitHub Desktop.
Save cggonzal/1849c9d665f7c86cd8c2adfd23e60464 to your computer and use it in GitHub Desktop.
def allQueensSafe(self): # returns true if problem is solved and all queens safe, false otherwise
for pos in self.queenPositions:
if(self.UnderAttack(pos)):
return False
return True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment