Class: Amaze::Algorithm
- Inherits:
-
Object
- Object
- Amaze::Algorithm
- Defined in:
- lib/amaze/algorithm.rb
Direct Known Subclasses
AldousBorder, BinaryTree, GrowingTree, HuntAndKill, RecursiveBacktracker, Sidewinder, Wilson
Defined Under Namespace
Classes: AldousBorder, BinaryTree, GrowingTree, HuntAndKill, RecursiveBacktracker, Sidewinder, Stat, Wilson
Instance Attribute Summary collapse
-
#duration ⇒ Object
readonly
The time the algorithm takes to generate the maze.
Instance Method Summary collapse
Instance Attribute Details
#duration ⇒ Object (readonly)
The time the algorithm takes to generate the maze
22 23 24 |
# File 'lib/amaze/algorithm.rb', line 22 def duration @duration end |
Instance Method Details
#on(grid) ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/amaze/algorithm.rb', line 24 def on grid @duration = Benchmark.realtime do work grid do |stat| yield stat if block_given? end end grid end |
#speed ⇒ Object
33 34 35 |
# File 'lib/amaze/algorithm.rb', line 33 def speed 0.06 end |