<commit_before>

var ballContactsPaddle = function(ball, paddle){
  if( ball.bottomEdge().y == paddle.topSide()){
    if (ball.x >= paddle.surfaceRange()[0] && ball.x <= paddle.surfaceRange()[1]){
      return true;
    }
  }
  return false
}

var paddleBounce = function(ball, paddle){
    if ( ball.x.isBetween(paddle.leftEdge()[0],paddle.leftEdge()[1])){
      sharpBounce('left', ball);
    } else if ( ball.x.isBetween(paddle.rightEdge()[1],paddle.rightEdge()[0])){
      sharpBounce('right', ball);
  } else {
    ball.reverseYVelocity()
  }
};

var sharpBounce = function (side, ball) {
  if (side == 'left'){
    console.log('sharp left')
    if ( ball.velocityX > 0 ){
      ball.velocityX += 3
      ball.velocityX = -ball.velocityX
      ball.reverseYVelocity()
    } else {
      ball.velocityX += -3
      ball.reverseYVelocity()
    }
  } else if (side == 'right'){
    console.log('sharp right')
    if ( ball.velocityX > 0 ){
      ball.velocityX += 3
      ball.reverseYVelocity()
    } else {
      ball.velocityX += -3
      ball.velocityX = -ball.velocityX
      ball.reverseYVelocity()
    }
  }
}

var ballContactsBrick = function(ball, bricks){
  // debugger;
  for (var layer in bricks){
    bricks[layer].map(function(brick){
      if ( ball.topEdge().y == brick.verticalRange()[1]){
        if ( ball.topEdge().x >= brick.horizontalRange()[0] && ball.topEdge().x <= brick.horizontalRange()[1]){
          return true;
        };
      };
    })
  };
}
<commit_msg>Create brick ball bounce function<commit_after>

var ballContactsPaddle = function(ball, paddle){
  if( ball.bottomEdge().y == paddle.topSide()){
    if (ball.x >= paddle.surfaceRange()[0] && ball.x <= paddle.surfaceRange()[1]){
      return true;
    }
  }
  return false
}

var paddleBounce = function(ball, paddle){
    if ( ball.x.isBetween(paddle.leftEdge()[0],paddle.leftEdge()[1])){
      sharpBounce('left', ball);
    } else if ( ball.x.isBetween(paddle.rightEdge()[1],paddle.rightEdge()[0])){
      sharpBounce('right', ball);
  } else {
    ball.reverseYVelocity()
  }
};

var sharpBounce = function (side, ball) {
  if (side == 'left'){
    console.log('sharp left')
    if ( ball.velocityX > 0 ){
      ball.velocityX += 3
      ball.velocityX = -ball.velocityX
      ball.reverseYVelocity()
    } else {
      ball.velocityX += -3
      ball.reverseYVelocity()
    }
  } else if (side == 'right'){
    console.log('sharp right')
    if ( ball.velocityX > 0 ){
      ball.velocityX += 3
      ball.reverseYVelocity()
    } else {
      ball.velocityX += -3
      ball.velocityX = -ball.velocityX
      ball.reverseYVelocity()
    }
  }
}

var ballContactsBrick = function(ball, bricks){
  // debugger;
  for (var layer in bricks){
    bricks[layer].map(function(brick){
      if ( ball.topEdge().y == brick.verticalRange()[1]){
        if ( ball.topEdge().x >= brick.horizontalRange()[0] && ball.topEdge().x <= brick.horizontalRange()[1]){
          return true;
        };
      };
    })
  };
}

var brickBounce = function(ball, brick){
  
}

{'fraction_non_alphanumeric': 0.17131604857236626, 'fraction_numerical': 0.009845749917952083, 'mean_word_length': 2.7676143386897403, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1008648', 'n_tokens_mistral': 1081, 'n_tokens_neox': 1027, 'n_words': 194}