Initial solution idea to the StoneWall problem in C++