Permutations by D

procedure Gnat.Spitbol.Patterns.P Is
procedure F(R,T:String)is begin
if R=""then Put_Line(T(1)&" "&T(2)&" "&T(3)&" "&T(4)&" "&T(5)&" "&T(6));End if;for I in R'Range loop
F(S(Delete(V(R),I,I)),T&R(i));end loop;end;begin
F("012345","");end;

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

download

return to the top page