Requirement – forward and backward moves

Now that we know where our ship is, let's try to move it. To begin with, we should be able to go both forwards and backwards.


Implement commands that move the ship forwards and backwards (f and b).

The Location helper class already has the forward and backward methods that implement this functionality:

public boolean forward() {
  ...
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.137.67