Advertisement
xFazz

OceanTest

Nov 7th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. public class OceanTester {
  2. public static void main(String[] args) {
  3. Ocean ocean = new Ocean(numberOfBoats: 5, oceanSize:10);
  4.  
  5. //create a position
  6. Position pos = new Position(row: -1, col:0);
  7.  
  8. try {
  9. ocean.placeBoat(boatName: "Aircraft Carrier", direction: "horizontal")
  10. System.out.println("Boat placed okay");
  11. } catch (Exception ex) {
  12. System.out.println("Test 1: " + pos + " " + ex.getMessage());
  13. }
  14.  
  15. }
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement