<commit_before>"use strict";

let canvas  = document.getElementById('game');
let context = canvas.getContext('2d');
let $       = require('jQuery');
let Board  = require('./board');
let board = new Board();
let currentShape = board.pieces[0];

$(document).ready(function(){
  userInput();
  emptyBoard();
});

$('.score').text(board.score);

function emptyBoard() {
  context.clearRect(0, 0, canvas.width, canvas.height);
  context.lineWidth = 2;
  context.strokeStyle= "#000000";
  context.strokeRect(0, 0, canvas.width, canvas.height);
}

function drawBoard() {
  requestAnimationFrame(function gameLoop() {

    context.clearRect(0, 0, canvas.width, canvas.height);
    context.lineWidth = 2;
    context.strokeStyle= "#000000";
    context.strokeRect(0, 0, canvas.width, canvas.height);
    board.draw(context);

    if (!currentShape || currentShape.active === false) {
      // generate rando shape
      currentShape = board.generateShape();
    } else {
      // move shape down if blocks are above bottom row height
        if (currentShape.piece.shape[4].y < board.rows &&
            currentShape.piece.shape[3].y < board.rows &&
            currentShape.piece.shape[2].y < board.rows &&
            currentShape.piece.shape[1].y < board.rows) {

          if ( currentShape.canMoveDown(currentShape, board) ) {
            currentShape.moveShapeDown();
          }

        } else {
                // change the shape status to false<commit_msg>Starting to fix bug with currentShape movement on L & R side of board<commit_after>"use strict";

let canvas  = document.getElementById('game');
let context = canvas.getContext('2d');
let $       = require('jQuery');
let Board  = require('./board');
let board = new Board();
let currentShape = board.pieces[0];

$(document).ready(function(){
  userInput();
  emptyBoard();
});

$('.score').text(board.score);

function emptyBoard() {
  context.clearRect(0, 0, canvas.width, canvas.height);
  context.lineWidth = 2;
  context.strokeStyle= "#000000";
  context.strokeRect(0, 0, canvas.width, canvas.height);
}

function drawBoard() {
  requestAnimationFrame(function gameLoop() {

    context.clearRect(0, 0, canvas.width, canvas.height);
    context.lineWidth = 2;
    context.strokeStyle= "#000000";
    context.strokeRect(0, 0, canvas.width, canvas.height);
    board.draw(context);

    if (!currentShape || currentShape.active === false) {
      // generate rando shape
      currentShape = board.generateShape();
    } else {

      // check currentShape for left side of the board
      if ( (currentShape.piece.shape[4].x < board.columns &&
            currentShape.piece.shape[3].x < board.columns &&
            currentShape.piece.shape[2].x < board.columns &&
            currentShape.piece.shape[1].x < board.columns) &&

      // check currentShape for right side of the board
           (currentShape.piece.shape[4].x < board.columns &&
            currentShape.piece.shape[3].x < board.columns &&
            currentShape.piece.shape[2].x < board.columns &&
            currentShape.piece.shape[1].x < board.columns))

            // NEED TO CLOSE { }

      // move shape down if blocks are above bottom row height
        if (currentShape.piece.shape[4].y < board.rows &&
            currentShape.piece.shape[3].y < board.rows &&
            currentShape.piece.shape[2].y < board.rows &&
            currentShape.piece.shape[1].y < board.rows) {

          if ( currentShape.canMoveDown(currentShape, board) ) {
            currentShape.moveShapeDown();
          }

        } else {
                // change the shape status to false
{'fraction_non_alphanumeric': 0.14273835920177383, 'fraction_numerical': 0.017738359201773836, 'mean_word_length': 2.815010570824524, 'pattern_counts': {'":': 0, '<': 19, '<?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': '1589399', 'n_tokens_mistral': 1074, 'n_tokens_neox': 1025, 'n_words': 237}