10-31-2002, 10:06 PM
hi is there anyways to create a palindrome program
MOM is a palindrome
the eHt is also
howdy is not
you get what i mean???
hope so try your best i need it for my rpg
10-31-2002, 10:18 PM
well, i suppose a way to do it would be... find the length of the string that you're analysing using the Len function.
then, using the Left and Right functions, grab the first and last letter and compare them. if they're the same, use Left and Right again to compare the next two letters, etc, until you either have a mismatch, or there a no letters left.
if there's an odd number of letters you obviously don't have to analyse the central letter.
here's a big one for ya -
A MAN, A PLAN, A CANAL - PANAMA!
if you wanted your program to analyse that, you would obviously have to have it remove the spaces and punctuation...
10-31-2002, 10:21 PM
With a simple search, you would've found the fastest palindrome algorithms in the world, YES the world. Here are some of our contest winners...