Class: Maze::Formatter::Ascii::Orthogonal
- Inherits:
-
Object
- Object
- Maze::Formatter::Ascii::Orthogonal
- Includes:
- Maze::Formatter::Ascii
- Defined in:
- lib/maze/formatters/ascii/orthogonal.rb
Instance Attribute Summary collapse
-
#canvas ⇒ Object
readonly
Returns the value of attribute canvas.
-
#maze ⇒ Object
readonly
Returns the value of attribute maze.
Instance Method Summary collapse
-
#initialize(maze) ⇒ Orthogonal
constructor
A new instance of Orthogonal.
Methods included from Maze::Formatter::Ascii
#canvas_draw, #canvas_update, #to_s
Constructor Details
#initialize(maze) ⇒ Orthogonal
Returns a new instance of Orthogonal.
12 13 14 15 16 17 18 19 |
# File 'lib/maze/formatters/ascii/orthogonal.rb', line 12 def initialize(maze) @maze = maze @canvas = Array.new(maze.height + 1) do Array.new(maze.width * 2, ' ') end canvas_draw end |
Instance Attribute Details
#canvas ⇒ Object (readonly)
Returns the value of attribute canvas.
8 9 10 |
# File 'lib/maze/formatters/ascii/orthogonal.rb', line 8 def canvas @canvas end |
#maze ⇒ Object (readonly)
Returns the value of attribute maze.
8 9 10 |
# File 'lib/maze/formatters/ascii/orthogonal.rb', line 8 def maze @maze end |