Module: Stones::WithHead
- Included in:
- Board
- Defined in:
- lib/stones/board/with_head.rb
Instance Method Summary collapse
Instance Method Details
#can_move?(direction) ⇒ Boolean
3 4 5 |
# File 'lib/stones/board/with_head.rb', line 3 def can_move?(direction) within_bounds? next_position(direction) end |
#move!(direction) ⇒ Object
7 8 9 |
# File 'lib/stones/board/with_head.rb', line 7 def move!(direction) move_to! next_position(direction) end |
#move_to_edge!(direction) ⇒ Object
11 12 13 |
# File 'lib/stones/board/with_head.rb', line 11 def move_to_edge!(direction) move!(direction) while can_move?(direction) end |