#pragma region Hidden Setup Stuff #define OLC_PGE_APPLICATION #include "olcPixelGameEngine.h" using namespace olc; enum Run{ FILE1, FILE2 }; // Override base class with your custom functionality class AoC2023 : public olc::PixelGameEngine { std::vectorlines; bool waitForRender=false; void wait(int pauseMs=0){ waitForRender=true; while(waitForRender); std::this_thread::sleep_for(std::chrono::milliseconds(pauseMs)); } #pragma endregion const int DAY = 8; Run runInput=FILE2; std::map>nodes; std::string instructions; std::string currentNode="AAA"; int instructionIndex=0; void doStuff(){ while(true){ //lines is accessible as a global. bool firstLine=true; for(int lineNumb=0;std::string&line:lines){ if(lineNumb==0){ instructions=line; }else if(lineNumb>=2){ nodes[line.substr(0,3)]={line.substr(line.find('(')+1,3),line.substr(line.find(')')-3,3)}; } lineNumb++; } int step=0; while(currentNode!="ZZZ"){ char currentInstruction=instructions[instructionIndex]; if(currentInstruction=='R'){ currentNode=nodes[currentNode].second; }else{ currentNode=nodes[currentNode].first; } instructionIndex=(instructionIndex+1)%instructions.length(); step++; } std::cout<