Click on green flag. Instructions in the project.
A big thanks to @ffred by the programming,a lot simpler than my initial procedure. Based on a puzzle in "Castor Informatique" http://castor-informatique.fr/ , with my modifications. Thanks to @mathjp by the link.