Illuminami!!
Dunque..
Ho il seguente codice..
//------------------------------------------
stop();
var NUMERI_SCELTI = new Array();
var sublist = new Array();
//var a_length = range; //lunghezza dell'array TUTTI
function genera_sistema_da_tabella() {
var n_length = quanti; // lunghezza dell'array COMPONENTI
var n_array = quante; // lunghezza dell'array COMBINAZIONI GENERATE
// GENERAZIONE COMBINAZIONI CASUALI CON NUMERI "CLICCATI" SCELTI
function generateNew(origin,len) {
var gen = new Array();
for (var i = 0; i<len; i++) {
var pos = Math.round(Math.random()*origin.length)-1;
gen.push(origin.splice(pos, 1));
}
return gen;
}
while (n_array) {
var temp = generateNew(NUMERI_SCELTI.slice(), n_length);
sublist.push(temp);
n_array--
array_disordinato= _root.sublist.slice().join(" \n ")
_root.testo4.text =array_disordinato;
_root.testo3.text = _root["NUMERI_SCELTI"+i];
numeriscelti=_root.testo4.text =array_disordinato;
}
}
//--fine
Bhe funziona tutto ok tranne l'ordinamento di array_disordinato...![]()
Infatti se escono numeri come 1,3,4, .. 9 non me li mette in ordine rispetto ai loro confratelli a due cifre ma mi mostra sempre qualcosa di assurdo tipo:
1,2,34,4,47,5
anzichè ordinarmeli correttamente come
1,2,4,5,34,47 seguendo l'esempio postato sopra...
Illuminami dove fagiano!!!
THANKS!!!![]()

Rispondi quotando