Why? To please the rich programmer! Have you ever wanted to ask the compiler "Why?" Most of us have been frustrated when the code isn't working as it should. Mathworks has therefore implemented a nice little function, why, that answers the question. To give a few examples from MATLAB:

why
The programmer suggested it.

why
To fool the tall good and smart system manager.    

why(2)
You insisted on it.

why(46)
Bill insisted on it.


Your task is to implement the why function in your language. The function should work with and without an input argument (alternatively use input 0 or -1). The function must be named why (or, writing why(n) in STDIN should result in the appropriate string being printed).  

If no argument is given, or the argument is zero or negative, the output string should be a random, valid phrase.  So, there should be a function why, why(), why(0) or why(-1) that returns a random sentence.  

If an input argument, n is given (function argument, not STDIN), the output should be the n'th string (defined below). So, why(1) should always output (print/display) the same result.

The sentences are built up as follows (Type 1, Type 2 and Special). All sentences end with !.

"Person" "ending" !
"Verb" "adjective" "Person" !
A list of special cases


The list of persons:

Stewie
Peter
Homer
The programmer
The system manager
You


The list of endings:

suggested it
insisted on it
did it


The list of verbs are:

To fool
To satisfy
To please


The list of adjectives:

the smart
the bald
the tall
the rich
the stupid


The list of special cases:

How should I know?
Stop asking!
Don't ask!


The way to select a numbered one is:

Type of sentences:

Odd number =&gt; Type 1
Even number =&gt; Type 2
n % 7 = 0 =&gt; Type 3 (% is the modulus operator)


Names: The nth name is defined using modulus (%).

n = 1:   1 % 7  =&gt; Stewie
n = 2:   2 % 7  =&gt; Peter
...
n = 6:   6 % 7  =&gt; You
n = 7:   7 % 7  =&gt; How should I know?
n = 11:  11 % 7 =&gt; The programmer
n = 14:  14 % 7 =&gt; Stop asking!
n = 21:  21 % 7 =&gt; Don't ask!


Endings: The nth ending is also defined using the modulus. Assume the endings (1, 2 and 3) are listed like (1 2 2 3). As the numbers are always odd, use ((n+1)/2 % 4)

n = 1:    ((1+1)/2 % 4)  =&gt; suggested it
n = 3:    ((3+1)/2 % 4)  =&gt; insisted on it
n = 13:   ((13+1)/2 % 4) =&gt; did it


Adjectives: The nth adjective is defined using the modulus. As the numbers are always even, use: (n % 10)/2

n = 2:   (2 % 10)/2 =&gt; Smart
n = 6:   (6 % 10)/2 =&gt; The tall
...


Verbs: The nth verb is also defined using the modulus. Assume the verbs (1, 2 and 3) are listed like (1 2 2 3) As the numbers are always even for verbs, use (n % 8) / 2

n = 2:   (2 % 8)/2 =&gt; To fool
n = 4:   (4 % 8)/2 =&gt; To satisfy
n = 6:   (6 % 8)/2 =&gt; To satisfy
n = 8:   (8 % 8)/2 =&gt; To please


Now, the way to create a random one should be fairly simple, simply select a random n.

Some examples:

why
You suggested it!

why
To fool the tall Homer!

why
Don't ask!

why(1)
Stewie suggested it!

why(14)
Stop asking!

why(8)
To please the rich Stewie!


Standard code golf rules apply. A winner will be selected one week from the day the challenge was posted.
JavaScript (ES6) 345

Not sure about the numbers, but here is my attempt.

Test running the snippet below in an EcmaScript compliant browser.



why=n=&gt;(n&lt;1?n=Math.random()*840|0:0,s="suggested,insisted on,did,fool,satisfy,please,stupid,smart,bald,tall,rich,Don't ask!,How should I know?,Stop asking!,Stewie,Peter,Homer,programmer,system manager,You".split`,`,n%7?(p=s[n%7+13],n&amp;1?(p&gt;'a'?'The ':'')+p+` ${s['2011'[-~n/2%4]]} it!`:`To ${s['5344'[n%8/2]]} the ${s[n/2%5+6]} ${p}!`):s[11+n%3])  

for(o='',i=0;++i&lt;1e3;)o+=i+':'+why(i)+'\n';O.innerHTML=o

function test() { R.innerHTML=why(+I.value) }

// Less golfed

WHY=n=&gt;(
  n=n&lt;1?Math.random()*999|0:n,
  s=["suggested", "insisted on", "did", "fool", "satisfy", "please",
     "stupid", "smart", "bald", "tall", "rich",
     "Don't ask!", "How should I know?", "Stop asking!",
     "Stewie", "Peter", "Homer", "programmer", "system manager", "You"],
  n%7
    ? ( p=s[n%7+13],
        n&amp;1
        ? (p&gt;'a'?'The ':'')+p+` ${s['2011'[-~n/2%4]]} it!`
        : `To ${s['5344'[n%8/2]]} the ${s[n/2%5+6]} ${p}!`)
    : s[11+n%3]
)  
#O { height:300px; width:50%; overflow:auto }
#I { width:2em }
Why(&lt;input id=I&gt;)&lt;button onclick=test()&gt;-&gt;&lt;/button&gt;&lt;span id=R&gt;&lt;/span&gt;
&lt;pre id=O&gt;