Welcome, guest | Sign In | My Account | Store | Cart
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

History

  • revision 3 (15 years ago)
  • previous revisions are not available