Permutations by 51b

void f(char[]a,char[]b){a>""||printf("%*s
",b[1..$]);foreach(i,c;a)f(a[0..i]~a[i+1..$],b~" "~c);}void main(){f("012345","");}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page