TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Glenn Booker <[log in to unmask]>
Wed, 19 Apr 2000 07:51:56 -0400
text/plain (25 lines)
That's correct.  An example is "Madam, I'm Adam."  If you ignore the spaces and punctuation, that becomes MADAMIMADAM, which is the same sequence of letters either forward or backward.  Notice that the "I" is the middle of the string, and doesn't have to match any other letters.  If a string has an even number of letters, then the two middle letters much match for it to be a palindrome.

Glenn Booker

---------- Original Message ----------------------------------
From: Jacob Sparre Andersen <[log in to unmask]>
Reply-To: Jacob Sparre Andersen <[log in to unmask]>
Date:         Wed, 19 Apr 2000 12:31:02 +0200

>Colin Brown:
>> question, write an ada program using recursion to find out if the text
>> entered is a palindrome. I sort of understand how recursion works, I
>Is a palindrome a word where the first and the last letter
>is the same, the second and the second to last letter is the
>same, and so on?
>"Sleep is just a cheap substitute for coffee"