48 lines
807 B
C++
48 lines
807 B
C++
#include <array>
|
|
#include <vector>
|
|
|
|
namespace queens
|
|
{
|
|
// Easy way represent a conflict:
|
|
struct Conflict
|
|
{
|
|
int piece_1;
|
|
int piece_1_x;
|
|
int piece_1_y;
|
|
int piece_2;
|
|
int piece_2_x;
|
|
int piece_2_y;
|
|
};
|
|
class Piece
|
|
{
|
|
public:
|
|
int x;
|
|
int y;
|
|
|
|
Piece(int x, int y);
|
|
};
|
|
class Queen: public Piece
|
|
{
|
|
using Piece::Piece;
|
|
};
|
|
|
|
class Board
|
|
{
|
|
public:
|
|
int m;
|
|
int n;
|
|
};
|
|
|
|
class Configuration
|
|
{
|
|
public:
|
|
int number_of_pieces;
|
|
std::vector<Piece> pieces;
|
|
Board* board;
|
|
|
|
Configuration(int m, int n, int number_of_pieces);
|
|
std::vector<Conflict> get_conflicts();
|
|
};
|
|
|
|
|
|
} |