<commit_before>'use strict'

import {Board, BaseBlock} from './board'

// polyfill requestAnimationFrame method
const vendors = ['webkit', 'moz'];
for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
  window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
  window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
}

main()

function main () {
  const canvas = document.querySelector('#main')
  const ctx = canvas.getContext('2d')
  const keyPressed = {}
  
  const board = new Board(20, 20)
  
  // handle and translate keyboard into action
  document.addEventListener('keydown', evt => {
    let action = ''
    switch (evt.which) {
      case 72:
        action = 'left'
        break
      case 74:
        action = 'down'<commit_msg>add keyboard arrow key control<commit_after>'use strict'

import {Board, BaseBlock} from './board'

// polyfill requestAnimationFrame method
const vendors = ['webkit', 'moz'];
for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
  window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
  window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
}

main()

function main () {
  const canvas = document.querySelector('#main')
  const ctx = canvas.getContext('2d')
  const keyPressed = {}
  
  const board = new Board(20, 20)
  
  // handle and translate keyboard into action
  document.addEventListener('keydown', evt => {
    console.log(evt.which)
    let action = ''
    switch (evt.which) {
      case 37:
        action = 'left'
        break
      case 38:
        action = 'rotate'
        break
      case 39:
        action = 'right'
        break
      case 40:
        action = 'down'
        break
      case 72:
        action = 'left'
        break
      case 74:
        action = 'down'
{'fraction_non_alphanumeric': 0.12873796249366448, 'fraction_numerical': 0.01419158641662443, 'mean_word_length': 3.1125, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '449560', 'n_tokens_mistral': 601, 'n_tokens_neox': 583, 'n_words': 158}