code:This tells me the total number of permutations which I think would be useful for a loop.int Facts ( int n )
{
if ( n == 0 )
return 1;
else
return n * Facts( n - 1 );
}
quote:*swoons*
That makes me think of something interesting. It would be possible to do some really cool template generation to make permutation generation (up to any arbitrary length of string) extremely fast -- after all, you can think about any string as having an ordering, and then to generate permutations all you need are the permutations of the ordering, which can be easily pregenerated with templates; then its just a matter of sticking a string in what's essentially a completely unrolled permutation loop and getting the results.