in reply to Finding longest palindrome from a string
|
UPDATE: There may be a minor bug in my use of POSIX, however I may be able to get round this as substr() automagically rounds down fractional values which are passed to it.
UPDATE^2: Fencepost error in ceil() function call fixed.
UPDATE^3: The reason why it fails is that the ordering can sometimes be wrong if there is more than one palindrome in the same string, due to the randomisation as the hash keys are fetched. I'll fix this at some point in the near future...
UPDATE^4: Issue fixed; Was in fact due to boneheadedness on my part. Now should work nicely, although not as pretty as it was.
UPDATE^5: Prettified a bit.
"Stercus! Dixit Pooh. Eeyore, missilis lux navigii heffalumporum iaculas. Piglet, mecum ad cellae migratae secundae concurras."
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Finding longest palindrome from a string
by cLive ;-) (Prior) on Aug 13, 2004 at 19:48 UTC | |
by BrowserUk (Patriarch) on Aug 13, 2004 at 21:38 UTC | |
by ccn (Vicar) on Aug 13, 2004 at 23:44 UTC |