<commit_before>/* Copyright (c) 2014 <NAME> - MIT License */
/* http://github.com/jdh11235/lightswitch */

//data

var Board = [];

var Defaults = {

	click_radius: 1,

	board_width: 30,
	board_height: 30,

	scramble_iterations: 30

};

var $;
function Elements () {
	$ = {

		board: document.getElementById('board')

	};
}

//classes

var Game = {

	newGame: function () {

	},

	pressTile: function (x, y) {

	},

	resetBoard: function (width, height) {
		Board = [];
		for (var x = 0; x < width; x++) {
			Board[x] = [];
			for (var y = 0; y < height; y++) {
				Board[x][y] = 'off';
			}
		}
	},

	setTile: function (x, y, state) {

	},

	toggleTile: function (x, y) {

	}

};

var UI = {

	renderBoard: function () {

	}

};

var Util = {

	init: function () {
		Util.setupDefaults();
		Elements();<commit_msg>toggle multiple tiles<commit_after>/* Copyright (c) 2014 <NAME> - MIT License */
/* http://github.com/jdh11235/lightswitch */

//data

//TODO: put board in localStorage with getter and setter methods?
var Board = [];

var Defaults = {

	click_radius: 1,

	board_width: 30,
	board_height: 30,

	scramble_iterations: 30

};

var $;
function Elements () {
	$ = {

		board: document.getElementById('board')

	};
}

//classes

var Game = {

	newGame: function () {

	},

	pressTile: function (x, y) {
		//TODO: toggle all tiles within localStorage.click_radius
	},

	resetBoard: function (width, height) {
		Board = [];
		for (var x = 0; x < width; x++) {
			Board[x] = [];
			for (var y = 0; y < height; y++) {
				Board[x][y] = 'off';
			}
		}
	},

	toggleTiles: function (tiles) {
		//tiles === [[1, 1], ... [3, 4]]
		var x, y;
		for (tile in tiles) {
			x = tiles[tile][0];
			y = tiles[tile][1];
			if (Board[x][y] === 'off') {
				Board[x][y] = 'on';
			} else if (Board[x][y] === 'on') {
				Board[x][y] = 'off';
			}
		}
		UI.renderBoard();
	}

};

var UI = {

	renderBoard: function () {
		//TODO: update board on document from Board
		console.log(Board);
	}

};

var Util = {

	init: function () {
		Util.setupDefaults();
		Elements();
{'fraction_non_alphanumeric': 0.19416058394160585, 'fraction_numerical': 0.020437956204379562, 'mean_word_length': 2.800369685767098, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, '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': '6083948', 'n_tokens_mistral': 911, 'n_tokens_neox': 787, 'n_words': 199}