28 lines
472 B
C++
28 lines
472 B
C++
#pragma once
|
|
|
|
#define EXERCISM_RUN_ALL_TESTS
|
|
|
|
#include <string>
|
|
#include <utility>
|
|
|
|
namespace queen_attack {
|
|
|
|
typedef std::pair<int, int> position_t;
|
|
|
|
class chess_board
|
|
{
|
|
position_t white_, black_;
|
|
|
|
public:
|
|
|
|
chess_board(position_t white = std::make_pair(0, 3),
|
|
position_t black = std::make_pair(7, 3));
|
|
|
|
const position_t &black() const;
|
|
const position_t &white() const;
|
|
|
|
bool can_attack() const;
|
|
operator std::string() const;
|
|
};
|
|
|
|
}
|