N Queens

The n-Queens problem

The n-queens problem is a classic combinatorial problem. It is required to place n queens on an n×n chess board so that no two queens threaten each other. Therefore no two queens can be on the same row, column or diagonal. There must be a queen on each column and all their row numbers must differ so a solution can be represented as a permutation of the rows. (Not all permutations are solutions.)

http://www.csse.monash.edu.au/~lloyd/tildeAlgDS/Recn/Queens/

Elegant solution in Haskell

http://cdsmith.wordpress.com/2007/12/09/some-basic-stuff-the-writer-monad/

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License