Module: Gobgems::Direction
- Included in:
- Program
- Defined in:
- lib/gobgems/direction.rb
Class Method Summary collapse
Class Method Details
.all ⇒ Object
19 20 21 |
# File 'lib/gobgems/direction.rb', line 19 def all [east, west, south, north] end |
.east ⇒ Object
3 4 5 |
# File 'lib/gobgems/direction.rb', line 3 def east @east ||= -> (x, y) { [x, y+1] } end |
.north ⇒ Object
11 12 13 |
# File 'lib/gobgems/direction.rb', line 11 def north @north ||= -> (x, y) { [x-1, y] } end |
.south ⇒ Object
15 16 17 |
# File 'lib/gobgems/direction.rb', line 15 def south @south ||= -> (x, y) { [x+1, y] } end |
.west ⇒ Object
7 8 9 |
# File 'lib/gobgems/direction.rb', line 7 def west @west ||= -> (x, y) { [x, y-1] } end |