function handledrag(e) {
  worker.addTask(Math.abs(e.dx) > Math.abs(e.dy) ?
    (e.dx > 0 ? e => board.moveRight(e) : e => board.moveLeft(e)) :
    (e.dy > 0 ? e => board.moveDown(e) : e => board.moveUp(e)));
  worker.addTask(e => board.drawResult(e));
}
// Handle a drag event (moving the stones around)
Handle a drag event (moving the stones around)
Handle a drag event ( moving the stones around )
function handledrag(e) {
  worker.addTask(Math.abs(e.dx) > Math.abs(e.dy) ?
    (e.dx > 0 ? e => board.moveRight(e) : e => board.moveLeft(e)) :
    (e.dy > 0 ? e => board.moveDown(e) : e => board.moveUp(e)));
  worker.addTask(e => board.drawResult(e));
}
function handledrag ( e ) { worker . addTask ( Math . abs ( e . dx ) > Math . abs ( e . dy ) ? ( e . dx > 0 ? e => board . moveRight ( e ) : e => board . moveLeft ( e ) ) : ( e . dy > 0 ? e => board . moveDown ( e ) : e => board . moveUp ( e ) ) ) ; worker . addTask ( e => board . drawResult ( e ) ) ; }
Handle a drag event (moving the stones around)
Handle a drag event ( moving the stones around )