<commit_before>
function Cell(i, j){
    this.i = i;
    this.j = j;
    this.alive = false;
    this.survives = false; //ALso controls birthing of new cells
    this.neighbours = [];
}


Cell.prototype.countNeighbours = function(grid){
    const top     = this.j - 1;
    const right   = this.i + 1;
    const bottom  = this.j + 1;
    const left    = this.i - 1;
    const middlei = this.i;
    const middlej = this.j;

    //TODO
    if(grid[left][top] > -1 && grid[left][top]){ this.neighbours.push(grid[left][top]);} //Left top
    if(grid[middlei][top] > -1 && grid[middlei][top]){ this.neighbours.push(grid[middlei][top]);} //Middlei top
    if(grid[right][top] > -1 && grid[right][top]){ this.neighbours.push(grid[right][top]);} //Right top
    if(grid[left][middlej] > -1 && grid[left][middlej]){ this.neighbours.push(grid[left][middlej]);} //Left middlej
    if(grid[right][middlej] > -1 && grid[right][middlej]){ this.neighbours.push(grid[right][middlej]);} //Right middlej
    if(grid[left][bottom] > -1 && grid[left][bottom]){ this.neighbours.push(grid[left][bottom]);} //Left bottom
    if(grid[middlei][bottom] > -1 && grid[middlei][bottom]){ this.neighbours.push(grid[middlei][bottom]);} //Middlei bottom
    if(grid[right][bottom] > -1 && grid[right][bottom]){ this.neighbours.push(grid[right][bottom]);} //Right bottom
}<commit_msg>changed neighbours attribute to a number<commit_after>
function Cell(i, j){
    this.i = i;
    this.j = j;
    this.alive = false;
    this.survives = false; //ALso controls birthing of new cells
    this.neighbours = 0;
}


Cell.prototype.countNeighbours = function(grid){
    const top     = this.j - 1;
    const right   = this.i + 1;
    const bottom  = this.j + 1;
    const left    = this.i - 1;
    const middlei = this.i;
    const middlej = this.j;

    //TODO
    if(grid[left][top] > -1 && grid[left][top].alive){ neighbours++;} //Left top
    if(grid[middlei][top] > -1 && grid[middlei][top].alive){ neighbours++;} //Middlei top
    if(grid[right][top] > -1 && grid[right][top].alive){ neighbours++;} //Right top
    if(grid[left][middlej] > -1 && grid[left][middlej].alive){ neighbours++;} //Left middlej
    if(grid[right][middlej] > -1 && grid[right][middlej].alive){ neighbours++;} //Right middlej
    if(grid[left][bottom] > -1 && grid[left][bottom].alive){ neighbours++;} //Left bottom
    if(grid[middlei][bottom] > -1 && grid[middlei][bottom].alive){ neighbours++;} //Middlei bottom
    if(grid[right][bottom] > -1 && grid[right][bottom].alive){ neighbours++;} //Right bottom
}
{'fraction_non_alphanumeric': 0.19858712715855573, 'fraction_numerical': 0.009811616954474097, 'mean_word_length': 3.601083032490975, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, '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': '2033763', 'n_tokens_mistral': 941, 'n_tokens_neox': 899, 'n_words': 190}