/ nick nickolov's correction: move:{[n;a;b;c]:[1=n;,a,c;,/_f .'((n-1;a;c;b);(1;a;b;c);(n-1;b;a;c))]} \ move[4;1;3;2] (1 3 1 2 3 2 1 3 2 1 2 3 1 3 1 2 3 2 3 1 2 1 3 2 1 3 1 2 3 2) \ http://www.kernelthread.com/hanoi/src/hanoimania/hanoi.k / The Towers Of Hanoi / K / Copyright (C) 2003 Amit Singh. All Rights Reserved. / http://hanoi.kernelthread.com / / Last tested under K 2.95t / http://www.kx.com / / Usage: / % k hanoi.k / ... Copyright messages ... / hanoi[3] H:{:[x>0;H[x-1;y;6-(y+z)],y,z,0,H[x-1;6-(y+z);z];()]} hanoi:{:[x>0;H[x;1;3]]}