Find words whose first and last three letters are equal: Difference between revisions

Content added Content deleted
(→‎{{header|Ruby}}: removed chomped temp array)
(Added AppleScript.)
Line 143: Line 143:
found 8 words with the same first and last 3 characters
found 8 words with the same first and last 3 characters
</pre>
</pre>

=={{header|AppleScript}}==
<syntaxhighlight lang="applescript">on task()
script o
property wrds : words of ¬
(read file ((path to desktop as text) & "www.rosettacode.org:unixdict.txt") as «class utf8»)
property output : {}
end script
repeat with thisWord in o's wrds
if ((thisWord's length > 5) and (thisWord ends with thisWord's text 1 thru 3)) then ¬
set end of o's output to thisWord
end repeat
return o's output's contents
end task

task()</syntaxhighlight>

{{output}}
<syntaxhighlight lang="applescript">{"antiperspirant", "calendrical", "einstein", "hotshot", "murmur", "oshkosh", "tartar", "testes"}</syntaxhighlight>


=={{header|Arturo}}==
=={{header|Arturo}}==