Task 3: Implement the act() method for chess class
The goal is to move the chess piece is a zig-zag manner as shown
below[Disallowed URL]
Implement the act() method of the Chess class to support a zig-zag movement of the chess piece
I have no idea how to do it. There's a hint but to me it didn't help:
Hints:
· Add one instance variable to keep track of the current movement (e.g. private boolean isMovingUp) to the class
· Think about the the followings, and use if-statements to check for the conditions, update the instance variable when needed
1. When we should move up?
2. When we should move down?
3. When we should move to the right?
4. When we should stop?