function _intermediateAI() {
    const map = _findEmptyPositions();
    switch (obj.round) {
      case 0:
        firstOptimalMove();
        break;
      case 2:
        map.includes(8) ? _move(8) : _move(6);
        break;
      case 4:
        if (map.includes(2)) {
          _move(2);
        } else if (map.includes(0)) {
          if (!map.includes(2) && !map.includes(8)) {
            _move(5);
          } else {
            _move(0);
          }
        } else if (!map.includes(2) && !map.includes(8)) {
          _move(6);
        } else {
          _basicAI;
        }
        break;
      case 6:
      case 8:
        _basicAI();
        break;
    }
  }
// plays in an intermediate pattern, else picks randomly
plays in an intermediate pattern, else picks randomly
plays in an intermediate pattern else picks randomly
function _intermediateAI() {
    const map = _findEmptyPositions();
    switch (obj.round) {
      case 0:
        firstOptimalMove();
        break;
      case 2:
        map.includes(8) ? _move(8) : _move(6);
        break;
      case 4:
        if (map.includes(2)) {
          _move(2);
        } else if (map.includes(0)) {
          if (!map.includes(2) && !map.includes(8)) {
            _move(5);
          } else {
            _move(0);
          }
        } else if (!map.includes(2) && !map.includes(8)) {
          _move(6);
        } else {
          _basicAI;
        }
        break;
      case 6:
      case 8:
        _basicAI();
        break;
    }
  }
function _intermediateAI ( ) { const map = _findEmptyPositions ( ) ; switch ( obj . round ) { case 0 : firstOptimalMove ( ) ; break ; case 2 : map . includes ( 8 ) ? _move ( 8 ) : _move ( 6 ) ; break ; case 4 : if ( map . includes ( 2 ) ) { _move ( 2 ) ; } else if ( map . includes ( 0 ) ) { if ( ! map . includes ( 2 ) && ! map . includes ( 8 ) ) { _move ( 5 ) ; } else { _move ( 0 ) ; } } else if ( ! map . includes ( 2 ) && ! map . includes ( 8 ) ) { _move ( 6 ) ; } else { _basicAI ; } break ; case 6 : case 8 : _basicAI ( ) ; break ; } }
plays in an intermediate pattern, else picks randomly
plays in an intermediate pattern else picks randomly