###############################################################################
#   REMPLISSAGE D'UN CONTOUR
################################################################################

import numpy as np, matplotlib.pyplot as plt

image=[[0]*8 for k in range(8)] 
contour=[[1,2],[1,3],[2,4],[3,5],[4,6],[5,6],[6,5],[6,4],[6,3],[5,2],[4,1],[3,1],[2,1]]
for pt in contour:
    image[pt[0]][pt[1]]=1


plt.imshow(np.array(image),cmap='Greys',interpolation='nearest')
plt.show()


def haut(pt):
    i,j=pt
    return [i-1,j]

def bas(pt):
    i,j=pt
    return [i+1,j]

def gauche(pt):
    i,j=pt
    return [i,j-1]

def droite(pt):
    i,j=pt
    return [i,j+1]
