|
|
|
@ -446,6 +446,18 @@ function generate2(col, matchs, fork) {
|
|
|
|
|
showDiv(document.querySelector('#playPage'));
|
|
|
|
|
resetAllTabs(false);
|
|
|
|
|
|
|
|
|
|
arrayPorte = [
|
|
|
|
|
[document.querySelector("#logique1").checked, "et"],
|
|
|
|
|
[document.querySelector("#logique2").checked, "ou"],
|
|
|
|
|
[document.querySelector("#logique3").checked, "inv"],
|
|
|
|
|
[document.querySelector("#logique4").checked, "etnon"],
|
|
|
|
|
[document.querySelector("#logique5").checked, "nonou"]
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
arrayPorte = arrayPorte.filter(function (e) {
|
|
|
|
|
if (e[0] === true) return e;
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
var numberCol = col.length;
|
|
|
|
|
var numberPerCol = [];
|
|
|
|
|
numberPerColonne = [];
|
|
|
|
@ -512,17 +524,16 @@ function generate2(col, matchs, fork) {
|
|
|
|
|
//Attribution des types
|
|
|
|
|
//num = liste de comptatibilité
|
|
|
|
|
|
|
|
|
|
let num2 = getRandomArbitrary(0, 5);
|
|
|
|
|
let num2 = getRandomArbitrary(0, arrayPorte.length);
|
|
|
|
|
for (x in listeLogiqueObj) {
|
|
|
|
|
if (listeLogiqueObj[x].matchId1 !== null) {
|
|
|
|
|
if (getElementArray(listeLogiqueObj[x].matchId1, listeSame)[1] === null) {
|
|
|
|
|
getElementArray(listeLogiqueObj[x].matchId1, listeSame)[1] = num2;
|
|
|
|
|
getElementArray(listeLogiqueObj[x].matchId1, listeSame)[1] = arrayPorte[num2][1];
|
|
|
|
|
console.log(listeLogiqueObj[x].matchId2);
|
|
|
|
|
if (listeLogiqueObj[x].matchId2 !== null && getElementArray(listeLogiqueObj[x].matchId2, listeSame)[1] === null) {
|
|
|
|
|
getElementArray(listeLogiqueObj[x].matchId2, listeSame)[1] = num2;
|
|
|
|
|
console.log("oui")
|
|
|
|
|
getElementArray(listeLogiqueObj[x].matchId2, listeSame)[1] = arrayPorte[num2][1];
|
|
|
|
|
}
|
|
|
|
|
num2 = getRandomArbitrary(0, 5);
|
|
|
|
|
num2 = getRandomArbitrary(0, arrayPorte.length);
|
|
|
|
|
} else {
|
|
|
|
|
listeSame[x] = getElementArray(listeLogiqueObj[x].matchId1, listeSame);
|
|
|
|
|
}
|
|
|
|
@ -547,25 +558,9 @@ function generate2(col, matchs, fork) {
|
|
|
|
|
initTimer();
|
|
|
|
|
//creation logique
|
|
|
|
|
listeLogiqueObj.forEach(function (logique) {
|
|
|
|
|
if (getTypeFromSameMatch(listeSame, logique.matchId1) === null) logique.type = getRandomArbitrary(0, 5);
|
|
|
|
|
if (getTypeFromSameMatch(listeSame, logique.matchId1) === null) logique.type = arrayPorte[getRandomArbitrary(0, arrayPorte.length)][1];
|
|
|
|
|
else logique.type = getTypeFromSameMatch(listeSame, logique.matchId1);
|
|
|
|
|
switch (logique.type) {
|
|
|
|
|
case 0:
|
|
|
|
|
insertLogiqueColonne(logique.id, "et", logique.col - 1);
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
insertLogiqueColonne(logique.id, "ou", logique.col - 1);
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
insertLogiqueColonne(logique.id, "inv", logique.col - 1);
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
insertLogiqueColonne(logique.id, "nonou", logique.col - 1);
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
insertLogiqueColonne(logique.id, "etnon", logique.col - 1);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
insertLogiqueColonne(logique.id, logique.type, logique.col - 1);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var logiquesGen;
|
|
|
|
|