Anadromes: Difference between revisions

Content added Content deleted
m (→‎{{header|AppleScript}}: Minor optimisation.)
Line 169: Line 169:
end repeat
end repeat
-- Identify and keep words that are in both the original and reversed groups. It turns out this is achieved
-- Identify and sort words that are in both the original and reversed groups.
-- most quickly using NSSets, a filter, and a sort, rather than arrays, NSOrdered sets, or set intersection.
set wordSet to |⌘|'s class "NSMutableSet"'s setWithArray:(wordArray)
set wordSet to |⌘|'s class "NSMutableSet"'s setWithArray:(wordArray)
set reversedWordSet to |⌘|'s class "NSSet"'s setWithArray:(o's wordList)
set reversedWordSet to |⌘|'s class "NSSet"'s setWithArray:(o's wordList)