How to generate a whole number between 0-2? : <p>Ok so this is the code:</p>

<pre><code>    var i = prompt('Rock, Paper or scissors?');
var b = ['Rock', 'Paper', 'Scissors'];
</code></pre>

<p>Now, I need to generate (Correct me if I'm wrong please) a number between 0-2. My idea is (Well, was) this:</p>

<pre><code>var i = prompt('Rock, Paper or scissors?');
var b = ['Rock', 'Paper', 'Scissors'];
document.write(Math.random(0, 2));
var c = //the code I can't figure out
document.write(b[c]);
</code></pre>

<p>Any thoughts?</p>
