<commit_before>//Lunch Roulette

document.addEventListener("DOMContentLoaded", function(event) {

	var healthyRestaurantsData = [
		{
			"restaurantName":"Chop't"
		},
		{
			"restaurantName":"Chipotle"
		},		
		{
			"restaurantName":"Water Street Deli"
		},		
		{
			"restaurantName":"Open Kitchen"
		},		
		{
			"restaurantName":"GuacStar"
		}
	]

	var unhealthyRestaurantsData = [
		{
			"restaurantName":"Thai (Bao Restaurant)"
		},		
		{
			"restaurantName":"Chinese Buffet"
		},		
		{
			"restaurantName":"Sushi"
		},		
		{
			"restaurantName":"Schnippers"
		},		
		{
			"restaurantName":"Jamaican"
		},		
		{
			"restaurantName":"Lenny's"
		},		
		{
			"restaurantName":"Burger King"
		}
	]

	var choice;
	var shuffledChoices;


	function initialize() {
		chooseRestaurantList();
		shuffleRestaurants(choice);
		decideLunch(shuffledChoices);
	}

	function clickHandler() {
		var initializeButton = document.getElementById("initialize");
		initializeButton.addEventListener("click", function(event) {
			console.log("hello")
			// event.preventDefault();
			initialize();
		})
	}

	function displayData(data) {

		var headline = document.getElementById("headline");
		headline.innerHTML = "This is your restaurant list:";
		for (var i = 0; i < data.length; i++) {
      if ( data[i].hasOwnProperty("restaurantName") ) {
	      var display = document.getElementsByClassName("display")[0];
				var p = document.createElement('p');
				display.appendChild(p);
				document.getElementsByTagName("p")[i].innerHTML = i + 1 + ". " + data[i].restaurantName;
       }
    }

	};

	function chooseRestaurantList() {
		choice = document.getElementById("selection-box").value;
		if (choice == 1) {
			choice = healthyRestaurantsData;
			displayData(choice);
		}
		else if( choice == 2) {
			choice = unhealthyRestaurantsData;
			displayData(choice);
		}
		else {
			alert("That is an incorrect choice, please try again");
		}

		return choice;
	}

	function removeRestaurants() {

	};

	function shuffleRestaurants(data) {
	  var currentIndex = data.length, temporaryValue, randomIndex;

	  while (0 !== currentIndex) {

	    randomIndex = Math.floor(Math.random() * currentIndex);
	    currentIndex -= 1;

	    temporaryValue = data[currentIndex];
	    data[currentIndex] = data[randomIndex];
	    data[randomIndex] = temporaryValue;
	  };

	  shuffledChoices = data;
	  return shuffledChoices;
	};

	function decideLunch(shuffledChoices) {
		var lunchResult = shuffledChoices.pop();
		var p = document.createElement("p");
		p.style.fontSize="30px";
		p.style.textAlign="center";
		p.innerHTML = "Your result is: " + lunchResult.restaurantName;
		document.getElementById("result").appendChild(p);
	}

	clickHandler();
	
});<commit_msg>work on replaceable results headline issue<commit_after>//Lunch Roulette

document.addEventListener("DOMContentLoaded", function(event) {

	var healthyRestaurantsData = [
		{
			"restaurantName":"Chop't"
		},
		{
			"restaurantName":"Chipotle"
		},		
		{
			"restaurantName":"Water Street Deli"
		},		
		{
			"restaurantName":"Open Kitchen"
		},		
		{
			"restaurantName":"GuacStar"
		}
	]

	var unhealthyRestaurantsData = [
		{
			"restaurantName":"Thai (Bao Restaurant)"
		},		
		{
			"restaurantName":"Chinese Buffet"
		},		
		{
			"restaurantName":"Sushi"
		},		
		{
			"restaurantName":"Schnippers"
		},		
		{
			"restaurantName":"Jamaican"
		},		
		{
			"restaurantName":"Lenny's"
		},		
		{
			"restaurantName":"<NAME>"
		}
	]

	var choice;
	var shuffledChoices;

	function initialize() {
		chooseRestaurantList();
		shuffleRestaurants(choice);
		displayResult(shuffledChoices);
	};

	function onClickHandler() {
		var initializeButton = document.getElementById("initialize");
		initializeButton.addEventListener("click", function(event) {
			var existingResult = document.getElementById("result");
			existingResult.innerHTML = "";
			initialize();
			event.preventDefault();
		});
	};

	function displayRestaurantList(data) {

		var headline = document.getElementById("headline");
		headline.innerHTML = "This is your restaurant list:";
		for (var i = 0; i < data.length; i++) {
      if ( data[i].hasOwnProperty("restaurantName") ) {
	      var display = document.getElementsByClassName("display")[0];
				var p = document.createElement('p');
				display.appendChild(p);
				document.getElementsByTagName("p")[i].innerHTML = i + 1 + ". " + data[i].restaurantName;
       }
    }

	};

	function chooseRestaurantList() {
		choice = document.getElementById("selection-box").value;
		if (choice == 1) {
			choice = healthyRestaurantsData;
			displayRestaurantList(choice);
		}
		else if( choice == 2) {
			choice = unhealthyRestaurantsData;
			displayRestaurantList(choice);
		}
		else {
			alert("That is an incorrect choice, please try again");
		}

		return choice;
	};

	function removeRestaurants() {

	};

	function shuffleRestaurants(data) {
	  var currentIndex = data.length, temporaryValue, randomIndex;

	  while (0 !== currentIndex) {

	    randomIndex = Math.floor(Math.random() * currentIndex);
	    currentIndex -= 1;

	    temporaryValue = data[currentIndex];
	    data[currentIndex] = data[randomIndex];
	    data[randomIndex] = temporaryValue;
	  };

	  shuffledChoices = data;
	  return shuffledChoices;
	};

	function displayResult(shuffledChoices) {
		var lunchResult = shuffledChoices.pop();
		var p = document.createElement("p");
		p.style.fontSize="30px";
		p.style.textAlign="center";
		p.innerHTML = "Your result is: " + lunchResult.restaurantName;
		document.getElementById("result").appendChild(p);
	};

	onClickHandler();

});
{'fraction_non_alphanumeric': 0.14272938651404043, 'fraction_numerical': 0.003219459846181363, 'mean_word_length': 3.8457538994800693, 'pattern_counts': {'":': 24, '<': 6, '<?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': '28585', 'n_tokens_mistral': 2126, 'n_tokens_neox': 1764, 'n_words': 305}