# Kata Task 
Connect the dots in order to make a picture!
# Notes
* There are 2-26 dots labelled  `a` `b` `c` ...
* The line char is `*`
* Use only straight lines - vertical, horizontal, or diagonals of a square
* The paper is rectangular - `\n` terminates every line
* All input is valid
# Examples
InputExpected
 a       b 
 e         
 d       c 
 *********
 *       *
 *       *
 *********
InputExpected
    a
   e
 d     b
    c
    *
   * *
  *   *
 *     *
  *   *
   * *
    *
def connect_the_dots(paper):
    
    laliste = paper[:-1].split("\n")
    tablo = [[' ' for i in range(len(laliste[0]))] for j in range(len(laliste)) ]
    lesPositions = []
    
    for i, ligne in enumerate(laliste):
        listeCar = list(ligne)
        #listeCar.pop()
        for j, car in enumerate(listeCar):
            if 97<=ord(car)<=122:
                lesPositions.append((car, i, j))
    lesPositions.sort(key = lambda x:x[0])
    pointA = lesPositions.pop()
    while lesPositions:
        pointB = lesPositions.pop()
        if pointA[1] == pointB[1]: #ligne verticale
            ext = [pointB[2], pointA[2]]
            for y in range(min(ext), max(ext)+1):
                tablo[pointA[1]][y] = '*'
                
        elif pointA[2] == pointB[2]: #ligne horizontale
            ext = [pointB[1], pointA[1]]
            for x in range(min(ext), max(ext)+1):
                tablo[x][pointA[2]] = '*'
        else :
            dx = 1 if pointA[1]<pointB[1] else -1
            dy = 1 if pointA[2]<pointB[2] else -1
            y = pointA[2]
            for x in range(pointA[1], pointB[1]+dx, dx):
                tablo[x][y]='*'
                y += dy
        pointA = pointB
                
    tablo2 = [''.join(ligne)+'\n' for ligne in tablo]
    return ''.join(tablo2)
def connect_the_dots(paper):
    
    laliste = paper[:-1].split("\n")
    tablo = [[' ' for i in range(len(laliste[0]))] for j in range(len(laliste)) ]
    lesPositions = []
    
    for i, ligne in enumerate(laliste):
        listeCar = list(ligne)
        #listeCar.pop()
        for j, car in enumerate(listeCar):
            if 97<=ord(car)<=122:
                lesPositions.append((car, i, j))
    lesPositions.sort(key = lambda x:x[0])
    pointA = lesPositions.pop()
    while lesPositions:
        pointB = lesPositions.pop()
        if pointA[1] == pointB[1]: #ligne verticale
            ext = [pointB[2], pointA[2]]
            for y in range(min(ext), max(ext)+1):
                tablo[pointA[1]][y] = '*'
                
        elif pointA[2] == pointB[2]: #ligne horizontale
            ext = [pointB[1], pointA[1]]
            for x in range(min(ext), max(ext)+1):
                tablo[x][pointA[2]] = '*'
        else :
            dx = 1 if pointA[1]<pointB[1] else -1
            dy = 1 if pointA[2]<pointB[2] else -1
            y = pointA[2]
            for x in range(pointA[1], pointB[1]+dx, dx):
                tablo[x][y]='*'
                y += dy
        pointA = pointB
                
    tablo2 = [''.join(ligne)+'\n' for ligne in tablo]
    return ''.join(tablo2)