queen_attack: iteration 1
This commit is contained in:
parent
92b98cf850
commit
ce63789cb2
2 changed files with 110 additions and 0 deletions
28
cpp/queen-attack/queen_attack.h
Normal file
28
cpp/queen-attack/queen_attack.h
Normal 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;
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue