Class: Hanoi::Jane::ConstrainedTowers
- Extended by:
- ConstrainedStackFinder
- Defined in:
- lib/hanoi/jane/towers/constrained_towers.rb
Instance Attribute Summary
Attributes inherited from Towers
#base, #disc, #discs, #from, #stacks, #to, #total
Instance Method Summary collapse
-
#initialize(discs = 3) ⇒ ConstrainedTowers
constructor
A new instance of ConstrainedTowers.
- #inspect ⇒ Object
- #ternary ⇒ Object
Methods included from ConstrainedStackFinder
Methods inherited from Towers
#binary, #each, #move, #rebased, #solved, #to_s
Methods included from StackFinder
Constructor Details
#initialize(discs = 3) ⇒ ConstrainedTowers
Returns a new instance of ConstrainedTowers.
6 7 8 9 |
# File 'lib/hanoi/jane/towers/constrained_towers.rb', line 6 def initialize discs = 3 super @base = 3 end |
Instance Method Details
#inspect ⇒ Object
15 16 17 18 19 |
# File 'lib/hanoi/jane/towers/constrained_towers.rb', line 15 def inspect i = super i[:ternary] = i.delete :binary i end |
#ternary ⇒ Object
11 12 13 |
# File 'lib/hanoi/jane/towers/constrained_towers.rb', line 11 def ternary rebased end |