feat(snake.hpp): adding a member argument for move history
This commit is contained in:
@@ -8,8 +8,10 @@
|
|||||||
struct Point {
|
struct Point {
|
||||||
int m_row;
|
int m_row;
|
||||||
int m_col;
|
int m_col;
|
||||||
|
int m_direction;
|
||||||
Point() {}
|
Point() {}
|
||||||
Point(int x, int y) : m_row(x), m_col(y) {}
|
Point(int x, int y) : m_row(x), m_col(y) {}
|
||||||
|
Point(int x, int y, int dir) : m_row(x), m_col(y), m_direction(dir) {}
|
||||||
|
|
||||||
std::string to_string() const;
|
std::string to_string() const;
|
||||||
void clear(std::array<std::array<char, COL>, ROW> &arr) const;
|
void clear(std::array<std::array<char, COL>, ROW> &arr) const;
|
||||||
|
|||||||
+1
-1
@@ -37,7 +37,7 @@ struct Head {
|
|||||||
|
|
||||||
struct Tail {
|
struct Tail {
|
||||||
Point m_tail_pos;
|
Point m_tail_pos;
|
||||||
|
std::vector<Point> m_move_history;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user