<commit_before>"use strict"

var Radius = 1000
var UpdateRate = 10
var PlayerAcc = 0.01
var PlayerRotSpd = Math.PI / 1000 * UpdateRate
var ShotSpd = 0.1 * UpdateRate

var keys = [].fill.call({length: 255}, 0)
var viewX = 0, viewY = 0
var time = 0
var timer

var player, timeScale = 1
var shots = []
var fields = []

function load() {
  player = objNew("img/obj0.png", 0, 0, 0, 0, Math.PI / 2)
  update()
  timer = setInterval(update, UpdateRate)
  setTimeout(function() {
    document.getElementById("instruct").style.display = "none"
  }, 10000)
}

function update() {
  while (Math.random() < 0.01 * UpdateRate) {
    var p = randInCircle(500, 1000)
    var v = randInCircle(0, 0.1 * UpdateRate)
    if (Math.random() < 0.1) {
      var field = objNew("img/hole.png", player.x + p.x, player.y + p.y, player.velX + v.x, player.velY + v.y, 0)
      field.div.style.zIndex = -1
      fields[fields.length] = field
    }
    else {
      var shot = objNew("img/asteroid.png", player.x + p.x, player.y + p.y, player.velX + v.x, player.velY + v.y, 0)
      shot.velRot = Math.sign(Math.random() - 0.5) * PlayerRotSpd
      shots[shots.length] = shot
    }
  }
  for (var i = 0; i < fields.length; i++) {
    fields[i].prevX = fields[i].x
    fields[i].prevY = fields[i].y
  }
  updatePos(player, (keys[38] - keys[40]) * PlayerAcc, (keys[37] - keys[39]) * PlayerRotSpd)
  viewX = player.x - getWindowWidth() / 2
  viewY = player.y - getWindowHeight() / 2
  objDraw(player)
  for (var i = 0; i < shots.length; i++) {
    updatePos(shots[i], 0, shots[i].velRot)
    objDraw(shots[i])
  }
  for (var i = 0; i < fields.length; i++) {<commit_msg>remove out of bounds asteroids too<commit_after>"use strict"

var Radius = 1000
var UpdateRate = 10
var PlayerAcc = 0.01
var PlayerRotSpd = Math.PI / 1000 * UpdateRate
var ShotSpd = 0.1 * UpdateRate

var keys = [].fill.call({length: 255}, 0)
var viewX = 0, viewY = 0
var time = 0
var timer

var player, timeScale = 1
var shots = []
var fields = []

function load() {
  player = objNew("img/obj0.png", 0, 0, 0, 0, Math.PI / 2)
  update()
  timer = setInterval(update, UpdateRate)
  setTimeout(function() {
    document.getElementById("instruct").style.display = "none"
  }, 10000)
}

function update() {
  while (Math.random() < 0.01 * UpdateRate) {
    var p = randInCircle(500, 1000)
    var v = randInCircle(0, ShotSpd)
    if (Math.random() < 0.1) {
      var field = objNew("img/hole.png", player.x + p.x, player.y + p.y, player.velX + v.x, player.velY + v.y, 0)
      field.div.style.zIndex = -1
      fields[fields.length] = field
    }
    else {
      var shot = objNew("img/asteroid.png", player.x + p.x, player.y + p.y, player.velX + v.x, player.velY + v.y, 0)
      shot.velRot = Math.sign(Math.random() - 0.5) * PlayerRotSpd
      shots[shots.length] = shot
    }
  }
  for (var i = 0; i < fields.length; i++) {
    fields[i].prevX = fields[i].x
    fields[i].prevY = fields[i].y
  }
  updatePos(player, (keys[38] - keys[40]) * PlayerAcc, (keys[37] - keys[39]) * PlayerRotSpd)
  viewX = player.x - getWindowWidth() / 2
  viewY = player.y - getWindowHeight() / 2
  objDraw(player)
  for (var i = 0; i < shots.length; i++) {
    updatePos(shots[i], 0, shots[i].velRot)
    objDraw(shots[i])
    if (objDistSq(shots[i], player) > Radius * Radius) {
      objRemove(shots[i])
      arrayRemove(shots, i)
      i--
    }
  }
  for (var i = 0; i < fields.length; i++) {
{'fraction_non_alphanumeric': 0.16886543535620052, 'fraction_numerical': 0.03928466725300499, 'mean_word_length': 2.8861047835990887, 'pattern_counts': {'":': 0, '<': 13, '<?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': '441512', 'n_tokens_mistral': 1412, 'n_tokens_neox': 1303, 'n_words': 331}