<commit_before>/* 
    Common game events. 
    These events can happen to nearly any object. 
    If I define a base object type for games, these will go there. 
*/

function atWorldsEnd() {
  var snakeHead;
  
  if(!entities) return false;
  if(!(snakeHead = entities[0].blocks[0]))return false;
  
  if(snakeHead.x < 0
     ||
     snakeHead.y < 0
     ||
     snakeHead.x > document.width/60 - snakeHead.width
     ||
     snakeHead.y > document.height/60 - snakeHead.height)
        return false;
  
  return false;
}
                 
function bitingSelf() {
  if(!entities) return false;
  if(!entities[0].blocks[0]) return false;

  return false;
  /*var head,
      ret = false;
  entities[0].blocks.some(function (e, i, a) {
    if(!head) { head = e; }
    else if(Math.sqrt(Math.pow(head.x - e.x, 2) + Math.pow(head.y - e.y, 2)) < 1) return (ret = true);
  });
  return ret;*/
}

function eatingEgg() {
  var head;
  if(!entities) return false;
  if(!(head = entities[0].blocks[0])) return false;
  if(!entities[1]) return false;
  
  return false;
  
  /*if(!head) { head = entities[0].blocks[0]; }
  else if(Math.sqrt(Math.pow(head.x - entities[1].x, 2) + Math.pow(head.y - entities[1].y, 2)) < 1) return true;

  return false;*/
}<commit_msg>UNCOMMENT CODE OMG<commit_after>/* 
    Common game events. 
    These events can happen to nearly any object. 
    If I define a base object type for games, these will go there. 
*/

function atWorldsEnd() {
  var snakeHead;
  
  if(!entities) return false;
  if(!(snakeHead = entities[0].blocks[0]))return false;
  
  if(snakeHead.x < 0
     ||
     snakeHead.y < 0
     ||
     snakeHead.x > document.width/BLOCK_WIDTH - 1
     ||
     snakeHead.y > document.height/BLOCK_WIDTH - 1)
        return true;
  
  return false;
}
                 
function bitingSelf() {
  if(!entities) return false;
  if(!entities[0].blocks[0]) return false;

  var head,
      ret = false;
  entities[0].blocks.some(function (e, i, a) {
    if(!head) { head = e; }
    else if(Math.sqrt(Math.pow(head.x - e.x, 2) + Math.pow(head.y - e.y, 2)) < 1) return (ret = true);
  });
  return ret;
}

function eatingEgg() {
  var head;
  if(!entities) return false;
  if(!(head = entities[0].blocks[0])) return false;
  if(!entities[1]) return false;
  
  if(!head) { head = entities[0].blocks[0]; }
  else if(Math.sqrt(Math.pow(head.x - entities[1].x, 2) + Math.pow(head.y - entities[1].y, 2)) < 1) return true;

  return false;
}
{'fraction_non_alphanumeric': 0.15759545085296506, 'fraction_numerical': 0.01868399675060926, 'mean_word_length': 2.7093373493975905, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, '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': '7560836', 'n_tokens_mistral': 911, 'n_tokens_neox': 892, 'n_words': 226}