function checkWinner(arr) {
function Eq(a, b, c) {
return a != 0 && a == b && a == c;
}
for (let i = 0; i < 3; i++) {
// check rows
if (Eq(arr[0][i], arr[1][i], arr[2][i])) {
return arr[0][i]
}
// check cols
if (Eq(arr[i][0], arr[i][1], arr[i][2])) {
return arr[i][0]
}
}
// check diagonal
if (Eq(arr[0][0], arr[1][1], arr[2][2])) {
return arr[0][0]
}
if (Eq(arr[0][2], arr[1][1], arr[2][1])) {
return arr[0][2]
}
return 0
}
Address: 91.108.56.0 01011011.01101100.001110 00.00000000
Netmask: 255.255.252.0 = 22 11111111.11111111.111111 00.00000000
Wildcard: 0.0.3.255 00000000.00000000.000000 11.11111111
=>
Network: 91.108.56.0/22 01011011.01101100.001110 00.00000000
Address: 91.108.57.58 01011011.01101100.001110 01.00111010
Netmask: 255.255.252.0 = 22 11111111.11111111.111111 00.00000000
Wildcard: 0.0.3.255 00000000.00000000.000000 11.11111111
=>
Network: 91.108.56.0/22 01011011.01101100.001110 00.00000000
Network - совпадает, значит они в одной подсети.Address: 91.108.51.1 01011011.01101100.001100 11.00000001
Netmask: 255.255.252.0 = 22 11111111.11111111.111111 00.00000000
Wildcard: 0.0.3.255 00000000.00000000.000000 11.11111111
=>
Network: 91.108.48.0/22 01011011.01101100.001100 00.00000000
Тут сеть отличается.