Palindrome detection: Difference between revisions

(PascalABC.NET)
Line 3,259:
 
=={{header|langur}}==
<syntaxhighlight lang="langur">val .ispal = fn .s: len(.s) > 0 and .s == reverse .s
val ispal = fn s:len(s) > 0 and s == reverse(s)
 
val .tests = {
"": false,
"z": true,
Line 3,278 ⟶ 3,279:
}
 
for .word in sort(keys .(tests)) {
val .foundpal = .ispal(.word)
writeln .word, ": ", .foundpal, if(.foundpal == .tests[.word]: ""; " (FAILED TEST)")
}
}</syntaxhighlight>
 
{{out}}
1,007

edits