Add Lines::findChar() to search for starting points in mazes
This commit is contained in:
@@ -28,7 +28,6 @@ class GuardGallivant
|
||||
public:
|
||||
virtual const std::string getPuzzleName() const override;
|
||||
virtual const int getPuzzleDay() const override;
|
||||
virtual void processDataLine(const std::string& line) override;
|
||||
virtual void finish() override;
|
||||
private:
|
||||
typedef Grid<bool> VisitGrid;
|
||||
|
||||
@@ -44,7 +44,6 @@ class ReindeerMaze
|
||||
void initializeWorkList(std::list<ReindeerMazeCrossing>& crossings, const int entryVertex);
|
||||
void addCheckedIncidence(std::vector<ReindeerMazePathIncidence>& incidences, const Point2 start,
|
||||
const Point2 direction);
|
||||
Point2 findStart() const;
|
||||
void addPathSegmentEdges(WeightedEdgeGraph& graph, const ReindeerMazePathIncidence& pathIncidence,
|
||||
const std::vector<ReindeerMazePathIncidence>& otherPathIncidences);
|
||||
std::pair<int, int> makePositionsIdPair(const Point2& position1, const Point2& position2);
|
||||
|
||||
@@ -32,6 +32,7 @@ class Lines
|
||||
bool isInBounds(const Point2& point) const;
|
||||
char getCharAt(const Point2& point) const;
|
||||
void setCharAt(const Point2& point, const char value);
|
||||
Point2 findChar(const char c) const;
|
||||
};
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const Lines& lines);
|
||||
|
||||
@@ -46,3 +46,9 @@ void LinesSolver<T1, T2>::setCharAt(const Point2& point, const char value)
|
||||
{
|
||||
lines.setCharAt(point, value);
|
||||
}
|
||||
|
||||
template <typename T1, typename T2>
|
||||
Point2 LinesSolver<T1, T2>::findChar(const char c) const
|
||||
{
|
||||
return lines.findChar(c);
|
||||
}
|
||||
|
||||
@@ -33,4 +33,5 @@ class LinesSolver
|
||||
bool isInBounds(const Point2& point) const;
|
||||
char getCharAt(const Point2& point) const;
|
||||
void setCharAt(const Point2& point, const char value);
|
||||
Point2 findChar(const char c) const;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user