Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 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