Palindrome detection: Difference between revisions

m
No edit summary
Line 5,388:
=={{header|Run BASIC}}==
<syntaxhighlight lang="runbasic">data "My dog has fleas", "Madam, I'm Adam.", "1 on 1", "In girum imus nocte et consumimur igni"
 
for i = 1 to 4
read w$
print w$;" is ";isPalindrome$(w$);" Palindrome"
next
 
FUNCTIONfunction isPalindrome$(str$)
for i = 1 to len(str$)
a$ = upper$(mid$(str$,i,1))
if (a$ >= "A" and a$ <= "Z") or (a$ >= "0" and a$ <= "9") then b$ = b$ + a$: c$ = a$ + c$
next i
if b$ <> c$ then isPalindrome$ = "not"</syntaxhighlight>
end function</syntaxhighlight>
{{out}}
<pre>My dog has fleas is not Palindrome
2,122

edits