function initGame(level) {
    gBoard = buildBoard(level);
    renderBoard(gBoard);

    var elTimer = document.querySelector('.timer');
    elTimer.innerText = 0;

    gState = {
        isGameOn: false, // boolean, when true we let the user play
        shownCount: 0, //how many cells are shown
        markedCount: 0, //how many cells are marked (with a flag)
        secsPassed: 0 //how many seconds passed
    }
}
//This is called when page loads
This is called when page loads
This is called when page loads
function initGame(level) {
    gBoard = buildBoard(level);
    renderBoard(gBoard);
    var elTimer = document.querySelector('.timer');
    elTimer.innerText = 0;
    gState = {
        isGameOn: false, 
        shownCount: 0, 
        markedCount: 0, 
        secsPassed: 0 
    }
}
function initGame ( level ) { gBoard = buildBoard ( level ) ; renderBoard ( gBoard ) ; var elTimer = document . querySelector ( '.timer' ) ; elTimer . innerText = 0 ; gState = { isGameOn : false , shownCount : 0 , markedCount : 0 , secsPassed : 0 } }
This is called when page loads
This is called when page loads
// boolean, when true we let the user play //how many cells are shown //how many cells are marked (with a flag) //how many seconds passed