<commit_before>var BG = {} // global container for game code

BG.canvas = document.getElementById("myCanvas");
BG.ctx = BG.canvas.getContext("2d");

BG.redSquare = function (ctx){
  ctx.beginPath();
  ctx.rect(20, 40, 50, 50);
  ctx.fillStyle = "#FF0000";
  ctx.fill();
  ctx.closePath();
  };

BG.redSquare(BG.ctx);
<commit_msg>breakout: draw a green disc<commit_after>var BG = {} // global container for game code

BG.canvas = document.getElementById("myCanvas");
BG.ctx = BG.canvas.getContext("2d");

BG.redSquare = function (ctx){
  ctx.beginPath();
  ctx.rect(20, 40, 50, 50);
  ctx.fillStyle = "#FF0000";
  ctx.fill();
  ctx.closePath();
  };


// Why doesn't this work?
// function foo (ctx) {
//   ctx.beginPath();
//   ctx.arc(240, 160, 20, 0, Math.PI*2, false);
//   ctx.fillStyle= "green";
//   ctx.fill();
//   ctx.closePath();
//   }(BG.ctx);

BG.greenSquare = function (ctx){
  ctx.beginPath();
  ctx.arc(240, 160, 20, 0, Math.PI*2, false);
  ctx.fillStyle= "green";
  ctx.fill();
  ctx.closePath();
  }

BG.redSquare(BG.ctx);
BG.greenSquare(BG.ctx);

{'fraction_non_alphanumeric': 0.20469483568075117, 'fraction_numerical': 0.0431924882629108, 'mean_word_length': 3.575107296137339, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1497143', 'n_tokens_mistral': 446, 'n_tokens_neox': 404, 'n_words': 86}