diff --git a/code/index.html b/code/index.html
index c493583..454a630 100644
--- a/code/index.html
+++ b/code/index.html
@@ -12,7 +12,7 @@
Objectif
-
+
@@ -182,7 +182,6 @@
tab1.forEach(element => {
if(typeof element!= "boolean")
{
- console.log(element.toString()+" n'est pas bool");
tabTotal.push(element);
}
})
@@ -235,7 +234,7 @@
}
})
}
- //checkAllOK();
+ checkAllOK();
toutDessiner(tabTotal,canvasT,ctxT);
}
else{
@@ -312,8 +311,18 @@
return Math.floor(Math.random() * Math.floor(max))+1;
}
+ function copyMDArray(array) //permet la copie d'arrays sans copier les références
+ {
+ var newArray = [];
+ array.forEach(element => {
+ newArray.push(Array.from(element))
+ });
+ return newArray
+ }
+
function generateEasy(){
- tabObj=[Array.from(tab1),Array.from(tab2),Array.from(tab3),Array.from(tab4)];
+ console.log(copyMDArray(tab1))
+ tabObj=[copyMDArray(tab1),copyMDArray(tab2),copyMDArray(tab3),copyMDArray(tab4)];
tabObjCmp=[];
actions=getRandomInt(8)+1;