TTT Hanoi etc in JS