edit: simplification de la methode de division du contenu avec array.split()

This commit is contained in:
2026-03-01 05:21:27 +01:00
parent 49cd0cfc22
commit ab0509d45f
+3 -9
View File
@@ -200,15 +200,9 @@ import { toRaw } from 'vue'
return Math.floor(Math.random() * (max - min+1)) + min; return Math.floor(Math.random() * (max - min+1)) + min;
}, },
createEmptyArray(){ createEmptyArray(){
for (let i = 0;i<this.partOne;i++){ this.partOneItem = this.randomItems.slice(0, this.partOne);
this.partOneItem.splice(i,0,this.randomItems[i]); this.partTwoItem = this.randomItems.slice(this.partOne, this.partOne + this.partTwo);
} this.partThreeItem = this.randomItems.slice(this.partOne + this.partTwo);
for (let j = this.partOne;j<this.partTwo+this.partOne-1;j++){
this.partTwoItem.splice(j,0,this.randomItems[j]);
}
for (let k = this.partTwo+this.partOne-1;k<this.randomItems.length;k++){
this.partThreeItem.splice(k,0,this.randomItems[k]);
}
console.log(this.partOneItem,this.partTwoItem,this.partThreeItem); console.log(this.partOneItem,this.partTwoItem,this.partThreeItem);
}, },
genCoord(chain){ genCoord(chain){