@@ -15,27 +15,8 @@ struct Vec2 {
15
15
Vec2<T> operator +(const Vec2<T> &rhs) const {
16
16
return {x + rhs.x , y + rhs.y };
17
17
}
18
-
19
- Vec2<T> operator -(const Vec2<T> &rhs) const {
20
- return {x - rhs.x , y - rhs.y };
21
- }
22
-
23
- void operator +=(const Vec2<T> &rhs) {
24
- x += rhs.x ;
25
- y += rhs.y ;
26
- }
27
-
28
- void operator -=(const Vec2<T> &rhs) {
29
- x -= rhs.x ;
30
- y -= rhs.y ;
31
- }
32
18
};
33
19
34
- template <typename T>
35
- std::ostream &operator <<(std::ostream &os, Vec2<T> vec) {
36
- return os << vec.x << " , " << vec.y ;
37
- }
38
-
39
20
template <typename T>
40
21
struct std ::hash<Vec2<T>> {
41
22
std::size_t operator ()(const Vec2<T> &vec) const {
@@ -59,10 +40,6 @@ Vec2<int> inst_dir(Inst inst) {
59
40
}
60
41
}
61
42
62
- std::ostream &operator <<(std::ostream &os, Inst inst) {
63
- return os << char (inst);
64
- }
65
-
66
43
struct Board {
67
44
std::vector<std::string> rows;
68
45
Vec2<int > robot = {-1 , -1 };
@@ -165,20 +142,6 @@ struct Board {
165
142
}
166
143
};
167
144
168
- std::ostream &operator <<(std::ostream &os, const Board &board) {
169
- for (int y = 0 ; y < board.height (); y++) {
170
- for (int x = 0 ; x < board.width (); x++) {
171
- if (board.robot == Vec2<int >({x, y})) {
172
- os << ' @' ;
173
- } else {
174
- os << board[{x, y}];
175
- }
176
- }
177
- os << std::endl;
178
- }
179
- return os;
180
- }
181
-
182
145
struct State {
183
146
Board board1;
184
147
Board board2;
0 commit comments