<commit_before>// game starts with player X


const xImage = "http://cdn.mysitemyway.com/etc-mysitemyway/icons/legacy-previews/icons-256/black-ink-grunge-stamps-textures-icons-alphanumeric/068726-black-ink-grunge-stamp-textures-icon-alphanumeric-x-solid.png"
const oImage ="http://www.drodd.com/images14/o25.png"
const emptySquare = "http://1.bp.blogspot.com/-jJUO43k6ReU/T7ivfcr4fgI/AAAAAAAAQqU/8YdJwPwT4OE/s1600/transparent.png"

let currentPlayer = xImage


//on click of square,
  //setup click events
  $("td").click(changeSquare) //calls function to change image
  //listen for changes


//changes image to the player's image
//switches turn to other player
function changeSquare(evt) {
  //resets the image of the clicked on square to new value
   let clickedSquare = evt.target
     //if a square isn't empty, don't allow change
  //if the square is empty
   if(clickedSquare.src === emptySquare) {
    //assign it a new image
    clickedSquare.src = currentPlayer
    changePlayer();
   }
   //change the player


}
//checks for game win

//change player
function changePlayer() {
  //if the current player is x, flip to o, otherwise, flip to x
  currentPlayer = xImage ? oImage : xImage;
}
<commit_msg>fixed turn bug<commit_after>// game starts with player X


const xImage = "http://cdn.mysitemyway.com/etc-mysitemyway/icons/legacy-previews/icons-256/black-ink-grunge-stamps-textures-icons-alphanumeric/068726-black-ink-grunge-stamp-textures-icon-alphanumeric-x-solid.png"
const oImage ="http://www.drodd.com/images14/o25.png"
const emptySquare = "http://1.bp.blogspot.com/-jJUO43k6ReU/T7ivfcr4fgI/AAAAAAAAQqU/8YdJwPwT4OE/s1600/transparent.png"

//the game starts with player x
let currentPlayer = xImage


//on click of square,
  //setup click events
  $("td").click(changeSquare) //calls function to change image





function changeSquare(evt) {
  //resets the image of the clicked on square to new value
   let clickedSquare = evt.target
     //if a square isn't empty, don't allow change
  //if the square is empty
   if(clickedSquare.src === emptySquare) {
    //assign it a new image
    //changes image to the player's image
    clickedSquare.src = currentPlayer
    //switches turn to other player
    changePlayer();
   }
//checks for game win
}


//change player
function changePlayer() {
  //if the current player is x, flip to o, otherwise, flip to x
  if (currentPlayer === xImage) {
    currentPlayer = oImage;
  } else {
    currentPlayer = xImage;
  }
}

{'fraction_non_alphanumeric': 0.11402095084609186, 'fraction_numerical': 0.020145044319097503, 'mean_word_length': 3.4981884057971016, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '1586659', 'n_tokens_mistral': 882, 'n_tokens_neox': 844, 'n_words': 230}