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