Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

New answers tagged

0

JavaScript (ES6), 45b h=(n,f,a,t)=>n?h(--n,f,t,a)+f+t+h(n,a,f,t):'' e.g. calling h(4, 'A', 'B', 'C') (move 4 discs from peg A to peg C using auxiliary peg B) returns 'ABACBCABCACBABACBCBACABCABACBC' (move a disc from peg A to peg B, move a disc from peg A to peg C, move a disc from peg B to peg C, etc.)


Top 50 recent answers are included