learning ruby and solving hanoi tower