Created
October 8, 2016 03:06
-
-
Save valdergallo/cc21880b3db6352994bff8148a3e038c to your computer and use it in GitHub Desktop.
The best eight queen that ever in the world !!!
This file contains hidden or 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
from itertools import permutations | |
n = 8 | |
cols = range(n) | |
for vec in permutations(cols): | |
if (n == len(set(vec[i] + i for i in cols)) | |
== len(set(vec[i] - i for i in cols))): | |
print(vec) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment