Daniel Doubrovkine bio photo

Daniel Doubrovkine

aka dB., @awscloud, former CTO @artsy, +@vestris, NYC

Email Twitter LinkedIn Github Strava
Creative Commons License

The eight queens puzzle is the problem of putting eight chess queens on an 8×8 chessboard such that none of them is able to capture any other using the standard chess queen’s moves. The queens must be placed in such a way that no two queens would be able to attack each other. Thus, a solution requires that no two queens share the same row, column, or diagonal. The eight queens puzzle is an example of the more general n queens puzzle of placing n queens on an n×n chessboard, where solutions exist only for n = 1 or n ≥ 4.


I dug up some old code that implemented the puzzle solution(s) in scheme and x86 assembly.

I remember trying to get solutions for large (over 10) boards in 1995 and my PC was a little slow. Things are very different today. Here’s an example of solution number 128570 for a board of 20.

(128570) 11 1 3 5 12 2 15 13 18 14 4 6 19 16 10 7 20 8 17 9