Adds new scenarios to place ships feature

Adds the ship out of board scenario where the ship may be placed with a
good anchor position but the orientation choosen may throw the rest of
the ship to an out of board sector.
Adds the ship overlapping another ship scenario where the ship may be
positioned on a sector that already contains a ship and so overlapping
it.

Signed-off-by: João Soares <jsoaresgeral@gmail.com>
Adds ship position verification upon placement

Verifies if a ship is being placed out of the board or on top of
another already placed ship and generates propper exceptions and
error in order to provide feedback.

Signed-off-by: João Soares <jsoaresgeral@gmail.com>
Adds a feature step which is already passing

Adds a new feature step to verify propper ship overlapping detection.

Signed-off-by: João Soares <jsoaresgeral@gmail.com>
Extracts exceptions into its own file

Exceptions for argument errors and invalid types are now in its own
file and context of each exception is now generated by the exception
initialize method removing some code from the methods where they are
raised.

Signed-off-by: João Soares <jsoaresgeral@gmail.com>
Adds OverlapShipError to split InvalidShipError

InvalidShipError is no longer used to raise an error when a ship is
positioned on top of an already positioned ship, instead the new
OverlapShipError is used.

Signed-off-by: João Soares <jsoaresgeral@gmail.com>
Renames Board to Grid

Signed-off-by: João Soares <jsoaresgeral@gmail.com>
Minor semantic adjustments on the exceptions

Changes some exception names and descriptions to better match the
seriousness of the exception or error and to provide better feedback
to api users and the player.

Signed-off-by: João Soares <jsoaresgeral@gmail.com>
Reordered Sector methods alphabetically

Signed-off-by: João Soares <jsoaresgeral@gmail.com>
Replaces is_a? by kind_of? to improve readability

Signed-off-by: João Soares <jsoaresgeral@gmail.com>
Improved code readability

Signed-off-by: João Soares <jsoaresgeral@gmail.com>
Removed Player#place support for position arrays

Player#place no longer supports passing a position array, this was an
undocumented feature and now it has been removed.
The return value of Grid#parse_pos and Grid#format_pos is still valid
but it now needs a splat operator in order to flat the array into its
propper arguments.

Signed-off-by: João Soares <jsoaresgeral@gmail.com>
Player#place now accepts ranges for row or col

Player#place method now accepts a range col or a range row as an
alternative to the orientation.

Signed-off-by: João Soares <jsoaresgeral@gmail.com>
Grid#col_to_idx no longer accepts array argument

The former boolean array argument of Grid#col_to_idx is no longer valid
since it makes no sense to get non array indices with array false.
The exception raised when an invalid column argument is passed was also
renamed from InvalidColumnArgument to InvalidColArgument to provide a
shorter name.

Signed-off-by: João Soares <jsoaresgeral@gmail.com>
Rename exception to InvalidOri(-entation)Argument

Renames InvalidOrientationArgument exception to InvalidOriArgument

Signed-off-by: João Soares <jsoaresgeral@gmail.com>
Corrected specification outdated description

Signed-off-by: João Soares <jsoaresgeral@gmail.com>
Grid#position_valid? no longer accepts ori arg

Positions should, from now on, be rangified before being verified by
Grid#position_valid?
Grid#add! now accepts range columns or rows without an orientation
argument, and when an orientation is passed it first rangifies that
position before checking its valid status.

Signed-off-by: João Soares <jsoaresgeral@gmail.com>
Grid#row_to_idx no longer publicly accepts Fixnum

The method still detects Fixnum arguments but for recursive calls only,
it no longer supports conversion of Fixnum rows to index values, so
unexpected results may be returned if used this way.

Signed-off-by: João Soares <jsoaresgeral@gmail.com>
Refactors Grid#add!

Huge improvement to the Grid#add! method but still needs some work.

Signed-off-by: João Soares <jsoaresgeral@gmail.com>
Grid#row no longer aliases Grid#[]

Grid#row now has its own implementation and is no longer a synonym of
Grid#[].

Signed-off-by: João Soares <jsoaresgeral@gmail.com>
Rewrites a spec test using new API functionality

Signed-off-by: João Soares <jsoaresgeral@gmail.com>