Wednesday, 15 January 2014

How to get random 1 or -1 in canvas (javascript)? -


How can I get random -1 or 1 (not between 1 or 1, only -1 or 1, only This 2 values) in canvas?

I know that I can use it to get a random number:

  Math.random ()  

But I should only have random 1 or -1

  var plusOrMinus = Math.random () and Lieutenant; 0.5? -1 1;  

(Please use search first)


No comments:

Post a Comment