text: export default class BaseballGame {
    play(computerInputNumbers, userInputNumbers) {
      const answer = computerInputNumbers;
      const input = userInputNumbers;
      const strikeResult = this.strike(answer,input);
      const ballResult = this.ball(answer,input);
      let result = "";
      
      // 스트라이크, 볼, 아웃 구현
      if(strikeResult === 3) result = "정답!!";
      else if (strikeResult === 0 && ballResult === 0) result = "3아웃";
      else if (strikeResult > 0 && ballResult > 0) result = `${ballResult}볼 ${strikeResult}스트라이크`;
      else if (strikeResult > 0 && ballResult === 0) result = `${strikeResult}스트라이크`
      else if (strikeResult === 0 && ballResult > 0) result = `${ballResult}볼`
      return result;
    }
  
    strike(computerInputNumbers, userInputNumbers) {
      let strike = 0;
      computerInputNumbers.forEach((element,index) => {
        if(element === userInputNumbers[index]) strike++;
      });
      return strike;
    }
  
    ball(computerInputNumbers, userInputNumbers) {
      let ball = 0;
      userInputNumbers.forEach((element, index)=> {
        if(computerInputNumbers.includes(element) && index !== computerInputNumbers.indexOf(element)) ball++;
      });
      return ball;
    }
  }
  