function move(x, y) {
  var moveChoice = [y, x]
  /**
   * 1. If the player is making a move on a piece for the 1st time. i.e not going for second jump
   */
  if (($('#b' + x + y).val() == counterInPlay || selectedX != 10 || ($('#b' + x + y).val() == kingPlayer)) && doubleTakeIndicator == 0) {
    //Prevent double clicking
    click++;
    if (click === 1) {
      /**
       * i. Choosing piece to play with.
       * Nothing is selected and the player makes their first choice
       */
      if ((selectedX == 10) && (selectedY == 10)) {
        if (table[y][x] == counterInPlay || table[y][x] == kingPlayer) { //Selected one of thier pieces
          selectedX = x;
          selectedY = y;
          //Recognises they made a choice
          commitment++;
          counterInPlay.concat(counterInPlay)
        }
      }
      //player changes there mind and chooses another one of thier pieces
      else if (commitment > 0 && $('#b' + x + y).val() == counterInPlay) {
        //Reset all colours from previous click
        $('.even').css({
          'background': 'lightblue'
        })
        selectedX = x;
        selectedY = y;
      }
      /**
       *   ii. Seeing valid moves avaible on the board. Valid moves are returnd in an array
       */
      var potentialMoves = locationOfSuroundings(selectedY, selectedX, 1)

      /**
       *  iii. Reject or accept players wish to move piece. If accepted:move piece
       */
      var move = validMoveChecker(moveChoice, potentialMoves)
      // Player clicks on a piece that is blank and want to change piece.
      if (move == "valid") {
        jumpingPlayer(y, x)
      }
      click--
    }
  }

  /**
   *   2. If player is making a move on a piece for the 2nd time. i.e second take is on
   */
  else {
    click++;
    var move = validMoveChecker(moveChoice, doubleTakeLocation)
    if (move == "valid") {
      doubleTakeIndicator--
      jumpingPlayer(y, x);
    }
    click--
  }
}
/**
 * @function move - Function is activated when the user clicks on a checker.
 */
@function move - Function is activated when the user clicks on a checker.
@function move - Function is activated when the user clicks on a checker .
function move(x, y) {
  var moveChoice = [y, x]
  if (($('#b' + x + y).val() == counterInPlay || selectedX != 10 || ($('#b' + x + y).val() == kingPlayer)) && doubleTakeIndicator == 0) {
    click++;
    if (click === 1) {
      if ((selectedX == 10) && (selectedY == 10)) {
        if (table[y][x] == counterInPlay || table[y][x] == kingPlayer) { 
          selectedX = x;
          selectedY = y;
          commitment++;
          counterInPlay.concat(counterInPlay)
        }
      }
      else if (commitment > 0 && $('#b' + x + y).val() == counterInPlay) {
        $('.even').css({
          'background': 'lightblue'
        })
        selectedX = x;
        selectedY = y;
      }
      var potentialMoves = locationOfSuroundings(selectedY, selectedX, 1)
      var move = validMoveChecker(moveChoice, potentialMoves)
      if (move == "valid") {
        jumpingPlayer(y, x)
      }
      click--
    }
  }
  else {
    click++;
    var move = validMoveChecker(moveChoice, doubleTakeLocation)
    if (move == "valid") {
      doubleTakeIndicator--
      jumpingPlayer(y, x);
    }
    click--
  }
}
function move ( x , y ) { var moveChoice = [ y , x ] if ( ( $ ( '#b' + x + y ) . val ( ) == counterInPlay || selectedX != 10 || ( $ ( '#b' + x + y ) . val ( ) == kingPlayer ) ) && doubleTakeIndicator == 0 ) { click ++ ; if ( click === 1 ) { if ( ( selectedX == 10 ) && ( selectedY == 10 ) ) { if ( table [ y ] [ x ] == counterInPlay || table [ y ] [ x ] == kingPlayer ) { selectedX = x ; selectedY = y ; commitment ++ ; counterInPlay . concat ( counterInPlay ) } } else if ( commitment > 0 && $ ( '#b' + x + y ) . val ( ) == counterInPlay ) { $ ( '.even' ) . css ( { 'background' : 'lightblue' } ) selectedX = x ; selectedY = y ; } var potentialMoves = locationOfSuroundings ( selectedY , selectedX , 1 ) var move = validMoveChecker ( moveChoice , potentialMoves ) if ( move == "valid" ) { jumpingPlayer ( y , x ) } click -- } } else { click ++ ; var move = validMoveChecker ( moveChoice , doubleTakeLocation ) if ( move == "valid" ) { doubleTakeIndicator -- jumpingPlayer ( y , x ) ; } click -- } }
@function move - Function is activated when the user clicks on a checker.
@function move - Function is activated when the user clicks on a checker .
/**
   * 1. If the player is making a move on a piece for the 1st time. i.e not going for second jump
   */ //Prevent double clicking /**
       * i. Choosing piece to play with.
       * Nothing is selected and the player makes their first choice
       */ //Selected one of thier pieces //Recognises they made a choice //player changes there mind and chooses another one of thier pieces //Reset all colours from previous click /**
       *   ii. Seeing valid moves avaible on the board. Valid moves are returnd in an array
       */ /**
       *  iii. Reject or accept players wish to move piece. If accepted:move piece
       */ // Player clicks on a piece that is blank and want to change piece. /**
   *   2. If player is making a move on a piece for the 2nd time. i.e second take is on
   */