<commit_before>/*
    Copyright (C) 2014  <NAME>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
var canvas, ctx;

function UI() {
	this.cellSize = 30;
	this.background = '#000';
	this.emptyCell = '#2a2a2a';
	this.cellColor = '#ee0000'; //00eeee
	this.cellState = false;
}

UI.prototype.init = function() {
	canvas = document.getElementById('field');
	canvas.width = window.innerWidth;
	canvas.height = window.innerHeight;

	if (canvas.getContext) {
		ctx = canvas.getContext('2d');
	}
}

UI.prototype.fillCell = function (mouseX, mouseY, golObject) {
	var cellX = Math.floor(mouseX / this.cellSize); 
	var cellY = Math.floor(mouseY / this.cellSize);
	
	ctx.fillStyle = this.cellState ? this.cellColor : this.emptyCell;
	ctx.fillRect(cellX * this.cellSize + 1, cellY * this.cellSize + 1, this.cellSize - 2, this.cellSize - 2);
	
	return {
		row: cellY,
		col: cellX
	};
}

UI.prototype.drawFrame = function (golObject) {
	ctx.fillStyle = this.background;
	ctx.fillRect(0, 0, canvas.width, canvas.height);
	
	for (var i = 0; i < golObject.currentGeneration.length; ++i) {
		for (var j = 0; j < golObject.currentGeneration[i].length; ++j) {
			if (golObject.currentGeneration[i][j]) {
				ctx.fillStyle = this.cellColor;
			} else {
				ctx.fillStyle = this.emptyCell;
			}
			
			ctx.fillRect(j * this.cellSize + 1, i * this.cellSize + 1, this.cellSize - 2, this.cellSize - 2);
		}
	}
}
<commit_msg>Removed Life only code from UI.js<commit_after>/*
    Copyright (C) 2014  <NAME>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
var canvas, ctx;

function UI() {
	this.cellSize = 30;
	this.background = '#000';
	this.emptyCell = '#2a2a2a';
	this.cellColor = '#ee0000'; //00eeee
	this.cellState = false;
	this.cells = [];
}

UI.prototype.init = function() {
	canvas = document.getElementById('field');
	canvas.width = window.innerWidth;
	canvas.height = window.innerHeight;

	if (canvas.getContext) {
		ctx = canvas.getContext('2d');
	}
	
	this.numRows = Math.floor((canvas.height - 1) / Life.UI.cellSize);
	this.numCols = Math.floor((canvas.width - 1) / Life.UI.cellSize);
	
	for (var i = 0; i < this.numRows; ++i) {
	    for (var j = 0; j < this.numCols; ++j) {
	        this.cells[i][j] = false;
	    }
	} 
}

UI.prototype.fillCell = function (mouseX, mouseY) {
	var cellX = Math.floor(mouseX / this.cellSize); 
	var cellY = Math.floor(mouseY / this.cellSize);
	
	ctx.fillStyle = this.cellState ? this.cellColor : this.emptyCell;
	ctx.fillRect(cellX * this.cellSize + 1, cellY * this.cellSize + 1, this.cellSize - 2, this.cellSize - 2);
	
	return {
		row: cellY,
		col: cellX
	};
}

UI.prototype.drawFrame = function () {
	ctx.fillStyle = this.background;
	ctx.fillRect(0, 0, canvas.width, canvas.height);
	
	for (var i = 0; i < this.cells.length; ++i) {
		for (var j = 0; j < this.cells[i].length; ++j) {
			if (this.cells[i][j]) {
				ctx.fillStyle = this.cellColor;
			} else {
				ctx.fillStyle = this.emptyCell;
			}
			
			ctx.fillRect(j * this.cellSize + 1, i * this.cellSize + 1, this.cellSize - 2, this.cellSize - 2);
		}
	}
}

{'fraction_non_alphanumeric': 0.12112932604735883, 'fraction_numerical': 0.015482695810564663, 'mean_word_length': 2.8636763412489006, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3759671', 'n_tokens_mistral': 1569, 'n_tokens_neox': 1415, 'n_words': 436}