Fully working codes are developed in the given time frame for all the 3 levels.
Java
A static variable grid and 2 static maps are created.
Contains the 5X5 grid with empty positions as _
and filled position as mentioned in question paper,
grid is updated on every move made by any player.
Contains X and Y coordinate position of each pawn/hero in the game for each player. Used to reduce searching time to O(1).
- If anything apart from P or H is entered in the move, it wont be accepted.
- No move is executed if the ending position is out of bounds.
- We will not go to desitination if our own piece is present.