Insult generator

By Korvin on Mar 07, 2010

Generates insults, html is as follows:

<script> 
GIVEN SCRIPT
</script> 
<body onload='setIns()'> 
<div id='insult'></div> 
<button onclick='setIns()'>New Insult</button> 
</body>

first line:

var n=Array(NOUNS), p=Array(GERUNDS);

first array needs to be atleast 2 nouns, 2nd has to be a gerund (word that ends in ing or er) without the ing or er, ex: Spinning or Spinner would be spinn.

options with given nouns and gerunds:

You're a drink grunting goat spinner.
You're a drink spinning goat spinner.
You're a drink grunting goat grunter.
You're a drink spinning goat grunter.

You're a goat grunting drink spinner.
You're a goat spinning drink spinner.
You're a goat grunting drink grunter.
You're a goat spinning drink grunter.
var n=Array('drink','goat'), p=Array('spinn','grunt');
function gW(t){return(t == 1)?n[Math.floor(Math.random()*n.length)]:p[Math.floor(Math.random()*p.length)];}
function setIns(){
    var f=gW(1), v=(/^[aeiou]/i.test(f)==true)?'an':'a';for(s=gW(1);s==f;s=gW(1));
    document.getElementById('insult').innerText="You're "+v+" "+f+" "+gW()+"ing "+s+" "+gW()+"er."; 
}

Comments

Sign in to comment.
sunslayer   -  Mar 09, 2010

people tend not to comment on non-msl snippets sadly...

 Respond  
TheNitelyfe   -  Mar 08, 2010

lol nice one

 Respond  
Korvin   -  Mar 08, 2010

this is a good code =[

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.