Great! Implementing the right turn was a piece of cake, so now let's try something slightly more complicated: moving forward.
Remember that a robot can only move forward in the direction it is facing. If the new field is occupied by the opponent or is outside the game board, nothing should happen.
To make things easier, we'll create four helper functions before creating the actual
move_forward() function. These functions will do the following:
- Get the robot's current position.
- Get the robot's new position.
- Check if the new position is empty.
- Check if the new position is within the board's borders.