<commit_before>define('app.board', ['app.column', 'app.toolkit'], function(Column, Toolkit) {

  var isValidPlayer = Toolkit.isValidPlayer,
      isValidCallback = Toolkit.isValidCallback


  function Board(width, height) {

    this._width = width
    this._height = height

    this._columns = new Array(width)
    //TODO: more attributes needed per player?
    this._players = ["red", "blue"]
    this._current_player_index = 0
    this._winning_callback
    this._move_callback

    for(var i = 0; i < width; i++) {
      this._columns[i] = new Column(height)
    }

  }

  Board.prototype = {

    get width() {
      return this._width
    },

    get height() {
      return this._height
    },

    get columns() {
      // just return a copy of the original columns array
      return this._columns.slice()
    },

    get current_player() {
      return this._players[this._current_player_index]
    },

    get player_one() {
      return this._players[0]
    },

    get player_two() {
      return this._players[1]
    },

    set player_one(one) {

      if (isValidPlayer(one)) {
        this._players[0] = one
      }

    },

    set player_two(two) {

      if (isValidPlayer(two)) {
        this._players[1] = two
      }

    },

    get winning_callback() {
      return this._winning_callback
    },

    set winning_callback(cb) {

      if (isValidCallback(cb)) {
        this._winning_callback = cb
      }

    },

    get move_callback() {
      return this._move_callback
    },

    set move_callback(cb) {

      if (isValidCallback(cb)) {
        this._move_callback = cb
      }

    },

    move: function(column_index) {

      var column = this._columns[column_index],
          used_slots

      // do not do anything if move is invalid
      if (!column || column.full) {
        console.log(column ? "full" : "invalid")
        return false
      }

      used_slots = column.insert(this.current_player)

      // switch to other player
      this._current_player_index = (this._current_player_index + 1) % 2

      if(this._move_callback && this._move_callback.call) {<commit_msg>removed unnecessary check<commit_after>define('app.board', ['app.column', 'app.toolkit'], function(Column, Toolkit) {

  var isValidPlayer = Toolkit.isValidPlayer,
      isValidCallback = Toolkit.isValidCallback


  function Board(width, height) {

    this._width = width
    this._height = height

    this._columns = new Array(width)
    //TODO: more attributes needed per player?
    this._players = ["red", "blue"]
    this._current_player_index = 0
    this._winning_callback
    this._move_callback

    for(var i = 0; i < width; i++) {
      this._columns[i] = new Column(height)
    }

  }

  Board.prototype = {

    get width() {
      return this._width
    },

    get height() {
      return this._height
    },

    get columns() {
      // just return a copy of the original columns array
      return this._columns.slice()
    },

    get current_player() {
      return this._players[this._current_player_index]
    },

    get player_one() {
      return this._players[0]
    },

    get player_two() {
      return this._players[1]
    },

    set player_one(one) {

      if (isValidPlayer(one)) {
        this._players[0] = one
      }

    },

    set player_two(two) {

      if (isValidPlayer(two)) {
        this._players[1] = two
      }

    },

    get winning_callback() {
      return this._winning_callback
    },

    set winning_callback(cb) {

      if (isValidCallback(cb)) {
        this._winning_callback = cb
      }

    },

    get move_callback() {
      return this._move_callback
    },

    set move_callback(cb) {

      if (isValidCallback(cb)) {
        this._move_callback = cb
      }

    },

    move: function(column_index) {

      var column = this._columns[column_index],
          used_slots

      // do not do anything if move is invalid
      if (!column || column.full) {
        console.log(column ? "full" : "invalid")
        return false
      }

      used_slots = column.insert(this.current_player)

      // switch to other player
      this._current_player_index = (this._current_player_index + 1) % 2

      if(this._move_callback) {
{'fraction_non_alphanumeric': 0.11369019422074846, 'fraction_numerical': 0.0037896731406916154, 'mean_word_length': 2.211406844106464, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '6362737', 'n_tokens_mistral': 1343, 'n_tokens_neox': 1279, 'n_words': 285}