<commit_before>var count = 0;
var clickz = 0;
var pair = [];
var match = 0;

var audio = new Audio('snd/prox.wav');
var audio2 = new Audio('snd/beverly_computer.wav');







function createBoard() {

  //need fucntion to dynamically create content array depending on desired number of blocks

var content = ["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", "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"];
var content = ["a", "a", "b", "b", "c", "c", "d", "d", "e", "e", "f", "f", "g", "g", "h", "h"];
var contentLength = content.length;


  for (i = 0; i < contentLength; i++) {

    var position = Math.floor(Math.random() * content.length);

    var letter = content.splice(position, 1);

    $("<div class=\"card " + letter + "\">" + letter + "</div>").appendTo(".board");

  }

  $(".card").click(function() {
  $(this).addClass("flipped");
  clickz++;
  $(".counter").text("clicks:" +clickz);
  pair.push($(this).text());
  count++;


  if (count == 2) {

    $(".card").addClass("noClick");
  
    if (pair[0] == pair[1]) {
      //alert("match");
      $("." + pair[0]).addClass("matched");
      audio.play();
      match++;
    $(".matches").text("matches:" + match);
      $(".card").removeClass("noClick");
      if (match == contentLength / 2) {
        $(".card").addClass("winner");
        audio2.play();

  
      }

    } else {
      //alert("no match");
      setTimeout(function() {
        $(".card").removeClass("flipped");
        $(".card").removeClass("noClick");<commit_msg>refactored card creation to be dynamic<commit_after>var count = 0;
var clickz = 0;
var pair = [];
var match = 0;
var vault = ["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"];

//var content = ["a", "a", "b", "b", "c", "c", "d", "d", "e", "e", "f", "f", "g", "g", "h", "h"];
var audio = new Audio('snd/prox.wav');
var audio2 = new Audio('snd/beverly_computer.wav');


function createBoard() {

  var pairs = 8;
  var content = [];

  //this function creates the content for the cards
  function createCards() {
    console.log("creating cards");
    for (i = 0; i < pairs; i++) {
    var position = Math.floor(Math.random() * vault.length);
    var vaultLetter = vault.splice(position, 1);
    content.push(vaultLetter);
    content.push(vaultLetter);
    console.log(content.toString());
    }


  }

  createCards();


  //this function adds the cards to the board
  function addCards() {

     for (i = 0; i < pairs*2; i++) {

      var position = Math.floor(Math.random() * content.length);

      var letter = content.splice(position, 1);

      $("<div class=\"card " + letter + "\">" + letter + "</div>").appendTo(".board");

    }

  }

  addCards();


  $(".card").click(function() {
  $(this).addClass("flipped");
  clickz++;
  $(".counter").text("clicks:" +clickz);
  pair.push($(this).text());
  count++;


  if (count == 2) {

    $(".card").addClass("noClick");
  
    if (pair[0] == pair[1]) {
      //alert("match");
      $("." + pair[0]).addClass("matched");
      audio.play();
      match++;
    $(".matches").text("matches:" + match);
      $(".card").removeClass("noClick");
      if (match == pairs) {
        $(".card").addClass("winner");
        audio2.play();

  
      }

    } else {
      //alert("no match");
      setTimeout(function() {
        $(".card").removeClass("flipped");
        $(".card").removeClass("noClick");
{'fraction_non_alphanumeric': 0.2715912246598167, 'fraction_numerical': 0.007497917245209664, 'mean_word_length': 2.980110497237569, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 9, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2033793', 'n_tokens_mistral': 1355, 'n_tokens_neox': 1301, 'n_words': 329}