<commit_before>// the initial elements
var grid = document.querySelector('#grid');
var next = document.querySelector('#next');

// size of the grid
var x = 3;
var y = 3;

// create grid
for (var i = 0; i < y; i++) {
	var div = document.createElement('div');
	grid.appendChild(div);
	for (var j = 0; j < x; j++) {
		var checkbox = document.createElement('input');
		checkbox.type = 'checkbox';
		checkbox.id = 'id' + i + j;
		div.appendChild(checkbox);
	}
}<commit_msg>18.3 Conway’s Game of Life, are checkboxes set?<commit_after>// the initial elements
var grid = document.querySelector('#grid');
var next = document.querySelector('#next');

// size of the grid
var x = 3;
var y = 3;

// create grid
for (var i = 0; i < y; i++) {
	var div = document.createElement('div');
	grid.appendChild(div);
	for (var j = 0; j < x; j++) {
		var checkbox = document.createElement('input');
		checkbox.type = 'checkbox';
		checkbox.id = 'id' + i + j;
		div.appendChild(checkbox);
	}
}

// next generation
next.addEventListener('click', function() {

	// is checkbox set?
	var world = [];
	for (var i = 0; i < y; i++) {
		var row = [];
		for (var j = 0; j < x; j++) {
			var checkbox = document.querySelector('#id' + i + j);
			row.push(checkbox.checked);
		}
		world.push(row);
	}
	console.log(world);

});
{'fraction_non_alphanumeric': 0.18343653250773995, 'fraction_numerical': 0.010061919504643963, 'mean_word_length': 3.505226480836237, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, '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': '2056165', 'n_tokens_mistral': 471, 'n_tokens_neox': 441, 'n_words': 140}