Andreas' practical language comparison
Peter Hansen
peter at engcorp.com
Thu Apr 29 22:24:34 EDT 2004
John J. Lee wrote:
> I think there's an n-queens solution by Tim Peters somewhere, written
> as an example of Python simple generators (which is mostly 'his'
> language feature, IIRC).
Google found a page which says:
Two other examples in Lib/test/test_generators.py produce solutions
for the N-Queens problem (placing queens on an chess board so that
no queen threatens another) and the Knight's Tour (a route that takes
a knight to every square of an chessboard without visiting any square
twice).
So I guess the answer would be "use the source".
-Peter
More information about the Python-list
mailing list