-
-
 horizontalLine = (character, width) ->
-    Array[width].join(character)
+    if width == 0
+        ""
+    else
+        Array( width + 1 ).join(character);
 
 findLargestNumberWidth = (listOfLists) ->
     max = listOfLists[0][0]

    textTable = ""
    for list in listOfLists
        textTable += horizontalLine("-", tableWidth) + "\n"
        textTable += createRow(list, maxNumberWidth) + "\n"
    textTable += horizontalLine("-", tableWidth)

module.exports.convertToText = (listOfLists, padding = 1) ->

    widthOfVerticalSeparatorsInRow = numberOfColumns + 1
    widthOfNumbersInRow + widthOfPaddingInRow + widthOfVerticalSeparatorsInRow

createRowText = (listOfNumbers, maxNumberWidth) ->
    row = "|"
    for number in listOfNumbers
        paddingWidth = maxNumberWidth - number.toString().length
