function countBovine(num, guess) {
    var count = {bulls:0, cows:0};
    var g = guess.join('');
    for (var i = 0; i < num.length; i++) {
        var digPresent = g.search(num[i]) != -1;
        if (num[i] == guess[i]) count.bulls++;
        else if (digPresent) count.cows++;
    }
    console.log("Guess: " + g + ".\nBulls: " + count.bulls + ". Cows: " + count.cows + ".");
    return count;
}
/* Counts the bulls and cows in the current entry.
 * ------------------------------------------------------------------------- */
Counts the bulls and cows in the current entry.
Counts the bulls and cows in the current entry .
function countBovine(num, guess) {
    var count = {bulls:0, cows:0};
    var g = guess.join('');
    for (var i = 0; i < num.length; i++) {
        var digPresent = g.search(num[i]) != -1;
        if (num[i] == guess[i]) count.bulls++;
        else if (digPresent) count.cows++;
    }
    console.log("Guess: " + g + ".\nBulls: " + count.bulls + ". Cows: " + count.cows + ".");
    return count;
}
function countBovine ( num , guess ) { var count = { bulls : 0 , cows : 0 } ; var g = guess . join ( '' ) ; for ( var i = 0 ; i < num . length ; i ++ ) { var digPresent = g . search ( num [ i ] ) != - 1 ; if ( num [ i ] == guess [ i ] ) count . bulls ++ ; else if ( digPresent ) count . cows ++ ; } console . log ( "Guess: " + g + ".\nBulls: " + count . bulls + ". Cows: " + count . cows + "." ) ; return count ; }
Counts the bulls and cows in the current entry.
Counts the bulls and cows in the current entry .