/**
 * Computer-generated religion is not new -- we've been using it
 * to help us develop our beliefs for years. For example:
 * <P>
 * The Eastern Sikh Faith believes that the Satanic Verses was
 * written by Walt Disney, and argues that Man will yield to
 * the Last Trump.
 * <P>
 * The Sunni Taoist Church denies that the Koran contains a
 * direct reference to Mumon, and argues that we should beware
 * Nirvana.
 * <P>
 * The Southern Sub-Genious Affiliation for Aliens suspects
 * that the Sargent Pepper album proves the divine origins of
 * David Scott, and explains that man will succeed in avoiding
 * New Coke.
 * <P>
 * To generate YOUR own belief, choose one from each section below
 *(in best buzzword generator style):
 */

public class Belief {

    public static final int COLUMNS_PER_LINE = 79;

/* null after a group, two null at end of list */
    public static final String[] LIST = {
"The",
null,

"Arian",
"Athanasian",
"Roman",
"Sunni",
"Presbyterian",
"United Reformed",
"Unitarian",
"Anglican",
"Jehovah's",
"Jewish",
"Fundamentalist",
"Shiite",
"Hari",
"Shinto",
"Zoroastrian",
"Christian",
"Salvation",
"Seventh Day",
"Saphardic",
"Zen",
"Hebraic",
"Palestinian",
"Galilean",
"New Age",
"Reformed",
"Orthodox",
"Southern",
"Northern",
"Eastern",
"Western",
"Universal",

/* MCA */
"Bavarian",
"Allied",
"Brotherhood of the",
"Greek",
"Golden",
"Silver",
"Hindu",
"Ancient",
"Illuminated",
"Renown",
"Mongol",
"Hermetic",
"Rockin'",
"Aztec",
"True",
"Asian",
"Zombie",
"Converted",
"Gidean",
"American",
"New",
"Alien",
"Rhode Island",
"Alaskan",
"New York",
"Native American",
"Young",
"",
null,

"Catholic",
"Baptist",
"Protestant",
"Muslim",
"Moonie",
"Mormon",
"Witnesses",
"Sikh",
"Buddhist",
"Krishna",
"Methodist",
"Fire-worshipper",
"Parsee",
"Theosophist",
"Adventist",
"Confucianist",
"Shamanist",
"Taoist",
"Atheist",
"Rosicrusian",
"Sub-Genius",
"Episcopalian",
"Secular Humanist",
"Revisionist",
"Masonic",
"Shriner",
"Pentecostal",
"Charismatic",
"Thetan",
"Odd Fellow",
"PreClear",
"Satanic",
"Twelve Step",
"Druid",
"Lutheran",
"Four Square",
"Bible Thumpers",
"Flat-Earth",
"Whole-Earth",

/* MCA */
"Paved-Earth",
"Star",
"Generation X",
"Christian",
"Thelemite",
"Liberation",
"John Birch",
"Elder Thing",
"Trekker's",
"Illuminati",
"Science",
"Discoridan",
"Baccus",
"Republican",
"Democratic",
"Libertarian",
"Communist",
"Socialist",
null,

"Church",
"Faith",
"Sect",
"Heresy",
"Liberation Front",
"Elder Council",
"Lodge",
"Society",
"Temple",
"Army",
"Congregation",
"Sunday School",
"Cult",
"Fellowship",

/* MCA */
"Scientists",
"Revolution",
"Foundation",
"Order",
"Militia",
"Fan Club",
"Affiliation",
"Movement",
null,

/* MCA */
"for a Better Tomorrow",
"for a Better Today",
"of Latter Day Saints",
"for a Better Yesterday",
"for Women",
"for Men",
"for Aliens",
"for Lesbians",
"for Gay Men",
"for Bisexuals",
"from Tulsa, Oklahoma,",
"of Ohio",
"from Wisconson",
"of Mexico",
"for Eunics",
"of Germany",
"of Russia",
"for a Unified Europe",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
null,

"believes that",
"denies that",
"is strongly divided over whether",
"rejects the notion that",
"posits that",
"preaches that",
"insists that",
"professes that",
"proclaims that",
"suspects that",
"theorises that",
"concludes that",
"announces that",
"refutes that",
"is confused over whether",
"agrees that",
null,

"the Bible",
"the Koran",
"the Magna Carta",
"the Kama Sutra",
"the Bagavad Gita",
"the Talmud",
"the Torah",
"the Satanic Verses",
"the Mosaic Law",
"the book of Revelation",
"the collection of predictions of Nostradamus",
"every Norse saga",
"the new, controversial eleventh Commandment",
"the Apocrypha",
"the Sargent Pepper album",
"the Athanasian creed",
"the Rosetta Stone",
"chapter thirteen of Dianetics",
"a transcript of the very first Ramtha channeling",
"The Writ of Common Wisdom",
"a certain part of \"The Last Temptation of Christ\"",
"\"The Prophet\", by Kahlil Gibran,",
"\"The Profit\", by Kehlog Albran,",
"a secret document hidden in Fawn Hall's underwear",
"one of the lesser known Dead Sea Scrolls",
"Marquis de Sade's \"Bedroom Etiquette\"",
"a cryptic notation on the back of the bar tab from the Last Supper",
"Darwin's \"Origin of Species\"",
"a particularly crude example of poetry from the men's room wall",
"Elvis's Will",
"The Pentagon Papers",
"Shirley McLaine's \"Out on a Limb\"",
"an inscription found on the basement wall in the Temple of Karnak",
"\"The Life of Brian\"",
"a certain scrap of MVS source code from 1971",
"an IBM punch card found on the machine room floor in 1978",
"the private diary of Marcia Brady",
"the Book of Mormon (with introduction by Charlton Heston),",
"grafitti once found on the A-train to Far Rockaway in 1969",
"a certain limerick containing a reference to \"Nantucket\"",
"Randy Travis' Copenhagen ring",
"a mysterious pattern of cat box scratchings",
"\"The Yosemite\" by John Muir",
"\"No Bad Dogs\", by Barbara Woodhouse",
"\"Atlas Shrugged\", by Ayn Rand",
"a certain cryptic coding construct of Richard Stallman",
"Cher's secret tattoo",
"the bumps on the skull of Thomas \"Tip\" O'Neill (if interpreted as braille)",
"a particularly obscure pattern of crop circles",
"scene II, act V of \"The Search for Spock\"",
"a forgotten screenplay by Sidney Sheldon",
"the pattern of crows feet around Nancy Reagan's eyes (as interpreted by her astrologist),",
"a certain old \"Leave it to Beaver\" script",
"Nancy Reagan's \"My Turn\"",

/* MCA */
"Windows '95 document files",
"the Necronomicon",
"the Principia Discordia",
"The Egyptian Book of the Dead",
"The Tibetan Book of the Dead",
"MS-DOS 3.3 user's guide",
"Bill Gate's income tax form",
"OS/2's original source code",
"a never used function in Word",
"a large lump of Spam, moulded in the form of Elvis",
"\"Common Sense\" by Adam Smith",
"the script to \"Pulp Fiction\"",
"Frank Herbert's last, unpublished \"Dune\" novel",
"Aleister Crowley's \"The Book of the Law\"",
"the pimples on Ronald Reagan's ass (if interpreted as braille)",
"\"The Joy of Lesbian Sex\", chapter six",
"that greasy stuff Spam is canned with",
"Gram Hill's odd birthmark",
"the scripts to all of Elvis' movies",
"Einstein's tupee",
"an old stop sign shot by a buckshot shotgun (if interpreted as braille)",
"\"How to Win Friends and Influence People\"",
"The Gospel According to Bob",
"an abandoned and neglected Mac Classic",
"all the world's Giddian Bibles",
"a certain Sunday edition of The Family Circus",
"the Constitution of the Iriqois Nations",
"The Mr. Bill Show",
"Gene Simon's chest hair",
"the stained blue dress",
null,

/* MCA */
", if read backwards,",
", if held up to strong light,",
", when pasted together in the correct order,",
", when translated from the original Turkish,",
", when played backwards,",
", if rearranged via the I Ching,",
", if spat upon by thousands of green yaks,",
", if decrypted using Jesus's original PGP public key,",
", in reality,",
", if cut apart then reassembled in a certain order,",
", if spoken by James Earl Jones,",
", when arranged in a specific order,",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
null,

"predicts the eventual supremacy of",
"contains a direct reference to",
"has been misunderstood by",
"proclaims the divinity of",
"can be read as denouncing the divinity of",
"is an insult to",
"is a heretical misinterpretation of scripture by",
"was inspired by",
"denies the existence of",
"contains coded messages from the Inner Child of",
"was dictated by",
"encodes the personal opinions of",
"can be deduced from the writings of",
"implies the divinity of",
"justifies worshipping the sandals of",
"explains the holy writings of",
"can be interpreted as the memoirs of",
"reveals cryptic messages from",
"reveals a message from",
"follows the teachings of",

/* MCA */
"was comprehended by",
"divines a New Testament by",
"was revealed by",
"was divined to",
"sheds new light into the life of",
"proves the divine origins of",
"predicts the divine birth of",
"proclaims the Word of",
"suggests the divinity of",
"justifies the worshiping of",
"conceals the teachings of",
null,

"Salman Rushdie,",
"the Ayatollah,",
"Thomas Aquinas,",
"Billy Graham,",
"J. Z. Knight,",
"Elijah,",
"Elvis,",
"Elvis Costello,",
"Elvira, Mistress of the Dark,",
"Jesus' little known brother Tony,",
"the Reverend Al Sharpton,",
"Louisiana State Senator Merle Jacobs,",
"John Lennon,",
"Buddy Holly,",
"Andrew Lloyd Weber,",
"a certain bombastic revivalist preacher,",
"the creature from the Black Lagoon,",
"a particular White-Supremacist from Hayden Lake,",
"Jerry Lee Lewis,",
"a twelve year old stigmatic from Lubbock, Texas,",
"Zeus,",
"King Tut,",
"Ernest Hemingway,",
"Mariel Hemingway,",
"Ernest Borgnine,",
"Ernest P. Worrell,",
"Ernest P. Worrell's love-child,",
"\"Jake the Snake\",",
"Ann Landers,",
"Bess Truman,",
"a fire-and-brimstone street preacher from Provo,",
"the last living Baghwan Shree-Rajneesh loyalist,",
"a certain white-shoed car salesman,",
"Crazy Eddie,",
"Howard Stern,",
"a certain Australian footballer named Bubba,",
"Father Guido Sarducci,",
"the last practicing medicine man of the Mohicans,",
"James Randi,",
"Our Lady of the White Go-Go Boot,",
"Verleen, The patron saint of Big Hair,",
"Helga, the patron saint of Unseasoned Food,",
"Randy, the patron saint of Big Pickup Trucks,",
"Maxine, the patron saint of Press-on Nails,",
"Tina, the patron saint of Polyester Stretch Pants,",
"Boopsie, the patron saint of Large Dangly Earrings,",
"Mahomet,",
"Walt Disney,",
"Ezekiel,",
"Dan Quayle,",
"Murphy Brown,",
"George Bush,",
"Oliver North,",
"Thomas Merton",
"Leo Buscaglia,",
"Marilyn Quayle,",
"Ernest Angsley,",
"Odin and Thor,",
"Adolf Hitler,",
"Linus Pauling,",
"Pope John-Paul II,",
"Bishop Spong,",
"Mumon,",
"Martin Scorcese,",
"Bill Gates,",
"Abraham Lincoln",
"Daryl Gates,",
"Robert Gates,",
"Robert DeNiro",
"the Mormon Tabernacle Choir,",
"Jim Bakker,",
"Tammy-Faye Bakker,",
"Jimmy Swaggart,",
"Susanne Somers,",
"Richard Simmons,",
"Richard Lewis,",
"Cardinal Richelieu,",
"Charles Manson,",
"James Taylor,",
"Tipper Gore,",
"Hillary Clinton,",
"Dolly Parton,",
"Jerry Falwell,",
"Robert Bly,",
"Joseph Campbell,",
"Zig Zeigler,",
"L. Ron Hubbard,",
"Captain Al Hubbard,",
"Jesse Helms,",
"Jesse Jackson,",
"Jimi Hendrix,",
"The Juice Man (tm),",
"Clarence Thomas,",
"Long Dong Silver,",
"a certain paunchy, ex-Chippendale dancer,",
"the shadowy leader of a certain gang of biker nuns,",
"a spaced out, pot smoking crystal worshipper,",
"a certain swarthy wild-eyed, Eastern European anarchist,",
"a certain middle-aged bag lady with a personality disorder,",
"a certain pornography-addicted TV preacher,",
"a certain washed up TV actor that's now doing infomercials on cable,",
"a certain philandering, saxophone-playing Southern Governor,",
"a certain flamboyant, gender-bending rock star,",
"a certain female talk show pop-psychologist,",
"a certain truck stop waitress from Cocolalla, Idaho,",
"a certain small town sheriff from North Carolina,",
"an avowed heterosexual female tennis player,",
"a certain absent-minded, father figure ex-President,",
"a certain blonde, pointy-bra wearing pop singer,",
"David Duke,",
"Robert Mapplethorpe,",
"Wilheim Reich,",
"Kreskin,",
"Mahatma Gandhi,",
"Abbie Hoffman,",
"Timothy Leary,",
"Jack Kerouac,",
"Allen Ginsberg",
"Paul Krassner,",
"Marlin Fitzwater,",
"Ken Kesey,",
"Helen Gurley Brown,",
"Tina Brown,",
"David Geffen,",
"Howard Cosell,",
"Cy Sperling,",
"Andy Warhol,",
"Ferdie \"The Fight Doctor\" Pacheco,",
"Madonna,",
"The Beatles,",

/* MCA */
"Anton S. LeVay,",
"Gautama Buddha,",
"Kali, destroyer of worlds,",
"Ed Wood,",
"David Koresh,",
"Aleister Crowley,",
"Les Claypool,",
"Ben Hur,",
"Michael Eisner,",
"Erwin Schrodinger,",
"William S. Burrows,",
"H. P. Lovecraft,",
"a gigantic, shiny, red button,",
"Frank Zappa,",
"the aliens from Alpha Centauri IV,",
"Alice Cooper's snake,",
"Terrence McKinna,",
"Great Cthulu,",
"Eris Discordia,",
"David Scott,",
"Robert Anton Wilson,",
"J. R. \"Bob\" Dobbs,",
"the face on Mars,",
"Adam Wiesaupt,",
"William Shatner,",
"SUPERMONSTER GAMARA,",
"Andrew \"Dice\" Clay,",
"Dr. Van Van Mojo,",
"John Miller,",
"Peyote Woman,",
"Yog S'thoth,",
"Monica Luinsky,",
"Stanley Kubrick,",
"Pac-Man,",
"George Washington",
"The Amazing Randy",
null,

"and",
"but",
"yet",
"and likewise",
null,

"says",
"explains",
"claims",
"believes",
"argues",
"insists",
"refutes",
"denies",
"professes",
"preaches",
"suggests",
null,

"that",
"that soon",
"that after the second coming of Christ",
"that ultimately",
"that inevitably",
"that if we are true and faithful servants,",
null,

"we should strive for",
"the world will end with",
"we should beware",
"we shall see",
"the ungodly are about to experience",
"only the faithful will achieve",
"the chosen people will soon experience",
"men will yield to",
"women will yield to",
"mankind will yield to",
"man will succeed in avoiding",
"woman will succeed in avoiding",
"mankind will succeed in avoiding",
"the Seventh Sign will be avoided by",
"only the born-again will actually enjoy",
"only the chosen people will experience",
"the chosen people will be spared by",

/* MCA */
"the doom of humanity shall be",
"the fall of humanity shall be",
"the world shall be consumed by",
"a rebirth of spiritualism will come about through",
null,

"reincarnation.",
"Judgement Day.",
"the Apocalypse.",
"\"Apocalypse Now\".",
"Oral Robert's prayer tower.",
"nirvana.",
"Nirvana (the band).",
"Mount Olympus.",
"martyrdom.",
"the Second Coming.",
"the Second Cuming.",
"the sound of one hand clapping.",
"birth control.",
"better living through chemistry.",
"human sacrifices.",
"cherry pie and damn fine coffee.",
"damnation.",
"Papal Infallability.",
"enlightenment.",
"the \"666\" mysteriously found tattooed on your head.",
"pinball heaven.",
"phallic idoltry.",
"pubic hair on your Coke.",
"a guilt-free afterlife.",
"guilt-free sex.",
"guilt-free bingo.",
"government, by the people, and for the people.",
"remorse for their crimes.",
"\"Crimes Against Nature\" (at least in some Southern states).",
"the Turin Shroud.",
"purgatory.",
"premarital sex.",
"a feeling of oneness with nature.",
"that oh-so-fresh feeling.",
"that not-so-fresh feeling.",
"shiatsu massage.",
"chiropractic treatment.",
"ESO.",
"tetrahydrocannabinol.",
"lysergic acid diethylamide.",
"psilocybin.",
"quinuclidinyl benzilate.",
"phenylpropanolamine.",
"Xanax addiction.",
"Prozac addiction.",
"a life made livable with clozapine.",
"colonic irrigation, twice a day.",
"self abuse.",
"real tears from Michelangelo's \"Pieta\".",
"the face of Jesus in a bowl of spaghetti.",
"one man, one vote.",
"a resurgence of tribbles.",
"a Popeil pocket fisherman.",
"\"from each according to their ability, to each according to their need\".",
"the upcoming Vernal Equinox.",
"Buddha Nature.",
"the upcoming Summer Solstice.",
"trout fishing.",
"rolfing.",
"engrams.",
"utopia.",
"the ThighMaster.",
"bliss.",
"the monolith in 2001 A Space Odessy.",
"the writings of Douglas Hofsteader.",
"the end of the world.",
"the eventual domination of world.",
"backward masking.",
"megadoses of vitamin C.",

/* MCA */
"fire.",
"\"liqui-gels\".",
"\"2001: A Space Odessy\".",
"assault-style weapons.",
"anarchy.",
"lemon-scented sprays.",
"the Rocky Horror Picture Show.",
"Spam.",
"a plastic imitation foreskin.",
"sex with Ted Kennedy.",
"smokin' Dope with the Pope.",
"trendy papsmears.",
"removal of that dangly thing in the back of your mouth.",
"New Coke.",
"the death of Bob Dole.",
"watching all of Oliver Stone's films, back to back.",
"the ATF.",
null,
null      /* and one last null to end the whole list */
};


public static void main( String args[] )
{
   int i = 0, l = 1;
   if (args.length > 0)
     try {
        l = Integer.parseInt( args[0] );
     } catch (NumberFormatException nfe) { l = 1; }
   for (; i < l; i++)
   {
     printRandomSelection( LIST );
     System.out.println("");
   }
}

public static void printRandomSelection( String list[] )
{
     int i = 0, j, cnt;
     String buff = "";

     for (; list[i] != null; i++) {
        /* how many in the current list? */
        cnt = 0;
        for (j = i; list[j] != null; j++) {
           cnt++;
        }
        /* pick a random string */
        j = (int)(Math.random() * cnt);
        
        buff = cat( buff, list[i + j] );
        i += cnt;
     }
     /* print it out, breaking lines */
     printLines( buff );
}

protected static String cat( String s1, String s2 )
{
   int l1 = s1.length(), l2 = s2.length();
   char c, c2;

   if (l2 <= 0) return s1;
   if (l1 <= 0) return s2;

   c = s1.charAt( l1 - 1 );
   c2 = s2.charAt(0);
   if ( (!Character.isLetterOrDigit(c)) && c == c2 )
   {
     s2 = s2.substring(1);
     c2 = s2.charAt(0);
   }

   if (c != ' ' && c2 != ',')
     return s1 + " " + s2;
   return s1 + s2;
}

protected static void printLines( String text )
{
   String tmp;
   int cnt = 0, j;
   boolean firstOnLine = true;

   while (true) {
      j = text.indexOf( ' ' );
      if (j < 0)
      {
        j = text.length();
        if (cnt+j+1 < COLUMNS_PER_LINE)
          System.out.println( " "+text );
        else
          System.out.println( "\n"+text );
        return;
      }
      tmp = text.substring( 0, j );
      text = text.substring( j+1 );
      if (cnt + j < COLUMNS_PER_LINE) {
        cnt += j + 1;
        System.out.print( " " + tmp );
      } else {
        cnt = tmp.length();
        System.out.print( "\n" + tmp );
      }
   }
}

}

/*
--
Selected by Brad Templeton.  MAIL your joke (jokes ONLY) to funny@clarinet.com.
Attribute the joke's source if at all possible.  A Daemon will auto-reply.
If you don't need an auto-reply, submit to rhf@clarinet.com instead.
*/

