Palindrome detection: Difference between revisions

Added Wren
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
(Added Wren)
Line 4,459:
}</lang>
Returns: <pre>[true false true]</pre>
 
=={{header|Wren}}==
<lang javascript>var isPal = Fn.new { |word|
var chars = word.toList
var rword = ""
for (i in chars.count..1) {
rword = rword + chars[i-1]
}
return word == rword
}
 
System.print("Are the following palindromes?")
for (word in ["rotor", "rosetta", "step on no pets", "été", "wren", "🦊😀🦊"]) {
System.print(" %(word) => %(isPal.call(word))")
}</lang>
 
{{out}}
<pre>
Are the following palindromes?
rotor => true
rosetta => false
step on no pets => true
été => true
wren => false
🦊😀🦊 => true
</pre>
 
=={{header|X86 Assembly}}==
9,490

edits