towers of hanoi in javascript