Shuffle an array in haxe nme here is a neat and clean method to suffle a array in haxe nme ===================================================== //declare outside class var totalflower:Array <Int>; var flowerArray:Array <String>; // flowerArray = ["img/f1.png","img/f2.png","img/f3.png","img/f4.png"]; totalflower = createArray(flowerArray.length ) ; totalflower = randomArray(totalflower); private function createArray(arraySize:Int) { var array:Array<Int> = new Array(); for (i in 0...arraySize) { array[i] = i; } return array; } private function randomArray(_array:Array<Int>) { var _length:Int= _array.length; var mixed:Array<Int>= _array.slice(0,_length); var rn:Int; var it:Int; var el:Int; for (i in 0..._array.length) { el = mixed[i]; rn = Math.floor(Math.random() * _length); ...
all about coding especially in javascript, daily used algorithms, react, angular and other gaming stuffs like webgl, pixijs, three.js and cocos2dx running code sample especially in javascript and c++.