Subscribe to:
Post Comments (Atom)

skip to main |
skip to sidebar

Programming tricks related to ActionScript, Python, C/C++ and Java. See the comments for answers.

Subscribe to:
Post Comments (Atom)

## 1 comment:

>>> import itertools

>>> print "\n\n".join([("\n".join([' '.join([('x' if i==x else '.') for i in xrange(8)]) for x in v])) for v in itertools.permutations(xrange(8)) if 8 == len(set(v[i]+i for i in xrange(8))) == len(set(v[i]-i for i in xrange(8)))])

Post a Comment