return dist;
}
-std::vector<Step*> Step::successors(std::shared_ptr<Step> shared_this) {
+std::vector<Step*> Step::successors(std::shared_ptr<Step> shared_this) const {
std::vector<Step*> suc;
signed char hole_pos = board.hole();
for (int i = 0; adjacent[hole_pos][i] > 0; i++) {
struct Step {
Board board;
std::shared_ptr<Step> prev;
- std::vector<Step*> successors(std::shared_ptr<Step> shared_this);
+ std::vector<Step*> successors(std::shared_ptr<Step> shared_this) const;
static signed char adjacent[BOARD_SIZE][5];
};
std::ostream& operator<<(std::ostream& os, const Step& step);