update Checkqttriutes
continuous-integration/drone/push Build is passing Details

pull/88/head
Aurian JAULT 2 years ago
parent 6a06222449
commit 070a72162c

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

Loading…
Cancel
Save