sukesam #1190(2007/07/20 17:26 GMT) [ ActionScript ] Rating0/0=0.00
1 2 3 4 5 6 7 8 9 10
private function execute(n:int, m:int):void { var res:Array = []; for (var i:int = 0; i < m;) { var r:int = Math.floor(Math.random() * n); if (res.indexOf(r) >= 0) continue; i++; res.push(r); } Alert.show(res.toString()); }
Rating0/0=0.00-0+
[ reply ]
sukesam #1190() [ ActionScript ] Rating0/0=0.00
private function execute(n:int, m:int):void { var res:Array = []; for (var i:int = 0; i < m;) { var r:int = Math.floor(Math.random() * n); if (res.indexOf(r) >= 0) continue; i++; res.push(r); } Alert.show(res.toString()); }Rating0/0=0.00-0+
[ reply ]