Very nice, just be aware that it only works if there are no duplicate elements in the list. That is: show compare [a b b c] [b a a c] paspal wrote: > > Hi, > Here is my solution for permutated lists: > > ;---------------------------------- > to comp :list1 :list2 > if emptyp :list1 [op "true] > ifelse memberp (first :list1) :list2 ~ > [op comp butfirst :list1 :list2] ~ > [op "false] > end > > to compare :list1 :list2 > ifelse equalp (count :list1) (count :list2) ~ > [op comp :list1 :list2] ~ > [op "false] > end > ;------------------------------------ > try this: > show compare [a b c] [b a c] > and then > show compar [a [b] c] [[b] a c] > > Paspal > paspal@mail.bielnet.it > > --------------------------------------------------------------- > Please post messages to the Logo forum to logo-l@gsn.org. Mail > questions about the list administration to logofdn@gsn.org. To > unsubscribe send unsubscribe logo-l to majordomo@gsn.org. -- =============================================================== George Mills (mills@softronix.com) http://www.softronix.com/ The www page contains some very powerful educational software. Our single most important investment is our kids. --------------------------------------------------------------- Please post messages to the Logo forum to logo-l@gsn.org. Mail questions about the list administration to logofdn@gsn.org. To unsubscribe send unsubscribe logo-l to majordomo@gsn.org.
Global SchoolNet Foundation -
Linking Kids Around the World!
Copyright GSN - All Rights Reserved
- Comments
& Questions
Visit GSN's
Global
Schoolhouse for more exciting learning resources!
Search our Site
-
Home