function pickRandomPlant(plants) {
    const randomPlant = Math.floor(Math.random() * plants.length);
    const plant = plants[randomPlant];
    if (plant === lastPlant) {
        return pickRandomPlant(plants);
    }

    lastPlant = plant;
    return plant;
}
// This function selects the andom plants from which aliens ambush you
This function selects the andom plants from which aliens ambush you
This function selects the andom plants from which aliens ambush you
function pickRandomPlant(plants) {
    const randomPlant = Math.floor(Math.random() * plants.length);
    const plant = plants[randomPlant];
    if (plant === lastPlant) {
        return pickRandomPlant(plants);
    }
    lastPlant = plant;
    return plant;
}
function pickRandomPlant ( plants ) { const randomPlant = Math . floor ( Math . random ( ) * plants . length ) ; const plant = plants [ randomPlant ] ; if ( plant === lastPlant ) { return pickRandomPlant ( plants ) ; } lastPlant = plant ; return plant ; }
This function selects the andom plants from which aliens ambush you
This function selects the andom plants from which aliens ambush you