 
 mergeCells = (row, direction) ->
 
-  if direction is 'right'
+  merge = (row) ->
     for a in [3...0]
       for b in [a-1..0]
 

showBoard = (board) ->
  for row in [0..3]
    for col in [0..3]
      $(".r#{row}.c#{col} > div").html(board[row][col])

printArray = (array) ->
  console.log "--- Start ---"

          row[b] = 0
          break
        else if row[b] isnt 0 then break
    row

  if direction is 'right'
    merge row
  else if direction is 'left'
    merge(row.reverse()).reverse()

collapseCells = (row, direction) ->
  row = row.filter (ele) -> ele isnt 0
