Created
January 6, 2019 19:34
-
-
Save cggonzal/cad0162b656a5a6814bee1fe1d6b05d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for pos in positions: # iterate through all positions of pickedQueen and move to position of minimum conflict | |
NQ.moveQueen(pickedQueen,pos) | |
newNumberOfConflicts = NQ.specificQueenConflicts(pos) | |
if(newNumberOfConflicts < minAttacks ): | |
minConflictPosition = pos | |
minAttacks = newNumberOfConflicts | |
NQ.moveQueen(pos,pickedQueen) # move queen back | |
NQ.moveQueen(pickedQueen,minConflictPosition)# move queen to least conflict spot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment