queen_attack: iteration 1

This commit is contained in:
Dmitry Kokorin 2016-05-12 17:48:09 +03:00
parent 92b98cf850
commit ce63789cb2
2 changed files with 110 additions and 0 deletions

View file

@ -0,0 +1,28 @@
#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;
};
}