previndexinfo

code guessing, round #102, stage 1 (writing)

started at . submit by

specification

how have we not had this before? it's time to n-queen out. submissions can be written in any language, with a caveat.

n-queens is a problem on the level of fizzbuzz in the sense that you probably already know it. in case you don't, I can go over it real quick.

on any n×n chessboard where n ≥ 4, you can place n queens such that none of the queens threatens any of the others – that is to say, each queen has no other queen on the same row, column, or either diagonal. here's the prettiest solution for n = 8: 8 queens on a chessboard, located on c1, e2, b3, h4, a5, g6, d7, and f8.

your challenge, given an integer n equal to or greater than 4, is to compute any valid solution to the n-queens puzzle. but there's a catch: you're not allowed to use any data type other than sets (unordered collections of unique elements which in this case must also be sets).

in a language which does not have sets built in, you may implement them yourself in terms of other data types or use a dependency. as always in code guessing, you are the definitive interpreter of the rules, so have fun with it. as any language is allowed, there is no fixed API.

entries

0 entries have been received so far.

submit