You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

12 lines
458 B

function vierDiagonalLinks(allSpaltenArray) {
var Gewinner =0;
for (let i = 3; i <= allSpaltenArray.length; i++) {
for (let j = 0; j <= allSpaltenArray[0].length -3; j++) {
if (allSpaltenArray[j][i]===1 && allSpaltenArray[j+1][i-1]===1 && allSpaltenArray[j+2][i-2]===1 && allSpaltenArray[j+3][i-3]===1) {
Gewinner = 1;
}
}
}
return Gewinner;
}
module.exports = vierDiagonalLinks;