Created
November 25, 2019 22:14
-
-
Save ignaciomosca/f8b6634601ad2759865a858186605438 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Bishop extends ChessPiece { | |
public boolean attacks(ChessPiece dest) { | |
return Math.abs(dest.getRow() - this.getRow()) == Math.abs(dest.getCol() - this.getCol()); | |
} | |
@Override | |
public char piece() { | |
return 'B'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment