Advertisement
Flip

Untitled

Apr 10th, 2013
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         public function testrng():void {
  2.             var a:int;
  3.             var b:int;
  4.             for (var i:int = 0;i<500;i++) {
  5.                 var n:Number = Math.round(Math.random());
  6.                 if (n == 1) { a++; }
  7.                 else if (n == 0) { b++; }
  8.             }
  9.             trace("500 calls - 1's:" +a +"- 0's:" + b);
  10.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement