Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. public class Ships extends Board {
  2. private int count = 0;
  3.  
  4. public Ships(int rows,int cols) {
  5. super(rows, cols);
  6. }
  7.  
  8. public void set(int row, int col) {
  9. super.set(row, col, 1);
  10. count++;
  11. }
  12.  
  13. public int getCount() {
  14. return count;
  15. }
  16.  
  17. public boolean check(int row, int col) {
  18. return super.getValue(row,col) == 1;
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement