<commit_before>import Ember from 'ember';

export default Ember.ObjectController.extend({
  cells: Ember.computed.alias('content.board.cells'),
  spinner: Ember.computed.alias('content.board.spinner'),
  actions: {
    newGameClick: function() {
      this.get('content').newGame();
    },
    cellClick: function(cell) {
      if (this.get('spinner').indexOf(cell.get('value')) > -1) {
        cell.set('value', 'X');
        this.get('board').incrementProperty('covered');
      }
    },
    spinClick: function() {
      if (this.get('spins') < this.get('maxSpins')) {
        this.incrementProperty('spins');
        this.get('board').spin();
      }
    }
  }
});<commit_msg>Adjust score for devil and coin<commit_after>import Ember from 'ember';

export default Ember.ObjectController.extend({
  cells: Ember.computed.alias('content.board.cellMatrix'),
  spinner: Ember.computed.alias('content.board.spinner'),
  score: Ember.computed.alias('content.score'),
  horizontalComplete: Ember.computed.alias('content.board.horizontalComplete'),
  verticalComplete: Ember.computed.alias('content.board.verticalComplete'),
  actions: {
    newGameClick: function() {
      this.get('content').newGame();
    },
    cellClick: function(cell) {
      if (this.get('spinner')[cell.get('col')].get('value') === cell.get('value') || this.get('spinner')[cell.get('col')].get('isJoker')) {
        cell.set('value', 'X');
        this.get('content').addScoreValue(200);
      }
    },
    spinClick: function() {
      var _this = this;
      if (this.get('spins') < this.get('maxSpins')) {
        this.incrementProperty('spins');
        this.get('board').spin();
        this.get('spinner').forEach( function(cell) {

          if(cell.get('isCoin')) {
            _this.get('content').addScoreValue(1000);
          }

          if(cell.get('isDevil')) {
            var score = _this.get('content.score');
            var penalty = score * -1 / 2;
            _this.get('content').addScoreValue(penalty);
          }
        });
      }
    }
  }
});
{'fraction_non_alphanumeric': 0.18670576735092864, 'fraction_numerical': 0.004887585532746823, 'mean_word_length': 2.998046875, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '6636176', 'n_tokens_mistral': 656, 'n_tokens_neox': 645, 'n_words': 89}