This is the numberjack solution to the famous n-Queens problem.
The n queens puzzle is the problem of putting n chess queens on an nÃ—n 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.
queens = [Variable(N) for i in range(N)]
model = Model(
AllDiff( queens ),
AllDiff( [queens[i] + i for i in range(N)] ),
AllDiff( [queens[i] - i for i in range(N)] )
(queens,model) = model_queens(param['N'])
solver = model.load(param['solver'])
print 'Nodes:', solver.getNodes(), ' Time:', solver.getTime()
separator = '+---'*len(queens)+'+'
for queen in queens:
print '| '*queen.get_value()+'| Q |'+' |'*(len(queens)-1-queen.get_value())