Skip to content

jcasimir/hanoi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Towers of Hanoi Simulator

  • Clone
  • Bundle
  • Run the specs: bundle exec rspec spec

Manual Usage

require './hanoi'

a     = Tower.new("A")
b     = Tower.new("B")
c     = Tower.new("C")
one   = Disc.new(1)
two   = Disc.new(2)
three = Disc.new(3)
four  = Disc.new(4)

[four, three, two, one].each do |disc|
  a.stack(disc)
end

Mover.move_from_a_to_b_via_c(a.size, a, c, b)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages