ckrbd.js
//Function indexALevel calls visit for every node in a given level.  
Function indexALevel calls visit for every node in a given level.
Function indexALevel calls visit for every node in a given level .
function indexALevel(visit,level){
    let dsibs = hvDistBetweenSibs(level);
    let halfdsibs = dsibs>>1;
    let goOn = 0;
    if (level&1){ 
        for (let i=halfdsibs; i<pyrHeight; i+=dsibs)
            for (let j=halfdsibs; j<pyrWidth; j+=dsibs) 
                goOn += visit(i,j,level);
    } else { 
        for (let i=0; i<pyrHeight; i+= halfdsibs) {
            for (let j=((i/halfdsibs)&1)?0:halfdsibs; j<pyrWidth; j+=dsibs)
                goOn += visit(i,j,level);  
        }
    }
    return goOn;
}
function indexALevel ( visit , level ) { let dsibs = hvDistBetweenSibs ( level ) ; let halfdsibs = dsibs >> 1 ; let goOn = 0 ; if ( level & 1 ) { for ( let i = halfdsibs ; i < pyrHeight ; i += dsibs ) for ( let j = halfdsibs ; j < pyrWidth ; j += dsibs ) goOn += visit ( i , j , level ) ; } else { for ( let i = 0 ; i < pyrHeight ; i += halfdsibs ) { for ( let j = ( ( i / halfdsibs ) & 1 ) ? 0 : halfdsibs ; j < pyrWidth ; j += dsibs ) goOn += visit ( i , j , level ) ; } } return goOn ; }
Function indexALevel calls visit for every node in a given level.
Function indexALevel calls visit for every node in a given level .
//odd //even