function chooseCard(e) {
  generateRandomNumber();
  let target = e.target;
  if (target.classList.value === 'card') {
    tabsArray.splice(tabsArray.indexOf(target), 1);
    target.innerHTML = player;
    target.classList.value += ' player';
    checkGameOver();
    if (tabsArray.length !== 0) {
      tabsArray[index].innerHTML = opponent;
      tabsArray[index].classList.value += ' opponent';
      tabsArray.splice(index, 1);
    }
  }
  checkGameOver();
}
// Player choosing the card to fill and the calculator chooses a random card

Player choosing the card to fill and the calculator chooses a random card
Player choosing the card to fill and the calculator chooses a random card
function chooseCard(e) {
  generateRandomNumber();
  let target = e.target;
  if (target.classList.value === 'card') {
    tabsArray.splice(tabsArray.indexOf(target), 1);
    target.innerHTML = player;
    target.classList.value += ' player';
    checkGameOver();
    if (tabsArray.length !== 0) {
      tabsArray[index].innerHTML = opponent;
      tabsArray[index].classList.value += ' opponent';
      tabsArray.splice(index, 1);
    }
  }
  checkGameOver();
}
function chooseCard ( e ) { generateRandomNumber ( ) ; let target = e . target ; if ( target . classList . value === 'card' ) { tabsArray . splice ( tabsArray . indexOf ( target ) , 1 ) ; target . innerHTML = player ; target . classList . value += ' player' ; checkGameOver ( ) ; if ( tabsArray . length !== 0 ) { tabsArray [ index ] . innerHTML = opponent ; tabsArray [ index ] . classList . value += ' opponent' ; tabsArray . splice ( index , 1 ) ; } } checkGameOver ( ) ; }
Player choosing the card to fill and the calculator chooses a random card
Player choosing the card to fill and the calculator chooses a random card