Skip to content

Latest commit

 

History

History

1-Points

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Points

Implement a class in Ruby, called InfinitePlane which is going to simulate a 2D coordinate system.

The class should take x and y position of a point in that plane:

plane = InfinitePlane.new 0, 0

Using this class, make a method called move_to_directions(directions), which solves the 1st problem from here

Here is an example:

>> plane = InfinitePlane.new 0, 0
>> plane.move_to_directions '>>><<<~>>>~^^^'
>> puts plane.to_array
[-3, -3]

Use each whenever necessary!