Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Palindrome-detection/Potion/palindrome-detection.potion
Normal file
11
Task/Palindrome-detection/Potion/palindrome-detection.potion
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# 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))
|
||||
Loading…
Add table
Add a link
Reference in a new issue