<commit_before>const $ = require('jquery');
const Board = require('./board.js')
const Snake = require('./snake.js')

let canvas = document.getElementById("canvas");
let ctx = canvas.getContext('2d');

let board = new Board(canvas, ctx);
let snake = new Snake();

function animate() {
  requestAnimationFrame(function gameLoop() {
    keyDownListener();
    ctx.clearRect(0, 0, canvas.width, canvas.height);
    snake.draw();
    // snake.moveDown;
    if (snake.wallDetection === true) {
    } else {
      requestAnimationFrame(gameLoop);
    }
  }
)};

function keyDownListener() {
  $(document).keydown(function(e) {
    if (e.keyCode === 37) {
      console.log("Left")
      snake.moveLeft;
    } else if (e.keyCode == 38) {
      console.log("Up")
      snake.moveUp;
    } else if (e.keyCode == 39) {
      console.log("Right")
      snake.moveRight;
    } else if (e.keyCode = 40) {
      console.log("Down")
      snake.moveDown;<commit_msg>We are now working with a moving dingus and need to work out the logic of having a continually moving snake, event emitters and getting the snake to not pause on a redirect<commit_after>const $ = require('jquery');
const Board = require('./board.js')
const Snake = require('./snake.js')

let canvas = document.getElementById("canvas");
let ctx = canvas.getContext('2d');

let board = new Board(canvas, ctx);
let snake = new Snake();

keyDownListener();

function animate() {
  requestAnimationFrame(function gameLoop() {
    ctx.clearRect(0, 0, canvas.width, canvas.height);
    snake.draw(); // will draw everything
    // snake.move(event.direction)
    if (snake.wallDetection === true) {

    } else {
      requestAnimationFrame(gameLoop);
    }
  }
)};

function keyDownListener() {
  $(document).keydown(function(e) {
    if (e.keyCode === 37) {
      // e.snakeDirectionChange(left)
      snake.moveLeft;
    } else if (e.keyCode === 38) {
      snake.moveUp;
    } else if (e.keyCode === 39) {
      snake.moveRight;
    } else if (e.keyCode === 40) {
      snake.moveDown;
{'fraction_non_alphanumeric': 0.15354330708661418, 'fraction_numerical': 0.010826771653543307, 'mean_word_length': 3.226611226611227, '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': '6737275', 'n_tokens_mistral': 659, 'n_tokens_neox': 647, 'n_words': 161}