Skip to content

Instantly share code, notes, and snippets.

@ignaciomosca
Created November 25, 2019 22:14
Show Gist options
  • Save ignaciomosca/f8b6634601ad2759865a858186605438 to your computer and use it in GitHub Desktop.
Save ignaciomosca/f8b6634601ad2759865a858186605438 to your computer and use it in GitHub Desktop.
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