Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Ships extends Board {
- private int count = 0;
- public Ships(int rows,int cols) {
- super(rows, cols);
- }
- public void set(int row, int col) {
- super.set(row, col, 1);
- count++;
- }
- public int getCount() {
- return count;
- }
- public boolean check(int row, int col) {
- return super.getValue(row,col) == 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement