World Longest Palindrome

  • Thread starter Amar Prakash Tripaithi
  • Start date
A

Amar Prakash Tripaithi

Dan Hoey, who had recently graduated, wrote a C program to look for and
construct the following beauty:

A man, a plan, a caret, a ban, a myriad, a sum, a lac, a liar, a hoop,
a pint, a catalpa, a gas, an oil, a bird, a yell, a vat, a caw, a pax,
a wag, a tax, a nay, a ram, a cap, a yam, a gay, a tsar, a wall, a car,
a luger, a ward, a bin, a woman, a vassal, a wolf, a tuna, a nit, a
pall, a fret, a watt, a bay, a daub, a tan, a cab, a datum, a gall, a
hat, a fag, a zap, a say, a jaw, a lay, a wet, a gallop, a tug, a trot,
a trap, a tram, a torr, a caper, a top, a tonk, a toll, a ball, a fair,
a sax, a minim, a tenor, a bass, a passer, a capital, a rut, an amen, a
ted, a cabal, a tang, a sun, an ass, a maw, a sag, a jam, a dam, a sub,
a salt, an axon, a sail, an ad, a wadi, a radian, a room, a rood, a
rip, a tad, a pariah, a revel, a reel, a reed, a pool, a plug, a pin, a
peek, a parabola, a dog, a pat, a cud, a nu, a fan, a pal, a rum, a
nod, an eta, a lag, an eel, a batik, a mug, a mot, a nap, a maxim, a
mood, a leek, a grub, a gob, a gel, a drab, a citadel, a total, a
cedar, a tap, a gag, a rat, a manor, a bar, a gal, a cola, a pap, a
yaw, a tab, a raj, a gab, a nag, a pagan, a bag, a jar, a bat, a way, a
papa, a local, a gar, a baron, a mat, a rag, a gap, a tar, a decal, a
tot, a led, a tic, a bard, a leg, a bog, a burg, a keel, a doom, a mix,
a map, an atom, a gum, a kit, a baleen, a gala, a ten, a don, a mural,
a pan, a faun, a ducat, a pagoda, a lob, a rap, a keep, a nip, a gulp,
a loop, a deer, a leer, a lever, a hair, a pad, a tapir, a door, a
moor, an aid, a raid, a wad, an alias, an ox, an atlas, a bus, a madam,
a jag, a saw, a mass, an anus, a gnat, a lab, a cadet, an em, a
natural, a tip, a caress, a pass, a baronet, a minimax, a sari, a fall,
a ballot, a knot, a pot, a rep, a carrot, a mart, a part, a tort, a
gut, a poll, a gateway, a law, a jay, a sap, a zag, a fat, a hall, a
gamut, a dab, a can, a tabu, a day, a batt, a waterfall, a patina, a
nut, a flow, a lass, a van, a mow, a nib, a draw, a regular, a call, a
war, a stay, a gam, a yap, a cam, a ray, an ax, a tag, a wax, a paw, a
cat, a valley, a drib, a lion, a saga, a plat, a catnip, a pooh, a
rail, a calamus, a dairyman, a bater, a canal-Panama.
 
S

Skarmander

Amar said:
Dan Hoey, who had recently graduated, wrote a C program to look for and
construct the following beauty:
<snip>

While I'm sure that those who have never heard of it will enjoy it:

- just because the program was written in C doesn't make it relevant to
this newsgroup;
- the palindrome quoted was generated in 1984, being news 11 years ago;
- this is not "the world's longest palindrome" by a long shot:
http://www.norvig.com/palindrome-a.html;
- the very concept of "the world's longest palindrome" is dubious, since
palindromes exist that can be extended indefinitely -- additional
restrictions have to be introduced to make it interesting again.

Killjoy, ain't I?

S.
 
S

Skarmander

Skarmander wrote:
- the palindrome quoted was generated in 1984, being news 11 years ago;

Ouch. Eh, "programmers have computers to count for them"?

Ironic how you always notice this sort of thing 10 seconds after sending
it, but not when you are actually checking it for mistakes before. Curse
you, Murphy!

S.
 
C

Christopher Benson-Manica

Skarmander said:
- just because the program was written in C doesn't make it relevant to
this newsgroup;

I would beg to differ and suggest that any C program of reasonable
length is appropriate to post to comp.lang.c, if only to
solicit/elicit comments and feedback. OP, of course, did not do so.
 
S

Skarmander

Christopher said:
I would beg to differ and suggest that any C program of reasonable
length is appropriate to post to comp.lang.c, if only to
solicit/elicit comments and feedback. OP, of course, did not do so.
Clarify: "it" refers to the palindrome. I should have been unambiguous.

S.
 
C

Christian Bau

"Amar Prakash Tripaithi said:
Dan Hoey, who had recently graduated, wrote a C program to look for and
construct the following beauty:

A man, a plan, a caret, a ban, a myriad, a sum, a lac, a liar, a hoop,
a pint, a catalpa, a gas, an oil, a bird, a yell, a vat, a caw, a pax,
a wag, a tax, a nay, a ram, a cap, a yam, a gay, a tsar, a wall, a car,
a luger, a ward, a bin, a woman, a vassal, a wolf, a tuna, a nit, a
pall, a fret, a watt, a bay, a daub, a tan, a cab, a datum, a gall, a
hat, a fag, a zap, a say, a jaw, a lay, a wet, a gallop, a tug, a trot,
a trap, a tram, a torr, a caper, a top, a tonk, a toll, a ball, a fair,
a sax, a minim, a tenor, a bass, a passer, a capital, a rut, an amen, a
ted, a cabal, a tang, a sun, an ass, a maw, a sag, a jam, a dam, a sub,
a salt, an axon, a sail, an ad, a wadi, a radian, a room, a rood, a
rip, a tad, a pariah, a revel, a reel, a reed, a pool, a plug, a pin, a
peek, a parabola, a dog, a pat, a cud, a nu, a fan, a pal, a rum, a
nod, an eta, a lag, an eel, a batik, a mug, a mot, a nap, a maxim, a
mood, a leek, a grub, a gob, a gel, a drab, a citadel, a total, a
cedar, a tap, a gag, a rat, a manor, a bar, a gal, a cola, a pap, a
yaw, a tab, a raj, a gab, a nag, a pagan, a bag, a jar, a bat, a way, a
papa, a local, a gar, a baron, a mat, a rag, a gap, a tar, a decal, a
tot, a led, a tic, a bard, a leg, a bog, a burg, a keel, a doom, a mix,
a map, an atom, a gum, a kit, a baleen, a gala, a ten, a don, a mural,
a pan, a faun, a ducat, a pagoda, a lob, a rap, a keep, a nip, a gulp,
a loop, a deer, a leer, a lever, a hair, a pad, a tapir, a door, a
moor, an aid, a raid, a wad, an alias, an ox, an atlas, a bus, a madam,
a jag, a saw, a mass, an anus, a gnat, a lab, a cadet, an em, a
natural, a tip, a caress, a pass, a baronet, a minimax, a sari, a fall,
a ballot, a knot, a pot, a rep, a carrot, a mart, a part, a tort, a
gut, a poll, a gateway, a law, a jay, a sap, a zag, a fat, a hall, a
gamut, a dab, a can, a tabu, a day, a batt, a waterfall, a patina, a
nut, a flow, a lass, a van, a mow, a nib, a draw, a regular, a call, a
war, a stay, a gam, a yap, a cam, a ray, an ax, a tag, a wax, a paw, a
cat, a valley, a drib, a lion, a saga, a plat, a catnip, a pooh, a
rail, a calamus, a dairyman, a bater, a canal-Panama.

This sentence no verb.
 
P

pemo

Skarmander said:
Skarmander wrote:


Ouch. Eh, "programmers have computers to count for them"?

Ironic how you always notice this sort of thing 10 seconds after sending
it, but not when you are actually checking it for mistakes before. Curse
you, Murphy!

10 seconds! In the words of Monty Python - 'your lucky!', I usually notice
my mistakes as I'm hitting the sned button :)
 
C

Chris McDonald

pemo said:
10 seconds! In the words of Monty Python - 'your lucky!', I usually notice
my mistakes as I'm hitting the sned button :)

Then did you notice this one: 'your lucky!' ?
^^^^
 
K

Keith Thompson

pemo said:
sned = send damn it!

You should have left it alone; I assumed "sned" was a deliberate joke,
and based on that I was willing to give you the benefit of the doubt
on "your" as well.
 
P

pemo

Keith Thompson said:
You should have left it alone; I assumed "sned" was a deliberate joke,
and based on that I was willing to give you the benefit of the doubt
on "your" as well.

Well double damn it - the sned was deliberate, whilst the 'your' was just
dyslexia [my excuse for being dumb :) ]
 
S

Skarmander

pemo said:
You should have left it alone; I assumed "sned" was a deliberate joke,
and based on that I was willing to give you the benefit of the doubt
on "your" as well.


Well double damn it - the sned was deliberate, whilst the 'your' was just
dyslexia [my excuse for being dumb :) ]
Do not meddle in the affairs of Murphy, for he is subtle and quick to anger.

S.
 
F

Flash Gordon

pemo said:
You should have left it alone; I assumed "sned" was a deliberate joke,
and based on that I was willing to give you the benefit of the doubt
on "your" as well.

Well double damn it - the sned was deliberate, whilst the 'your' was just
dyslexia [my excuse for being dumb :) ]

Dyslexics are not dumb, they just have specific problems. See the old
sig. I've resurrected for the occasion.
 
R

Richard Heathfield

Flash Gordon said:
pemo said:
You should have left it alone; I assumed "sned" was a deliberate joke,
and based on that I was willing to give you the benefit of the doubt
on "your" as well.

Well double damn it - the sned was deliberate, whilst the 'your' was just
dyslexia [my excuse for being dumb :) ]

Dyslexics are not dumb, they just have specific problems.

To be fair to pemo, he wasn't claiming dyslexics are dumb. He was claiming
(in a light-hearted, self-deprecating manner) to be dumb, and that he uses
dyslexia as a "cover". It's a reasonable cover, actually. After all, a fool
might indeed write "sned" by mistkae, but so might a dyslexic - and so
might a guy with coffee-stains on his keyboard.
 
P

pemo

Flash Gordon said:
pemo said:
You should have left it alone; I assumed "sned" was a deliberate joke,
and based on that I was willing to give you the benefit of the doubt
on "your" as well.

Well double damn it - the sned was deliberate, whilst the 'your' was just
dyslexia [my excuse for being dumb :) ]

Dyslexics are not dumb, they just have specific problems. See the old sig.
I've resurrected for the occasion.
[/QUOTE]

That's me - but I'll let you decide what problems I have!
 
P

pemo

Amar Prakash Tripaithi said:
Dan Hoey, who had recently graduated, wrote a C program to look for and
construct the following beauty:

A man, a plan, a caret, a ban, a myriad, a sum, a lac, a liar, a hoop,
a pint, a catalpa, a gas, an oil, a bird, a yell, a vat, a caw, a pax,
a wag, a tax, a nay, a ram, a cap, a yam, a gay, a tsar, a wall, a car,
a luger, a ward, a bin, a woman, a vassal, a wolf, a tuna, a nit, a
pall, a fret, a watt, a bay, a daub, a tan, a cab, a datum, a gall, a
hat, a fag, a zap, a say, a jaw, a lay, a wet, a gallop, a tug, a trot,
a trap, a tram, a torr, a caper, a top, a tonk, a toll, a ball, a fair,
a sax, a minim, a tenor, a bass, a passer, a capital, a rut, an amen, a
ted, a cabal, a tang, a sun, an ass, a maw, a sag, a jam, a dam, a sub,
a salt, an axon, a sail, an ad, a wadi, a radian, a room, a rood, a
rip, a tad, a pariah, a revel, a reel, a reed, a pool, a plug, a pin, a
peek, a parabola, a dog, a pat, a cud, a nu, a fan, a pal, a rum, a
nod, an eta, a lag, an eel, a batik, a mug, a mot, a nap, a maxim, a
mood, a leek, a grub, a gob, a gel, a drab, a citadel, a total, a
cedar, a tap, a gag, a rat, a manor, a bar, a gal, a cola, a pap, a
yaw, a tab, a raj, a gab, a nag, a pagan, a bag, a jar, a bat, a way, a
papa, a local, a gar, a baron, a mat, a rag, a gap, a tar, a decal, a
tot, a led, a tic, a bard, a leg, a bog, a burg, a keel, a doom, a mix,
a map, an atom, a gum, a kit, a baleen, a gala, a ten, a don, a mural,
a pan, a faun, a ducat, a pagoda, a lob, a rap, a keep, a nip, a gulp,
a loop, a deer, a leer, a lever, a hair, a pad, a tapir, a door, a
moor, an aid, a raid, a wad, an alias, an ox, an atlas, a bus, a madam,
a jag, a saw, a mass, an anus, a gnat, a lab, a cadet, an em, a
natural, a tip, a caress, a pass, a baronet, a minimax, a sari, a fall,
a ballot, a knot, a pot, a rep, a carrot, a mart, a part, a tort, a
gut, a poll, a gateway, a law, a jay, a sap, a zag, a fat, a hall, a
gamut, a dab, a can, a tabu, a day, a batt, a waterfall, a patina, a
nut, a flow, a lass, a van, a mow, a nib, a draw, a regular, a call, a
war, a stay, a gam, a yap, a cam, a ray, an ax, a tag, a wax, a paw, a
cat, a valley, a drib, a lion, a saga, a plat, a catnip, a pooh, a
rail, a calamus, a dairyman, a bater, a canal-Panama.


Na, it doesn't work

:)

..amanaP-lanac a ,retab a ,namyriad a ,sumalac a ,liar
a ,hoop a ,pintac a ,talp a ,agas a ,noil a ,bird a ,yellav a ,tac
a ,wap a ,xaw a ,gat a ,xa na ,yar a ,mac a ,pay a ,mag a ,yats a ,raw
a ,llac a ,raluger a ,ward a ,bin a ,wom a ,nav a ,ssal a ,wolf a ,tun
a ,anitap a ,llafretaw a ,ttab a ,yad a ,ubat a ,nac a ,bad a ,tumag
a ,llah a ,taf a ,gaz a ,pas a ,yaj a ,wal a ,yawetag a ,llop a ,tug
a ,trot a ,trap a ,tram a ,torrac a ,per a ,top a ,tonk a ,tollab a
,llaf a ,iras a ,xaminim a ,tenorab a ,ssap a ,sserac a ,pit a ,larutan
a ,me na ,tedac a ,bal a ,tang a ,suna na ,ssam a ,was a ,gaj a
,madam a ,sub a ,salta na ,xo na ,saila na ,daw a ,diar a ,dia na ,room
a ,rood a ,ripat a ,dap a ,riah a ,revel a ,reel a ,reed a ,pool a
,plug a ,pin a ,peek a ,par a ,bol a ,adogap a ,tacud a ,nuaf a ,nap a
,larum a ,nod a ,net a ,alag a ,neelab a ,tik a ,mug a ,mota na ,pam a
,xim a ,mood a ,leek a ,grub a ,gob a ,gel a ,drab a ,cit a ,del a ,tot
a ,laced a ,rat a ,pag a ,gar a ,tam a ,norab a ,rag a ,lacol a ,apap
a ,yaw a ,tab a ,raj a ,gab a ,nagap a ,gan a ,bag a ,jar a ,bat a ,way
a ,pap a ,aloc a ,lag a ,rab a ,ronam a ,tar a ,gag a ,pat a ,radec
a ,latot a ,ledatic a ,bard a ,leg a ,bog a ,burg a ,keel a ,doom
a ,mixam a ,pan a ,tom a ,gum a ,kitab a ,lee na ,gal a ,ate na ,don
a ,mur a ,lap a ,naf a ,un a ,duc a ,tap a ,god a ,alobarap a ,keep
a ,nip a ,gulp a ,loop a ,deer a ,leer a ,lever a ,hairap a ,dat a ,pir
a ,door a ,moor a ,naidar a ,idaw a ,da na ,lias a ,noxa na ,tlas a
,bus a ,mad a ,maj a ,gas a ,wam a ,ssa na ,nus a ,gnat a ,labac a ,det
a ,nema na ,tur a ,latipac a ,ressap a ,ssab a ,ronet a ,minim a ,xas a
,riaf a ,llab a ,llot a ,knot a ,pot a ,repac a ,rrot a ,mart a ,part a
,tort a ,gut a ,pollag a ,tew a ,yal a ,waj a ,yas a ,paz a ,gaf a ,tah
a ,llag a ,mutad a ,bac a ,nat a ,buad a ,yab a ,ttaw a ,terf a ,llap
a ,tin a ,anut a ,flow a ,lassav a ,namow a ,nib a ,draw a ,regul a
,rac a ,llaw a ,rast a ,yag a ,may a ,pac a ,mar a ,yan a ,xat a ,gaw a
,xap a ,wac a ,tav a ,lley a ,drib a ,lio na ,sag a ,aplatac a ,tnip a
,pooh a ,rail a ,cal a ,mus a ,dairym a ,nab a ,terac a ,nalp a ,nam A
 
F

Flash Gordon

Richard said:
Flash Gordon said:
pemo said:
You should have left it alone; I assumed "sned" was a deliberate joke,
and based on that I was willing to give you the benefit of the doubt
on "your" as well.
Well double damn it - the sned was deliberate, whilst the 'your' was just
dyslexia [my excuse for being dumb :) ]
Dyslexics are not dumb, they just have specific problems.

To be fair to pemo, he wasn't claiming dyslexics are dumb. He was claiming
(in a light-hearted, self-deprecating manner) to be dumb,
True

> and that he uses
dyslexia as a "cover".

I don't like people using dyslexia as a cover for the simple reason that
people still have to fight for help for their dyslexic children in school.

I do recognise that pemo intended nothing bad, so I'll drop it here.
> It's a reasonable cover, actually. After all, a fool
might indeed write "sned" by mistkae, but so might a dyslexic - and so
might a guy with coffee-stains on his keyboard.

Indeed.
 
P

pemo

Flash Gordon said:
Richard said:
Flash Gordon said:
pemo wrote:
<snip>

You should have left it alone; I assumed "sned" was a deliberate joke,
and based on that I was willing to give you the benefit of the doubt
on "your" as well.
Well double damn it - the sned was deliberate, whilst the 'your' was
just
dyslexia [my excuse for being dumb :) ]
Dyslexics are not dumb, they just have specific problems.

To be fair to pemo, he wasn't claiming dyslexics are dumb. He was
claiming (in a light-hearted, self-deprecating manner) to be dumb,
True

and that he uses
dyslexia as a "cover".

I don't like people using dyslexia as a cover for the simple reason that
people still have to fight for help for their dyslexic children in school.

I do recognise that pemo intended nothing bad, so I'll drop it here.

Just a note ... I didn't mean anything bad, and indeed, I think (although
I've never been diagnosed) I may be dreadfully dyslexic myself - in my
thinking, writing and esp. my spelling - where I can't usually tell whether
a word is spelled right or wrong for the life of me.
 
D

Dik T. Winter

> Dan Hoey, who had recently graduated, wrote a C program to look for and
> construct the following beauty:

There are a few errors here. It is not recently that Dan Hoey did graduate.
Second, I do not think that he wrote a program to find the palindrome.
Third, the most beautiful palindrome (in my opinion) was the following
program (back to C) from 1987:

/**/char q='"',*a="*//**/char q='%c',*a=%c%s%c*/};)]d-062[b=]d[b(
rahctup)--d(elihw;)q,a,q,q,2+a,b(ftnirps{)(niam;162=d tni;]162[b,"
,b[261];int d=261;main(){sprintf(b,a+2,q,q,a,q);while(d--)putchar
(b[d]=b[260-d]);}/*c%s%c%=a*,'c%'=q rahc/**//*"=a*,'"'=q rahc/**/

Join the lines together to get a single line, remove the trailing new
line, compile, run and be amazed. (And, yes, 1987, so K&R C.)[/b]
 
R

Richard Heathfield

Dik T. Winter said:
There are a few errors here. It is not recently that Dan Hoey did
graduate.

Note the pluperfect tense: "Dan Hoey, who *had* recently graduated". This
means it could be pretty well anywhen, right back to the dawn of time -
i.e. 1/1/1970. ;-)
Second, I do not think that he wrote a program to find the
palindrome.

According to Peter van der Linden, not only did he write a program, but it
was indeed a C program. In fact, the above text is a direct quote from
"Expert C Programming" by PvdL.
 

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top