edit: simplification de la methode de division du contenu avec array.split()
This commit is contained in:
+3
-9
@@ -200,15 +200,9 @@ import { toRaw } from 'vue'
|
||||
return Math.floor(Math.random() * (max - min+1)) + min;
|
||||
},
|
||||
createEmptyArray(){
|
||||
for (let i = 0;i<this.partOne;i++){
|
||||
this.partOneItem.splice(i,0,this.randomItems[i]);
|
||||
}
|
||||
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]);
|
||||
}
|
||||
this.partOneItem = this.randomItems.slice(0, this.partOne);
|
||||
this.partTwoItem = this.randomItems.slice(this.partOne, this.partOne + this.partTwo);
|
||||
this.partThreeItem = this.randomItems.slice(this.partOne + this.partTwo);
|
||||
console.log(this.partOneItem,this.partTwoItem,this.partThreeItem);
|
||||
},
|
||||
genCoord(chain){
|
||||
|
||||
Reference in New Issue
Block a user