|
|
|
@ -14,7 +14,9 @@ function isSet(cards)
|
|
|
|
|
for(let j = 0; j < attributesMatrix.length; j++) {
|
|
|
|
|
listAttributes.push(attributesMatrix[j][i]);
|
|
|
|
|
}
|
|
|
|
|
if(!checkAttributes(listAttributes)){
|
|
|
|
|
console.log("JE SUIS LES ATTRIBUTS")
|
|
|
|
|
console.log(listAttributes)
|
|
|
|
|
if(!checkAttributes2(listAttributes,attributesMatrix.length)){
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -23,6 +25,17 @@ function isSet(cards)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function checkAttributes2(params,length) {
|
|
|
|
|
var tab = []
|
|
|
|
|
params.forEach(element => {
|
|
|
|
|
if (!tab.includes(element)) {
|
|
|
|
|
tab.push(element)
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
console.log(tab.length === 1 || tab.length === length)
|
|
|
|
|
return tab.length === 1 || tab.length === length;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function checkAttributes(attributes){
|
|
|
|
|
let orderingMethod = "null"; // Can only take ["null", "same", "different"]
|
|
|
|
|
let boolLoop = true;
|
|
|
|
|