Find an algorithm (subroutine) that when called repeatedly with the same character-string variable that is initialized with n characters, all different, will cycle through all the permutations of those n characters, so that for example, when called 24 times with a string of length 4, will have cycled that string through all 24 permutations and returned it to its initial state.
(In reply to
re: two ways by friedlinguini)
the first code i posted does yield one permutation per call, the list return is composed of characters (or whatever..)
on the other hand i assumed the call was made with the same string each time.. hmm