Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. function answerMe() {
  2. var roll = Math.floor(Math.random()*20); // generates the random number between 0 and 19
  3. var answers = [ 'You may rely on it', 'Outlook good', 'Very doubtful',
  4. 'My sources say no', 'Yes', 'Cannot predict now',
  5. 'Don\'t count on it', 'Signs point to yes', 'As I see it, yes',
  6. 'It is certain', 'Reply hazy, try again', 'My reply is no',
  7. 'Concentrate and ask again', 'Without a doubt',
  8. 'Better not tell you now', 'Ask again later', 'Outlook not so good',
  9. 'It is decidedly so', 'Most likely', 'Yes definitely'];
  10. // Big array with all the answers
  11.  
  12. return answers[roll];
  13. // Returns the answer with the index of the random roll
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement