Class: Mazinator::Cell
- Inherits:
-
Object
- Object
- Mazinator::Cell
- Defined in:
- lib/mazinator/cell.rb
Instance Attribute Summary collapse
-
#col ⇒ Object
readonly
Returns the value of attribute col.
-
#row ⇒ Object
readonly
Returns the value of attribute row.
-
#visited ⇒ Object
Returns the value of attribute visited.
-
#walls ⇒ Object
Returns the value of attribute walls.
Instance Method Summary collapse
-
#initialize(row, col) ⇒ Cell
constructor
A new instance of Cell.
- #visited? ⇒ Boolean
Constructor Details
#initialize(row, col) ⇒ Cell
Returns a new instance of Cell.
8 9 10 11 12 13 |
# File 'lib/mazinator/cell.rb', line 8 def initialize(row, col) @row = row @col = col @walls = {left: true, right: true, up: true, down: true} @visited = false end |
Instance Attribute Details
#col ⇒ Object (readonly)
Returns the value of attribute col.
6 7 8 |
# File 'lib/mazinator/cell.rb', line 6 def col @col end |
#row ⇒ Object (readonly)
Returns the value of attribute row.
6 7 8 |
# File 'lib/mazinator/cell.rb', line 6 def row @row end |
#visited ⇒ Object
Returns the value of attribute visited.
5 6 7 |
# File 'lib/mazinator/cell.rb', line 5 def visited @visited end |
#walls ⇒ Object
Returns the value of attribute walls.
5 6 7 |
# File 'lib/mazinator/cell.rb', line 5 def walls @walls end |
Instance Method Details
#visited? ⇒ Boolean
15 16 17 |
# File 'lib/mazinator/cell.rb', line 15 def visited? self.visited end |