Source: http://www.math.unicaen.fr/irem/j2m/wp-content/uploads/pdf/demotron_jeu.pdf