Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Palindrome Program


Reply
 
Thread Tools Display Modes
  #1  
Old 10-31-2002, 10:06 PM
Damatrix
Guest
 
Posts: n/a
Default Palindrome Program


hi is there anyways to create a palindrome program

eg.

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
Reply With Quote
  #2  
Old 10-31-2002, 10:18 PM
AutoCOL's Avatar
AutoCOL AutoCOL is offline
Centurion
 
Join Date: Sep 2002
Location: australia
Posts: 155
Default

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...

HTH.

Col.
__________________
the conscious part of the brain...
is the bit that's soluble in alcohol.
Reply With Quote
  #3  
Old 10-31-2002, 10:21 PM
Robby's Avatar
Robby Robby is offline
Code Factory

Retired Moderator
* Expert *
 
Join Date: Jan 2001
Location: Montreal, Ca.
Posts: 5,565
Default

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...
http://www.xtremevbtalk.com/show...ght=palindrome
__________________
Visit...Bassic Software
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->