function mathRandomInt(a, b) { return Math.floor(Math.random() * (b - a + 1) + a); } function tracerFigure() { fixerNbInitialObjets(5); fixerValeursAsurveiller(['n']); fixerPointsAsurveiller(['P', 'Q']); initialiser(); sautePos((coordX('P')),(coordY('P'))); fixeCap((vers((coordX('Q')),(coordY('Q'))))); for (i = valeur('n'); i >= 3; i++) { couleurCrayon((mathRandomInt(0, 255)),(mathRandomInt(0, 255)),(mathRandomInt(0, 255))); couleurRemplissage((mathRandomInt(0, 255)),(mathRandomInt(0, 255)),(mathRandomInt(0, 255)),0.1); debutRemplir(); polygone(i, valeur('Distance(P,Q)')); finRemplir(); } } function polygone(nbCotes, taille) { for (var count = 0; count < nbCotes; count++) { avance(taille); gauche(360 / k); } }