|
|
@ -21,7 +21,7 @@ int main() |
|
|
|
std::vector<std::vector<char>>map; |
|
|
|
std::vector<std::vector<char>>map; |
|
|
|
std::vector<Instruction>instructions; |
|
|
|
std::vector<Instruction>instructions; |
|
|
|
std::vector<vi2d>visitedLocs; |
|
|
|
std::vector<vi2d>visitedLocs; |
|
|
|
std::ifstream file("testinput"); |
|
|
|
std::ifstream file("input"); |
|
|
|
while (file.good()){ |
|
|
|
while (file.good()){ |
|
|
|
std::string line; |
|
|
|
std::string line; |
|
|
|
std::getline(file,line); |
|
|
|
std::getline(file,line); |
|
|
@ -130,7 +130,6 @@ int main() |
|
|
|
if (pos.x-1<0||map[pos.y][pos.x-1]==' '){ |
|
|
|
if (pos.x-1<0||map[pos.y][pos.x-1]==' '){ |
|
|
|
if (map[pos.y][map[pos.y].size()-1]=='.'){ |
|
|
|
if (map[pos.y][map[pos.y].size()-1]=='.'){ |
|
|
|
targetPos.x=map[pos.y].size()-1; |
|
|
|
targetPos.x=map[pos.y].size()-1; |
|
|
|
break; |
|
|
|
|
|
|
|
} else
|
|
|
|
} else
|
|
|
|
if (map[pos.y][map[pos.y].size()-1]=='#'){ |
|
|
|
if (map[pos.y][map[pos.y].size()-1]=='#'){ |
|
|
|
//It's a dead end so we can't move. Go next.
|
|
|
|
//It's a dead end so we can't move. Go next.
|
|
|
|