Implementing the maze algorithm with c language