function draw(catX){
    // if the deck is empty, we prep it and fill it with data
    if (fresh[catX].length == 0) {
        prepDeck(catX);
    }

    // freshX is just a random number that is selected in comparison to the lenth of the deck
    let freshX = Math.floor(Math.random()*fresh[catX].length);
    // cardX is the actual card drawn from the deck, a splice is performed to remove that it from the master list
    let cardX = fresh[catX].splice(freshX, 1)[0];
    return categories[catX].deck[cardX];
}
// Draw a card from a specific deck - shuffle if the length of the deck is 0
Draw a card from a specific deck - shuffle if the length of the deck is 0
Draw a card from a specific deck - shuffle if the length of the deck is 0
function draw(catX){
    if (fresh[catX].length == 0) {
        prepDeck(catX);
    }
    let freshX = Math.floor(Math.random()*fresh[catX].length);
    let cardX = fresh[catX].splice(freshX, 1)[0];
    return categories[catX].deck[cardX];
}
function draw ( catX ) { if ( fresh [ catX ] . length == 0 ) { prepDeck ( catX ) ; } let freshX = Math . floor ( Math . random ( ) * fresh [ catX ] . length ) ; let cardX = fresh [ catX ] . splice ( freshX , 1 ) [ 0 ] ; return categories [ catX ] . deck [ cardX ] ; }
Draw a card from a specific deck - shuffle if the length of the deck is 0
Draw a card from a specific deck - shuffle if the length of the deck is 0
// if the deck is empty, we prep it and fill it with data // freshX is just a random number that is selected in comparison to the lenth of the deck // cardX is the actual card drawn from the deck, a splice is performed to remove that it from the master list