<commit_before>function Game() {
  this.rolls = []
  this._currentRoll = 0;
}

Game.prototype.roll = function(pins) {
  return this.rolls[this._currentRoll++] = pins;
}

Game.prototype.getScore = function() {
  var score = 0;
  var frameIndex = 0;
  for (frame = 0; frame < 10; frame++)
    if (this.rolls[frameIndex] == 10) {
      score += 10 + this._strikeBonus(frameIndex);
      frameIndex++;
    }
    else if (this._isSpare(frameIndex)) {
      score += 10 + this._spareBonus(frameIndex);
      frameIndex += 2;
    } else {
      score += this._sumOfBallsInFrame(frameIndex);
      frameIndex += 2;
    }
  return score;
}

Game.prototype._isSpare = function(frameIndex) {
  return this.rolls[frameIndex] + this.rolls[frameIndex + 1] === 10<commit_msg>refactor isStrike into a seperate private function<commit_after>function Game() {
  this.rolls = []
  this._currentRoll = 0;
}

Game.prototype.roll = function(pins) {
  return this.rolls[this._currentRoll++] = pins;
}

Game.prototype.getScore = function() {
  var score = 0;
  var frameIndex = 0;
  for (frame = 0; frame < 10; frame++)
    if (this._isStrike(frameIndex)) {
      score += 10 + this._strikeBonus(frameIndex);
      frameIndex++;
    }
    else if (this._isSpare(frameIndex)) {
      score += 10 + this._spareBonus(frameIndex);
      frameIndex += 2;
    } else {
      score += this._sumOfBallsInFrame(frameIndex);
      frameIndex += 2;
    }
  return score;
}

Game.prototype._isStrike = function(frameIndex) {
  return this.rolls[frameIndex] === 10;
}

Game.prototype._isSpare = function(frameIndex) {
  return this.rolls[frameIndex] + this.rolls[frameIndex + 1] === 10
{'fraction_non_alphanumeric': 0.14441747572815533, 'fraction_numerical': 0.02063106796116505, 'mean_word_length': 3.3624338624338623, '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': '1275799', 'n_tokens_mistral': 598, 'n_tokens_neox': 558, 'n_words': 115}