<commit_before>var running = true;

var Game = function() {
  $( 'body' ).append( '<canvas id="spellquest"></canvas>' );
  $( 'body' ).append( '<canvas id="spellquest-background"></canvas>' );
  this._canvas = document.getElementById( 'spellquest' );
  this._ctx = this._canvas.getContext( '2d' );

  this._backgroundCanvas = document.getElementById( 'spellquest-background' );
  this._backgroundCtx = this._backgroundCanvas.getContext( '2d' );

  this.WIDTH = window.innerWidth;
  this.HEIGHT = window.innerHeight;

  this._canvas.width = this.WIDTH;
  this._canvas.height = this.HEIGHT;

  this._backgroundCanvas.style.backgroundColor = "#DDDDDD";
  this._backgroundCanvas.width = this.WIDTH;
  this._backgroundCanvas.height = this.HEIGHT;

  this._prevTime = Date.now();
  this._currTime = this._prevTime;

  this._entities = [];

  this.EPSILON = 1e-20;

  // Pool of letters the player can select form.
  this._pool = new Pool();
  this._pool.setPosition( 100, 100 );
  this._pool.setSpacing( 90 );
  this._pool.setWidth( 70 );
  this._pool.setHeight( 70 );
  this._pool.setColor( 240, 63, 53, 1.0 );
  this._pool.setTextColor( 255, 255, 255, 1.0 );
  this._pool.setFontSize( 24 );

  this._dict = new Dictionary();
  var word = this._dict.getRandomWord();
  while ( word.length < 5 )
    word = this._dict.getRandomWord();

  this._dict.createMap();
  this._subWords = this._dict.getSubWords( word );
  for ( i = 0; i < this._subWords.length; i++ ) {
    console.log( this._subWords[i] );
  }

  console.log( word );
  this._pool.setLetters( word.split( '' ) );
  var letters = this._pool.getLetters();

  // Form where player inputs the word guess.
  this._form = new Form();
  this._form.setPosition( 100, 250 );
  this._form.setSpacing( 90 );
  this._form.setWidth( 75 );
  this._form.setHeight( 75 );
  this._form.setColor( 100, 100, 100, 1.0 );
  this._form.setLineWidth( 5 );
  this._form.createFormElements( letters.length );

  // List displaying all correctly spelled words.
  this._list = new List();
  this._list.setPosition( 100, 360 );
  this._list.setWidth( 20 );
  this._list.setHeight( 20 );
  this._list.setColor( 0, 55, 55, 1.0 );
  this._list.setBackgroundColor( 0, 0, 0, 1.0 );
  this._list.setTextColor( 255, 255, 255, 1.0 );
  this._list.setLineWidth( 2 );
  this._list.setHorizontalSpacing( 40 );
  this._list.setPadding( 100 );
  this._list.setMaxHeight( this.HEIGHT );
  this._list.setWords( this._subWords );

  this._ui = new UI();

  var resetButton = new ResetButton();
  resetButton.setPosition( 100, 30 );
  resetButton.setWidth( 80 );
  resetButton.setHeight( 30 );
  resetButton.setColor( 0, 0, 0, 1.0 );
  resetButton.setTextColor( 255, 255, 255, 1.0 );
  this._ui.addButton( resetButton );

  var shuffleButton = new ShuffleButton();
  shuffleButton.setPosition( 200, 30 );
  shuffleButton.setWidth( 80 );<commit_msg>Tweaks to compact UI.<commit_after>var running = true;

var Game = function() {
  $( 'body' ).append( '<canvas id="spellquest"></canvas>' );
  $( 'body' ).append( '<canvas id="spellquest-background"></canvas>' );
  this._canvas = document.getElementById( 'spellquest' );
  this._ctx = this._canvas.getContext( '2d' );

  this._backgroundCanvas = document.getElementById( 'spellquest-background' );
  this._backgroundCtx = this._backgroundCanvas.getContext( '2d' );

  this.WIDTH = window.innerWidth;
  this.HEIGHT = window.innerHeight;

  this._canvas.width = this.WIDTH;
  this._canvas.height = this.HEIGHT;

  this._backgroundCanvas.style.backgroundColor = "#DDDDDD";
  this._backgroundCanvas.width = this.WIDTH;
  this._backgroundCanvas.height = this.HEIGHT;

  this._prevTime = Date.now();
  this._currTime = this._prevTime;

  this._entities = [];

  this.EPSILON = 1e-20;

  // Pool of letters the player can select form.
  this._pool = new Pool();
  this._pool.setPosition( 100, 100 );
  this._pool.setSpacing( 90 );
  this._pool.setWidth( 70 );
  this._pool.setHeight( 70 );
  this._pool.setColor( 240, 63, 53, 1.0 );
  this._pool.setTextColor( 255, 255, 255, 1.0 );
  this._pool.setFontSize( 24 );

  this._dict = new Dictionary();
  var word = this._dict.getRandomWord();
  while ( word.length < 5 )
    word = this._dict.getRandomWord();

  this._dict.createMap();
  this._subWords = this._dict.getSubWords( word );
  for ( i = 0; i < this._subWords.length; i++ ) {
    console.log( this._subWords[i] );
  }

  console.log( word );
  this._pool.setLetters( word.split( '' ) );
  var letters = this._pool.getLetters();

  // Form where player inputs the word guess.
  this._form = new Form();
  this._form.setPosition( 100, 200 );
  this._form.setSpacing( 90 );
  this._form.setWidth( 75 );
  this._form.setHeight( 75 );
  this._form.setColor( 100, 100, 100, 1.0 );
  this._form.setLineWidth( 5 );
  this._form.createFormElements( letters.length );

  // List displaying all correctly spelled words.
  this._list = new List();
  this._list.setPosition( 100, 270 );
  this._list.setWidth( 20 );
  this._list.setHeight( 20 );
  this._list.setColor( 0, 55, 55, 1.0 );
  this._list.setBackgroundColor( 0, 0, 0, 1.0 );
  this._list.setTextColor( 255, 255, 255, 1.0 );
  this._list.setLineWidth( 2 );
  this._list.setHorizontalSpacing( 40 );
  this._list.setPadding( 100 );
  this._list.setMaxHeight( this.HEIGHT );
  this._list.setWords( this._subWords );

  this._ui = new UI();

  var resetButton = new ResetButton();
  resetButton.setPosition( 100, 30 );
  resetButton.setWidth( 80 );
  resetButton.setHeight( 30 );
  resetButton.setColor( 0, 0, 0, 1.0 );
  resetButton.setTextColor( 255, 255, 255, 1.0 );
  this._ui.addButton( resetButton );

  var shuffleButton = new ShuffleButton();
  shuffleButton.setPosition( 200, 30 );
  shuffleButton.setWidth( 80 );
{'fraction_non_alphanumeric': 0.15566037735849056, 'fraction_numerical': 0.047519217330538085, 'mean_word_length': 3.673469387755102, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 11, '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': '4392315', 'n_tokens_mistral': 2212, 'n_tokens_neox': 1927, 'n_words': 429}