Palindrome in Camelia
{module} palindrome
{fun} str | palindrome
true | p
len:str | l
{from} 0 | i to l/2 - 1 by 1
{if} str[i] != str[l - i - 1]
false | p
break
{/if}
{/from}
return p
{/fun}
{main}
'it is ' | out
in | string | palindrome | out
' that word ' string ' is palindrome' | out
{/main}
{/module}
Comments
Post a Comment