Answer:
//size indicated the rows.. assuming 5 cols. as the game has5*5grids
class Gameworld {
int gamestate [5][5 ];
public:
Gameworld(){};
.
.
.
}
Write all the function .For defining functions use gamestate array for every user input and store the game state in each cell.
You can use hard coding for moving up down in 5*5 grid.
Mapping keyboard keys will require event for each key press event and addfunctionality to move up down right left