TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Forum View

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

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

Print Reply
"Kester, Rush W." <[log in to unmask]>
Reply To:
Kester, Rush W.
Wed, 19 Apr 2000 09:31:37 -0400
text/plain (41 lines)
Hint: Check into the string attributes 'first and 'last, you also may find
substrings helpful.

-----Original Message-----
From: Glenn Booker [mailto:[log in to unmask]]
Sent: Wednesday, April 19, 2000 4:52 AM
To: [log in to unmask]
Subject: Re: [Off topic] palindromes

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"