<commit_before>
// Using jQuery, create a game that requires the user to press every letter and number on the keyboard
// Start by creating an array with all 26 letters and 10 numbers
// Display all of the characters on the screen. This should be done using a jQuery to append to the DOM once.
// In other words, don't do a separate append for each character
// Whenever the user presses a key, check to see if it is a number or a letter that has not been pressed already
// If it is, change the appearance of that character (for example, grey it out to show that it has been pressed already)
// If they key has already been pressed, tell the user!
// Once all the characters have been pressed, display a message telling the user that they have won the game!
// The message should be shown using jQuery


'use strict';

var creatingArray = ['a','b','c','d','e','f','g','h','i','j','k','l','m'
					,'n','o','p','q','r','s','t','u','v','w','x','y','z'
					,'1','2','3','4','5','6','7','8','9','10'
					];

$(document).ready(init);

function init() {
	appendliteral();
	keyBoardInput();
}

function appendliteral() {
	$.each(creatingArray, function(index) {
		$('#literalLabel').append(creatingArray[index] + ' ');
	});
}

function keyBoardInput() {
	// $("#inputLetter").on('keypress', checkLiteral2);

	$(document).on('keypress', checkLiteral2);
}


var letterMatching = [];
function checkLiteral2(e) {

	var codeValue = String.fromCharCode(e.charCode);

	if ($.isNumeric(codeValue)) {

		// Add to Number
		console.log(codeValue);
	}


}



function checkLiteral() {
	var correct = 0;

	var letter = $("#inputLetter").val();
	var pattern = RegExp(letter, 'gi'); // pattern: /a/gi

	var str = creatingArray.join('');
	var result = str.match(pattern);
	// letterMatching.push(result);
<commit_msg>	modified:   main.js<commit_after>
// Using jQuery, create a game that requires the user to press every letter and number on the keyboard
// Start by creating an array with all 26 letters and 10 numbers
// Display all of the characters on the screen. This should be done using a jQuery to append to the DOM once.
// In other words, don't do a separate append for each character
// Whenever the user presses a key, check to see if it is a number or a letter that has not been pressed already
// If it is, change the appearance of that character (for example, grey it out to show that it has been pressed already)
// If they key has already been pressed, tell the user!
// Once all the characters have been pressed, display a message telling the user that they have won the game!
// The message should be shown using jQuery


'use strict';

var creatingArray = ['a','b','c','d','e','f','g','h','i','j','k','l','m'
					,'n','o','p','q','r','s','t','u','v','w','x','y','z'
					,'1','2','3','4','5','6','7','8','9','10'
					];

$(document).ready(init);

function init() {
	appendliteral();
	keyBoardInput();
}

function appendliteral() {
	$.each(creatingArray, function(index) {
		$('#literalLabel').append(creatingArray[index] + ' ');
	});
}

function keyBoardInput() {
	// $("#inputLetter").on('keypress', checkLiteral2);

	$(document).on('keypress', checkLiteral2);
}

var letterMatching = [];
function checkLiteral2(e) {

	var codeValue = String.fromCharCode(e.charCode);

	if ($.isNumeric(codeValue)) {
		
	   var pattern = RegExp(codeValue, 'gi'); // pattern: /a/gi
	   var word = letterMatching.join();
	   var result = word.match(pattern);
	   if (result != null ) {
	   		
	   		if(result.length > 0) {
				console.log(result);
	   		} else {

	   		}

	   } else {
			letterMatching.push(codeValue);
	   }

	}


}



function checkLiteral() {
	var correct = 0;

	var letter = $("#inputLetter").val();
	var pattern = RegExp(letter, 'gi'); // pattern: /a/gi

	var str = creatingArray.join('');
	var result = str.match(pattern);
	// letterMatching.push(result);

{'fraction_non_alphanumeric': 0.1650711513583441, 'fraction_numerical': 0.010090556274256144, 'mean_word_length': 3.9755469755469757, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '316618', 'n_tokens_mistral': 1262, 'n_tokens_neox': 1172, 'n_words': 421}