<commit_before>'use strict';

const levelFactory = {
  createLevelNumber : function(n) {
    return this.factories[n].call(this);
  },

  createTypicalPlayer : function(x, y) {
    return Player({
      shape : Circle({
        x : x,
        y : y,
        r : 10,
        style : '#FFFFFF',
        filled : true,
      }),
    });
  },

  createTypicalPlayerTrail : function() {
    return PlayerTrail({
      lineWidth : 2,
      smoothness : 8,
      style : '#444444',
    });
  },

  createTypicalGoal : function(x, y) {
    return Goal({
      shape : Circle({
        x : x,
        y : y,
        r : 30,
        style : '#FFFFFF',
        filled : false,
      }),
    });
  },

  createTypicalRectangleObstacle(method, x, y, width, height, style) {
    return Obstacle({
      shape : Rectangle[method]({
        x : x,
        y : y,
        width : width,
        height : height,
        style : (this.isDuringDevelopment && style) || '#444444',
      }),
    });
  },

  createTypicalBounds(width, height) {
    return Bounds({
      shape : Rectangle.fromCorner({
        x : 0,
        y : 0,
        width : width,
        height : height,
        style : 'transparent',
      }),
    });
  },

  factories : [
    function() {
      return Level({
        player : this.createTypicalPlayer(300, 300),
        playerTrail : this.createTypicalPlayerTrail(),
        gameplayObjects : [
          this.createTypicalBounds(600, 600),
          this.createTypicalGoal(500, 500),
          this.createTypicalRectangleObstacle('fromCorner', 0, 0, 600, 200),
        ],
      });
    },

    function() {
      return Level({
        player : this.createTypicalPlayer(60, 540),
        playerTrail : this.createTypicalPlayerTrail(),
        gameplayObjects : [
          this.createTypicalBounds(600, 600),
          this.createTypicalGoal(525, 60),
          this.createTypicalRectangleObstacle('fromCorner', 75, 0, 70, 120),
          this.createTypicalRectangleObstacle('fromCorner', 205, 0, 70, 120),
          this.createTypicalRectangleObstacle('fromCorner', 380, 0, 70, 120),
          this.createTypicalRectangleObstacle('fromCorner', 75, 120, 450, 120),
          this.createTypicalRectangleObstacle('fromCorner', 450, 240, 75, 120),
          this.createTypicalRectangleObstacle('fromCorner', 575, 120, 25, 240),
          this.createTypicalRectangleObstacle('fromCorner', 550, 120, 25, 120),
          this.createTypicalRectangleObstacle('fromCorner', 0, 300, 450, 60),
          this.createTypicalRectangleObstacle('fromCorner', 0, 360, 200, 120),
          this.createTypicalRectangleObstacle('fromCorner', 400, 360, 200, 120),
        ],
      });
    },

    function() {
      return Level({
        player : this.createTypicalPlayer(40, 30),
        playerTrail : this.createTypicalPlayerTrail(),
        gameplayObjects : [
          this.createTypicalBounds(600, 600),
          this.createTypicalGoal(560, 60),
          this.createTypicalRectangleObstacle('fromCorner', 0, 0, 20, 60, 'blue'),
          this.createTypicalRectangleObstacle('fromCorner', 0, 120, 20, 60, 'blue'),
          this.createTypicalRectangleObstacle('fromCorner', 40, 180, 20, 120, 'yellow'),
          this.createTypicalRectangleObstacle('fromCorner', 20, 300, 40, 60, 'blue'),
          this.createTypicalRectangleObstacle('fromCorner', 40, 360, 40, 60, 'blue'),
          this.createTypicalRectangleObstacle('fromCorner', 20, 420, 40, 60, 'blue'),
          this.createTypicalRectangleObstacle('fromCorner', 0, 480, 20, 120, 'orange'),
          this.createTypicalRectangleObstacle('fromCorner', 40, 540, 40, 60, 'yellow'),
          this.createTypicalRectangleObstacle('fromCorner', 80, 480, 40, 60, 'teal'),
          this.createTypicalRectangleObstacle('fromCorner', 120, 540, 120, 60, 'purple'),
          this.createTypicalRectangleObstacle('fromCorner', 280, 540, 120, 60, 'purple'),
          this.createTypicalRectangleObstacle('fromCorner', 440, 540, 120, 60, 'purple'),
          this.createTypicalRectangleObstacle('fromCorner', 180, 480, 40, 60, 'chartreuse'),
          this.createTypicalRectangleObstacle('fromCorner', 280, 480, 40, 60, 'chartreuse'),
          this.createTypicalRectangleObstacle('fromCorner', 320, 300, 40, 180, 'navy'),
          this.createTypicalRectangleObstacle('fromCorner', 360, 360, 40, 120, 'navy'),
          this.createTypicalRectangleObstacle('fromCorner', 400, 420, 40, 120, 'navy'),
          this.createTypicalRectangleObstacle('fromCorner', 440, 360, 80, 120, 'navy'),
          this.createTypicalRectangleObstacle('fromCorner', 520, 420, 20, 60, 'indianred'),
          this.createTypicalRectangleObstacle('fromCorner', 520, 360, 40, 60, 'indianred'),
          this.createTypicalRectangleObstacle('fromCorner', 540, 300, 40, 60, 'indianred'),
          this.createTypicalRectangleObstacle('fromCorner', 560, 240, 40, 60, 'indianred'),
          this.createTypicalRectangleObstacle('fromCorner', 460, 0, 40, 60, 'darkgreen'),
          this.createTypicalRectangleObstacle('fromCorner', 400, 60, 120, 60, 'darkgreen'),
          this.createTypicalRectangleObstacle('fromCorner', 420, 120, 120, 60, 'darkgreen'),
          this.createTypicalRectangleObstacle('fromCorner', 440, 180, 120, 60, 'darkgreen'),
          this.createTypicalRectangleObstacle('fromCorner', 400, 240, 120, 60, 'darkgreen'),
          this.createTypicalRectangleObstacle('fromCorner', 340, 120, 60, 60, 'skyblue'),
          this.createTypicalRectangleObstacle('fromCorner', 300, 180, 60, 60, 'skyblue'),
          this.createTypicalRectangleObstacle('fromCorner', 520, 480, 40, 60, 'green'),
          this.createTypicalRectangleObstacle('fromCorner', 60, 0, 60, 240, 'white'),
          this.createTypicalRectangleObstacle('fromCorner', 120, 0, 20, 60, 'teal'),
          this.createTypicalRectangleObstacle('fromCorner', 160, 0, 40, 180, 'orange'),
          this.createTypicalRectangleObstacle('fromCorner', 240, 0, 40, 120, 'orange'),
          this.createTypicalRectangleObstacle('fromCorner', 340, 0, 40, 60, 'orange'),
          this.createTypicalRectangleObstacle('fromCorner', 300, 60, 40, 60, 'orange'),
          this.createTypicalRectangleObstacle('fromCorner', 180, 180, 20, 60, 'brown'),
          this.createTypicalRectangleObstacle('fromCorner', 220, 240, 20, 60, 'green'),
          this.createTypicalRectangleObstacle('fromCorner', 200, 120, 40, 120, 'yellow'),
          this.createTypicalRectangleObstacle('fromCorner', 240, 180, 40, 60, 'coral'),
          this.createTypicalRectangleObstacle('fromCorner', 80, 240, 80, 240, 'white'),
          this.createTypicalRectangleObstacle('fromCorner', 160, 300, 20, 120, 'gray'),
          this.createTypicalRectangleObstacle('fromCorner', 240, 240, 80, 240, 'red'),
        ],
      });
    },
  ],

  isDuringDevelopment : false,
};<commit_msg>added shortcuts for level factories<commit_after>'use strict';

const levelFactory = {
  createLevelNumber : function(n) {
    return this.factories[n].call(this);
  },

  createTypicalPlayer : function(x, y) {
    return Player({
      shape : Circle({
        x : x,
        y : y,
        r : 10,
        style : '#FFFFFF',
        filled : true,
      }),
    });
  },

  createTypicalPlayerTrail : function() {
    return PlayerTrail({
      lineWidth : 2,
      smoothness : 8,
      style : '#444444',
    });
  },

  createTypicalGoal : function(x, y) {
    return Goal({
      shape : Circle({
        x : x,
        y : y,
        r : 30,
        style : '#FFFFFF',
        filled : false,
      }),
    });
  },

  createTypicalRectangleObstacle(method, x, y, width, height, style) {
    return Obstacle({
      shape : Rectangle[method]({
        x : x,
        y : y,
        width : width,
        height : height,
        style : (this.isDuringDevelopment && style) || '#444444',
      }),
    });
  },

  createTypicalBounds(width, height) {
    return Bounds({
      shape : Rectangle.fromCorner({
        x : 0,
        y : 0,
        width : width,
        height : height,
        style : 'transparent',
      }),
    });
  },

  factories : [
    function() {
      return Level({
        player : this.createTypicalPlayer(300, 300),
        playerTrail : this.createTypicalPlayerTrail(),
        gameplayObjects : [
          this.createTypicalBounds(600, 600),
          this.createTypicalGoal(500, 500),
          this.createTypicalRectangleObstacle('fromCorner', 0, 0, 600, 200),
        ],
      });
    },

    function() {
      const rectObstacle = this.createTypicalRectangleObstacle.bind(this, 'fromCorner');
      return Level({
        player : this.createTypicalPlayer(60, 540),
        playerTrail : this.createTypicalPlayerTrail(),
        gameplayObjects : [
          this.createTypicalBounds(600, 600),
          this.createTypicalGoal(525, 60),
          rectObstacle(75, 0, 70, 120),
          rectObstacle(205, 0, 70, 120),
          rectObstacle(380, 0, 70, 120),
          rectObstacle(75, 120, 450, 120),
          rectObstacle(450, 240, 75, 120),
          rectObstacle(575, 120, 25, 240),
          rectObstacle(550, 120, 25, 120),
          rectObstacle(0, 300, 450, 60),
          rectObstacle(0, 360, 200, 120),
          rectObstacle(400, 360, 200, 120),
        ],
      });
    },

    function() {
      const rectObstacle = this.createTypicalRectangleObstacle.bind(this, 'fromCorner');
      return Level({
        player : this.createTypicalPlayer(40, 30),
        playerTrail : this.createTypicalPlayerTrail(),
        gameplayObjects : [
          this.createTypicalBounds(600, 600),
          this.createTypicalGoal(560, 60),
          rectObstacle(0, 0, 20, 60, 'blue'),
          rectObstacle(0, 120, 20, 60, 'blue'),
          rectObstacle(40, 180, 20, 120, 'yellow'),
          rectObstacle(20, 300, 40, 60, 'blue'),
          rectObstacle(40, 360, 40, 60, 'blue'),
          rectObstacle(20, 420, 40, 60, 'blue'),
          rectObstacle(0, 480, 20, 120, 'orange'),
          rectObstacle(40, 540, 40, 60, 'yellow'),
          rectObstacle(80, 480, 40, 60, 'teal'),
          rectObstacle(120, 540, 120, 60, 'purple'),
          rectObstacle(280, 540, 120, 60, 'purple'),
          rectObstacle(440, 540, 120, 60, 'purple'),
          rectObstacle(180, 480, 40, 60, 'chartreuse'),
          rectObstacle(280, 480, 40, 60, 'chartreuse'),
          rectObstacle(320, 300, 40, 180, 'navy'),
          rectObstacle(360, 360, 40, 120, 'navy'),
          rectObstacle(400, 420, 40, 120, 'navy'),
          rectObstacle(440, 360, 80, 120, 'navy'),
          rectObstacle(520, 420, 20, 60, 'indianred'),
          rectObstacle(520, 360, 40, 60, 'indianred'),
          rectObstacle(540, 300, 40, 60, 'indianred'),
          rectObstacle(560, 240, 40, 60, 'indianred'),
          rectObstacle(460, 0, 40, 60, 'darkgreen'),
          rectObstacle(400, 60, 120, 60, 'darkgreen'),
          rectObstacle(420, 120, 120, 60, 'darkgreen'),
          rectObstacle(440, 180, 120, 60, 'darkgreen'),
          rectObstacle(400, 240, 120, 60, 'darkgreen'),
          rectObstacle(340, 120, 60, 60, 'skyblue'),
          rectObstacle(300, 180, 60, 60, 'skyblue'),
          rectObstacle(520, 480, 40, 60, 'green'),
          rectObstacle(60, 0, 60, 240, 'white'),
          rectObstacle(120, 0, 20, 60, 'teal'),
          rectObstacle(160, 0, 40, 180, 'orange'),
          rectObstacle(240, 0, 40, 120, 'orange'),
          rectObstacle(340, 0, 40, 60, 'orange'),
          rectObstacle(300, 60, 40, 60, 'orange'),
          rectObstacle(180, 180, 20, 60, 'brown'),
          rectObstacle(220, 240, 20, 60, 'green'),
          rectObstacle(200, 120, 40, 120, 'yellow'),
          rectObstacle(240, 180, 40, 60, 'coral'),
          rectObstacle(80, 240, 80, 240, 'white'),
          rectObstacle(160, 300, 20, 120, 'gray'),
          rectObstacle(240, 240, 80, 240, 'red'),
        ],
      });
    },
  ],

  isDuringDevelopment : false,
};
{'fraction_non_alphanumeric': 0.14440251572327045, 'fraction_numerical': 0.10029350104821803, 'mean_word_length': 2.6639016897081413, 'pattern_counts': {'":': 0, '<': 3, '<?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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1016530', 'n_tokens_mistral': 5033, 'n_tokens_neox': 3865, 'n_words': 849}