RosettaCodeData/Task/Palindrome-detection/Potion/palindrome-detection.potion
2016-12-05 23:44:36 +01:00

11 lines
232 B
Text

# The readable recursive version
palindrome_i = (s, b, e):
if (e <= b): true.
elsif (s ord(b) != s ord(e)): false.
else: palindrome_i(s, b+1, e-1).
.
palindrome = (s):
palindrome_i(s, 0, s length - 1).
palindrome(argv(1))