index.js
/**
     * Update all lines weight of all squares
     */
Update all lines weight of all squares
Update all lines weight of all squares
function updateSquaresLinesWeight() {
        for (let i = 0; i < lines.length; i++) {
            lines[i].weight = 0;
        }
        for (let i = 0; i < squares.length; i++) {
            updateSquareLinesWeight(squares[i].id);
        }
    }
function updateSquaresLinesWeight ( ) { for ( let i = 0 ; i < lines . length ; i ++ ) { lines [ i ] . weight = 0 ; } for ( let i = 0 ; i < squares . length ; i ++ ) { updateSquareLinesWeight ( squares [ i ] . id ) ; } }
Update all lines weight of all squares
Update all lines weight of all squares
// First reset weight of all lines // Update line weights by squares