Practicing OOP concepts in Java
Prepare pieces for chess game. All the pieces should have the following two methods:
-boolean canMoveTo(int x, int y)which will be checking if this piece can move to the given coordinates
-moveTo(int x, int y)that can move the piece only if it is legal
Place all the pieces on the board and start a two-player game. Each player enters two sets of coordinates of the piece they want to move – origin and destination. The game must check if there is a piece present and if it can move to the requested coordinates. If successful, the piece is moved, and the updated board is presented.
(No need to implement checkmates and checks)
Proper use of OOP principles is required – encapsulation, inheritance and polymorphism.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here