day 9 wip

This commit is contained in:
grant 2022-12-09 22:52:50 -06:00
parent 3d71bc9700
commit f035d91781
2 changed files with 24 additions and 15 deletions

View File

@ -2,28 +2,31 @@
#include <vector>
#include <string>
#include <algorithm>
struct move{
char move;
int distance;
};
struct grid{
std::vector<std::vector<char>> grid;
std::vector<std::vector<char>> t_visited;
int x;
int y;
};
int main(int argc, char* argv[]){
std::cout<<"paste input followed by a ;\n";
std::vector<std::vector<char>> grid = {{'B'}}; // B means both are in the same spot
grid grid = {{{'H'}},{{'X'}},0,0}; // B means both are in the same spot
std::string line;
std::vector<move> moves;
while(getline(std::cin, line)){
if(line==";")
break;
if(line[0]=='U'){
for(int i = 0; i!=line[2]-'0';i++){
if(grid.size()-1<=i){
grid.push_back({});
}
grid[i][grid[i].size()]='T';
}
}
moves.push_back({line[0],line[2]-'0'});
}
for(std::vector<char> g : grid){
for(char c : g){
std::cout<<c<<" ";
}
std::cout<<std::endl;
for(move i : moves){
}
return 0;
}

View File

@ -25,4 +25,10 @@ y22-d6:
g++ -o ./2022/day-6 ./2022/day-6.cpp && ./2022/day-6
#2022 day 7 ~ both parts
y22-d7:
g++ -o ./2022/day-7 ./2022/day-7.cpp && ./2022/day-7
g++ -o ./2022/day-7 ./2022/day-7.cpp && ./2022/day-7
#2022 day 8 ~ both parts
y22-d8:
g++ -o ./2022/day-8 ./2022/day-8.cpp && ./2022/day-8
#2022 day 7 ~ both parts
y22-d9:
g++ -o ./2022/day-9 ./2022/day-9.cpp && ./2022/day-9