The N-Queens puzzle is the problem of placing a number N of chess queens on an NxN chessboard so that no two queens attack each other. Thus, a solution requires that no two queens share the same row, column, or diagonal. The solutions exist for all natural numbers n with the exception of 2 and 3.

This Javascript program uses a genetic algorithm to find a solution to the problem.