<commit_before>var obstacle = function(x, y) {
  ctx.fillStyle = 'darkblue';
  ctx.fillRect(x*snakeSize, y*snakeSize, snakeSize, snakeSize);
  ctx.fillStyle = 'lightblue';
  ctx.fillRect(x*snakeSize+1, y*snakeSize+1, snakeSize-2, snakeSize-2);
}

var createObstacle = function() {
      obstacle = {
        x: Math.floor((Math.random() * 30) + 1),
        y: Math.floor((Math.random() * 30) + 1)
      }

      for (var i=0; i>snake.length; i++) {
        var snakeX = snake[i].x;
        var snakeY = snake[i].y;
      
        if (obstacle.x===snakeX && obstacle.y === snakeY || obstacle.y === snakeY && obstacle.x===snakeX) {
          food.x = Math.floor((Math.random() * 30) + 1);
          food.y = Math.floor((Math.random() * 30) + 1);
        }
      }
  }

if score == 5 { //will change to 50 after im done
  createObstacle();
}<commit_msg>Update obstacle.js<commit_after>var obstacle = function(x, y) {
  ctx.fillStyle = 'darkblue';
  ctx.fillRect(x*snakeSize, y*snakeSize, snakeSize, snakeSize);
  ctx.fillStyle = 'lightblue';
  ctx.fillRect(x*snakeSize+1, y*snakeSize+1, snakeSize-2, snakeSize-2);
}

var createObstacle = function() {
      obstacle = {
        x: Math.floor((Math.random() * 30) + 1),
        y: Math.floor((Math.random() * 30) + 1)
      }
  }
{'fraction_non_alphanumeric': 0.1780392156862745, 'fraction_numerical': 0.023529411764705882, 'mean_word_length': 2.8433734939759034, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '1722723', 'n_tokens_mistral': 502, 'n_tokens_neox': 474, 'n_words': 94}