/* * [Insult.java] * * Summary: Generates insults typical of Republican newsgroup posters. * * Copyright: (c) 2005-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 1.0 2005-05-23 * 1.1 2005-05-23 add more phrases and vocabulary * 1.2 2005-05-25 add Nuke the whales! pattern. * 1.3 2005-05-26 add Russians hate America! pattern * 1.4 2005-07-30 ANT builds * 1.5 2005-12-16 add Javadoc * 1.6 2006-02-05 reformat with IntelliJ, add Javadoc. * 1.7 2007-01-01 * 1.8 2007-12-16 add camel insults * 1.9 2008-04-02 add build to title */ package com.mindprod.insult; import com.mindprod.common18.Build; import com.mindprod.common18.CMPAboutBox; import com.mindprod.common18.FontFactory; import com.mindprod.common18.Hybrid; import com.mindprod.common18.VersionCheck; import java.applet.Applet; import java.awt.Button; import java.awt.Color; import java.awt.Font; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.Label; import java.awt.TextField; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Random; /** * Generates insults typical of Republican newsgroup posters. *

* * @author Roedy Green, Canadian Mind Products * @version 1.9 2008-04-02 add build to title * @noinspection FieldCanBeLocal * @since 2005-05-23 */ public final class Insult extends Applet { /** * height of Applet box in pixels. Does not include surrounding frame. */ private static final int APPLET_HEIGHT = 152; /** * Width of Applet box in pixels. */ private static final int APPLET_WIDTH = 818; private static final int FIRST_COPYRIGHT_YEAR = 2005; /** * undisplayed copyright notice * * @noinspection UnusedDeclaration */ private static final String EMBEDDED_COPYRIGHT = "Copyright: (c) 2005-2017 Roedy Green, Canadian Mind Products, http://mindprod.com"; /** * date this version released */ private static final String RELEASE_DATE = "2008-04-02"; /** * title */ private static final String TITLE_STRING = "CMP Insult Generator"; /** * this version */ private static final String VERSION_STRING = "1.9"; /** * verbs that suggest conquest or violence */ private static final String[] braggingVerbs = { "abolish", "ban", "bash", "beat", "blast", "bomb", "bury", "clobber", "demolish", "drive SUVs over", "flatten", "glassify", "kill", "napalm", "nuke", "outlaw", "overwhelm", "screw", "shoot", "silence", "steam-roller", "wipe", }; /** * rude adjectives */ private static final String[] rudeAdjectives = { "AIDS-infested", "America-hating", "Arab", "ass-pounding", "bleeding heart", "boy-fucking", "camel-fucking", "camel-humping", "camel-raping", "cocksucking", "bullshitting", "Bush-hating", "butt-banging", "Chomsky-loving", "Christ-hating", "clueless", "communist", "cornholing", "crazy", "crying", "damned", "DemocRAT", "Democrat", "disgusting", "disobedient", "disrespectful", "fat", "fat-assed", "feel-good", "flag-hating", "flag-burning", "flaming", "freedom-hating", "French", "Hitler-loving", "holocaust-denying", "homo", "illegal", "impractical", "insane", "Jesus-hating", "koran-owning", "left-wing", "limp-wristed", "lying", "mendacious", "moonbat", "moronic", "queer", "rebellious", "Saddam-loving", "sick", "skinny-assed", "socialist", "spamming", "stupid", "teflon", "tin hat", "unemployed", "whining", "wimpoid", }; /** * rude nouns */ private static final String[] rudeNouns = { "alien", "America-hater", "animal", "Arab", "assclown", "asshole", "atheist", "bastard", "black", "bullshitter", "bum biter", "Bush-hater", "Canadian", "camel jockey", "camel humper", "camel kisser", "Canuck", "Canukistani", "cheesehead", "cheese-eater", "child molester", "chink", "Chomskyite", "Clinton-lover", "Clintonite", "cock sucker", "commie", "communist", "conspiracy theorist", "crackpot", "creep", "cum-drinker", "dog-fucker", "environmentalist", "European", "faggot", "fart", "fruitcake", "gay boy", "girlie-man", "hate monger", "homo", "idiot", "Jew", "Jew-boy", "ketchup eater", "koran reader", "leftie", "liar", "Liberal", "LIEberal", "loon", "loser", "luser", "maggot", "maroon", "Mexican", "Mooseslime", "moron", "Muslim", "newbie", "nigger", "nutbar", "pedophile", "person with AIDS", "pervert", "piece of trash", "pinko", "pond sucker", "queer", "raghead", "retard", "Saddam-lover", "Saddamocrat", "sand monkey", "sand nigger", "scumbag", "SOB", "socialist", "sock puppet", "spammer", "terrorist", "trailer park scum", "traitor", "tree-hugger", "vulture sock puppet", "wannabe", "welfare bum", "wetback", "whacko", "wing nut", "woman", }; /** * rude phrases often uttered by Republicans */ private static final String[] rudePhrases = { "Another stupid Retard liberal exposes it's amoeba brain to the world.", "", "", "All terrorists are Muslims.", "Bush created more jobs that any other president.", "Bush does what he does out of his love for Jesus.", "Bush is the greatest president of all time, militarily, economically and preserving freedoms.", "Bush won! Trust me, Bush won.", "BWAHAHAHAHAHAHAHAHAHA!", "BY DEFINITION YOU ARE A LIAR!!", "By definition, Democrats never tell the truth.", "By definition, I am right and you are wrong.", "Clinton did it.", "Doing that would utterly destroy the economy.", "ELECTION NEWS FLASH! LIBERALS ARE MORONS!", "Every book you recommend must be a lie, since everything you say is a lie.", "Every child killed in Iraq was an totally unavoidable accident. How dare you insinuate otherwise!", "Everything I say just goes right over your head. You don't know nothing!", "Four more years. Get used to it!", "Fuck you!", "George Bush has never told a lie in his life. You're a traiter to suggest otherwise.", /* sp */ "Get over it!", "Gore is boring!!!", "Ha ha, another liberal suffers and dies!", "I don't care if Bush confessed to using coke and being an alcoholic. I know in my heart he never touched" + " drugs.", "I don't care if the white house website said so. They are just trying to make Bush look bad.", "I don't give a shit.", "I don't have to read that. I know already what it will say.", "I don't need to look at your so-called evidence.", "I don't read books. Books contain nothing but lies. They are written by liberals.", "I DON'T TRUST YOU.", "I hope you die.", "I picture you as a child in the fetal position sucking your thumb craving for your mothers breast milk.", "I would suggest that you seek counseling and drink a pint of your mothers warm milk.", "It is a well known fact that everything you have ever said is a lie.", "Kerry eats ketchup.", "LIEberals don't know anythang.", "LMAO", "Nya nya nya. I'm a Republican and your not.", "On the economy, Greenspan is a no-nothing compared with Bush.", "One more time! American soldiers don't kill people, you liar!", "Paul O'Neill. What does he know about the economy?", "Quack, quack, quack.", "Rush hasn't been convicted of drug dealing.", "SCREW YOU!", "Sheesh!", "Take your meds.", "The bible says different. That settles it once and for all.", "There is no doubt at all. Bush won fair and square.", "There is no proof Bush paid Gannon for sex.", "Those sources are all lies. I know in my heart what is true.", "Those sources are invalid because the contradict Bush.", "We won the election, losers, so get used to it", "What Bill Gates says doesn't count. He's a socialist.", "What Bill O'Reilly says doesn't count. He's a liberal.", "What FOX says is a lie. It's is part of the liberal media conspiracy.", "What have you been smoking?", "What the Pentagon says doesn't count. They are crawling with liberals.", "Yes but, Clinton lied under oath.", "Yes but, Clinton's penis!", "Yes but, Dean screamed.", "Yes but, Robert Byrd belonged to the KKK in the 1950s.", "Yes but, Ted Kennedy is a murderer.", "You are full of crap", "You are full of shit.", "You are short on facts.", "You are totally ignorant.", "You are trying to destroy the sanity of marriage and cause more AIDS.", "You are wrong. Q.E.D.", "You can't bring yourself to know that you are wrong.", "You can't prove Bush did it.", "You can't trust Richard Clarke. He's disgruntled cuz Bush fired him.", "You don't know anything this.", "You just pretend to be so smart with your perfect grammar and spelling.", "You just want to destroy the economy.", "You lost the election.", "You make me sick.", "You put viruses in my computer. I'm telling the police.", "You shount post when you've been drinking.", "You snipped some of my post. How dare you put words in my mouth that way!", "You think EVERYTHING is America's fault, even global warming.", "You want to turn America into a socialist pig hole.", "Your an idiot.", "Your illness is God's punishment for not doing as I say.", "Your lying.", }; /** * typical Republican scapegoats */ private static final String[] rudeScapegoats = { "AIDS carriers", "Arabs", "atheists", "Bill Clinton", "Bill", "Billary", "blacks", "baby-killer", "Bush-haters", "Canadians", "Canucks", "Canukistanis", "chinks", "Clinton", "cock suckers", "communists", "conspiracy theorists", "DemocRATS", "Edwards", "environmentalists", "Europeans", "faggots", "Gooks", "Gore", "Hillary", "homos", "illegal aliens", "Indians", "Jews", "lefties", "Liberals", "LIEberals", "Mexicans", "Mooseslimes", "Muslims", "niggers", "Noam Chomsky", "Obama", "Pakis", "queers", "Robert Byrd", "sand monkeys", "sand niggers", "slopes", "socialists", "terrorists", "the Clintons", "the Democrats", "the French", "the Klintoons", "the ragheads", "the Russians", "tree-huggers", "welfare bums", "women", }; /** * background */ private static final Color BACKGROUND_FOR_BODY = Build.BACKGROUND_FOR_BLENDING; /** * field background */ private static final Color BACKGROUND_FOR_FIELD = Color.white; /** * button colour */ private static final Color FOREGROUND_FOR_BUTTON = new Color( 0x008000 ); /** * text colour */ private static final Color FOREGROUND_FOR_TEXT = Color.black; /** * for titles */ private static final Color FOREGROUND_FOR_TITLE = new Color( 0xdc143c ); /** * for for titles and About buttons */ private static final Font FONT_FOR_TITLE = FontFactory.build( "Dialog", Font.BOLD, 16 ); /** * for for title second line */ private static final Font FONT_FOR_TITLE2 = FontFactory.build( "Dialog", Font.PLAIN, 14 ); /** * random number generator */ private static final Random wheel = new Random(); /** * that adjective did we use in the last insult */ private static int prevAdj = 0; /** * last bragging word we used in an insult */ private static int prevBraggingVerb = 0; /** * last noun we used */ private static int prevNoun = 0; /** * last phrase we used in an insult */ private static int prevPhrase = 0; /** * scapegoat we used it the last insult */ private static int prevScapegoat = 0; /** * what class of insult we just generated */ private static int prevType = 0; /** * about button */ private Button about; /** * trigger another insult */ private Button insultButton; /** * title */ private Label title; /** * second title line for app */ private Label title2; /** * text of the generated insult */ private TextField insultText; /** * generate an insult. * * @return insult less than 80 characters. */ private static String generateInsult() { final int types = 8; int type; do { type = ( wheel.nextInt() & Integer.MAX_VALUE ) % types; } while ( type == prevType );// insist on different type each time prevType = type; switch ( type ) { case 0: // e.g. You're an ass-pounding liar. String adj = randomAdjective(); boolean vowel = "aeiou".indexOf( adj.charAt( 0 ) ) >= 0; return "You're " + ( vowel ? "an" : "a" ) + " " + adj + " " + randomNoun() + "."; case 1: // deliberately non-grammatical, your instead of You're and a // instead of an. // e.g. Your a unemployed sand monkey. return "Your a " + randomAdjective() + " " + randomNoun() + "."; case 2: // e.g. You faggot! return "You " + randomNoun() + "!"; case 3: // e.g. We will bury you!" return "We will " + randomBraggingVerb() + " you!"; case 4: return randomPhrase(); case 5: // e.g. Blame it on the Russians! return "Blame it on " + randomScapegoat() + "!"; case 6: String verb = randomBraggingVerb(); // e.g. Nuke the whales! return Character.toUpperCase( verb.charAt( 0 ) ) + verb.substring( 1 ) + " " + randomScapegoat() + "!"; case 7: String scapegoat = randomScapegoat(); // e.g. The Russians hate America! return Character.toUpperCase( scapegoat.charAt( 0 ) ) + scapegoat.substring( 1 ) + " hate America!"; default: return "I can't think of anything to say."; } } /** * generate a random insulting adjective * * @return adjective */ private static String randomAdjective() { int adj; do { adj = ( wheel.nextInt() & Integer.MAX_VALUE ) % rudeAdjectives .length; } while ( adj == prevAdj ); prevAdj = adj; return rudeAdjectives[ adj ]; } /** * generate a random bragging word * * @return bragging word */ private static String randomBraggingVerb() { int braggingVerb; do { braggingVerb = ( wheel.nextInt() & Integer.MAX_VALUE ) % braggingVerbs .length; } while ( braggingVerb == prevBraggingVerb ); prevBraggingVerb = braggingVerb; return braggingVerbs[ braggingVerb ]; } /** * generate a random insulting noun * * @return noun */ private static String randomNoun() { int noun; do { noun = ( wheel.nextInt() & Integer.MAX_VALUE ) % rudeNouns.length; } while ( noun == prevNoun ); prevNoun = noun; return rudeNouns[ noun ]; } /** * generate a rude random phrase * * @return phrase */ private static String randomPhrase() { int phrase; do { phrase = ( wheel.nextInt() & Integer.MAX_VALUE ) % rudePhrases .length; } while ( phrase == prevPhrase ); prevPhrase = phrase; return rudePhrases[ phrase ]; } /** * generate a random scapegoat * * @return scapegoat */ private static String randomScapegoat() { int scapegoat; do { scapegoat = ( wheel.nextInt() & Integer.MAX_VALUE ) % rudeScapegoats .length; } while ( scapegoat == prevScapegoat ); prevScapegoat = scapegoat; return rudeScapegoats[ scapegoat ]; } /** * allocate all the components */ private void buildComponents() { title = new Label( TITLE_STRING + " " + VERSION_STRING ); title.setFont( FONT_FOR_TITLE ); title.setForeground( FOREGROUND_FOR_TITLE ); title2 = new Label( "released:" + RELEASE_DATE + " build:" + Build.BUILD_NUMBER ); title2.setFont( FONT_FOR_TITLE2 ); title2.setForeground( FOREGROUND_FOR_TITLE ); about = new Button( "about" ); about.setForeground( Color.white ); about.setForeground( FOREGROUND_FOR_BUTTON ); about.setFont( FONT_FOR_TITLE ); about.addActionListener( new ActionListener() { /** * called when user hits button * @param e end describing which button pushed. */ public void actionPerformed( ActionEvent e ) { // open aboutbox frame new CMPAboutBox( TITLE_STRING, VERSION_STRING, "Generates insults similar to those", "posted by Republicans in the alt.politics.bush newsgroup.", "freeware", RELEASE_DATE, FIRST_COPYRIGHT_YEAR, "Roedy Green", "INSULT" , "1.1" ); } } ); insultButton = new Button( "Insult Me!" ); // leave colours the default insultButton.setFont( FontFactory.build( "Dialog", Font.BOLD, 16 ) ); insultButton.addActionListener( new ActionListener() { /** * called when user hits button * @param e end describing which button pushed. */ public void actionPerformed( ActionEvent e ) { // change the insult. insultText.setText( generateInsult() ); } } ); insultText = new TextField( 80 ); insultText.setEditable( false ); insultText.setFont( FontFactory.build( "Dialog", Font.PLAIN, 15 ) ); insultText.setForeground( FOREGROUND_FOR_TEXT ); insultText.setBackground( BACKGROUND_FOR_FIELD ); insultText.setText( generateInsult() ); } /** * layout the components in a GridBag */ private void layoutComponents() { // Layout: // -------0----------1----------2 // 0 ---title--- -title2---- about // 1 -------insultText------------ // 2 ------------------------Insult! // x y w h wtx wty anchor fill T L B R padx pady this.add( title, new GridBagConstraints( 0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets( 10, 10, 5, 5 ), 0, 0 ) ); // x y w h wtx wty anchor fill T L B R padx pady this.add( title2, new GridBagConstraints( 1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets( 10, 5, 5, 5 ), 0, 0 ) ); // x y w h wtx wty anchor fill T L B R padx pady this.add( about, new GridBagConstraints( 2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets( 10, 5, 5, 10 ), 10, 3 ) ); // x y w h wtx wty anchor fill T L B R padx pady this.add( insultText, new GridBagConstraints( 0, 1, 3, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets( 5, 10, 5, 10 ), 0, 0 ) ); // x y w h wtx wty anchor fill T L B R padx pady this.add( insultButton, new GridBagConstraints( 2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets( 5, 5, 10, 10 ), 3, 3 ) ); } /** * Allow this Applet to run as as application as well. * * @param args command line arguments ignored. */ public static void main( String args[] ) { Hybrid.fireup( new Insult(), TITLE_STRING + " " + VERSION_STRING, APPLET_WIDTH, APPLET_HEIGHT ); } // end main /** * Called by the browser or Applet viewer to inform * this Applet that it is being reclaimed and that it should destroy * any resources that it has allocated. */ public void destroy() { about = null; insultButton = null; insultText = null; title = null; title2 = null; } /** * Called by the browser or Applet viewer to inform * this Applet that it has been loaded into the system. */ public void init() { if ( !VersionCheck.isJavaVersionOK( 1, 8, 0, this ) ) { return; } setBackground( BACKGROUND_FOR_BODY ); this.setLayout( new GridBagLayout() ); buildComponents(); layoutComponents(); validate(); setVisible( true ); } // end init }