Created
October 7, 2011 05:36
-
-
Save DmitriyKirakosyan/1269544 to your computer and use it in GitHub Desktop.
simple random for misha
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function random2():void { | |
var randoms:Vector.<int> = new Vector.<int>(); | |
var sumRandoms:int = 0; | |
var tempRnd:int; | |
var canEnd:Boolean = true; | |
for (var i:int = 0; i < 5; i++) { | |
randoms.forEach(function(item:int, ..._):void { sumRandoms += item; } | |
randoms.push(Math.random() * ((100-sumRandoms) / (5-i)) + sumRandoms); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment