/* * Main authors: * Christian Schulte * * Copyright: * Christian Schulte, 2001 * * Last modified: * $Date: 2006-08-03 13:51:17 +0200 (Thu, 03 Aug 2006) $ by $Author: schulte $ * $Revision: 3506 $ * * This file is part of Gecode, the generic constraint * development environment: * http://www.gecode.org * * See the file "LICENSE" for information on usage and * redistribution of this file, and for a * DISCLAIMER OF ALL WARRANTIES. * */ #include "examples/support.hh" #include "gecode/minimodel.hh" /** * \brief %Example: n-%Queens puzzle * * Place n queens on an n times n chessboard such that they do not * attack each other. * * \ingroup Example * */ class Queens : public Example { protected: /// Position of queens on boards IntVarArray q; public: /// The actual problem Queens(const Options& opt) : q(this,opt.size,0,opt.size-1) { const int n = q.size(); if (opt.naive) { for (int i = 0; i(opt); return 0; } // STATISTICS: example-any