Trial to implement the bresenham algorithm