Steve Graham wrote:
Steve,

   Thanks for the feedback.  You were right:  I did need the permutations.

   2 questions:
1) What does the '1+:' accomplish in
else s[j := 1 to *s] || permute(s[1+:j-1]||s[j+1:0], i-1)

2) What does the '--' accomplish in
else (c := !s) || permute(s--c, i-1)

Hi Steve,

  (1) the '+:' string subscript syntax is a measure of distance
      instead of absolute position.  i:j is everything from
      position i to position j, while i+:j is the next j characters
      beginning at position i.  in this case, it's probably not needed,
      it's just what I first thought of.

  (2) the '--' is cset minus s--c is the cset s with the characters
      in cset c (in this case a single character) removed.  So it's used
      here to remove the single character used on the left of the
      concatenation from consideration in the recursive call building
      up the right.  (That's logically the same operation that the
      s[i+:j-1] || s[j+1:0] is doing in the earlier version.)

Hope that helps!

-Steve
--
Steve Wampler     [EMAIL PROTECTED]
The gods that smiled upon your birth are laughing now. -- fortune cookie


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Unicon-group mailing list
Unicon-group@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/unicon-group

Reply via email to