Logique
Boucles
Math
Texte
Listes
Données
Variables
Fonctions
Programmation
p5.js
Objets web
Propriétés
Formes
Tortue
Apparence
GeoGebra
var canevas, n, listes, liste, i, j, tableau, gliss, listesFormats, listeFormats, k, x, y; /** * Fonction exécutée une fois, au départ */ function actions_initiales() { document.body.style.paddingLeft="30px"; createElement("h1",'Table de multiplication modulo un nombre spécifié'); gliss=nouvelleGlissiereValeur('Modulo ',2,40,23,1); createSpan("<br>"); createSpan("<br>"); tableau=creerAffichageListes([],1,"PIXELS","INACTIVEE",500,24); } /** * Fonction exécutée périodiquement, de façon répétée */ function actions_en_boucle() { n = valeurPrudent("gliss",gliss); listes = []; listesFormats = []; listeFormats = []; liste = faire_liste_simple('×', 1); listes.push(liste); listesFormats.push(listeFormats); for (i = 0; i <= n - 1; i += abs(1)) { liste = faire_liste_simple(i, i); listes.push(liste); listesFormats.push(listeFormats); } for (k = 0; k <= n; k += abs(1)) { (listesFormats[k])[0] = 'color:rgb(255,255,255);background:rgb(0,0,255)'; (listesFormats[0])[k] = 'color:rgb(255,255,255);background:rgb(0,0,255);font-weight:bold'; } afficherListesFormat(listes,listesFormats,tableau); } /** * Décrire cette fonction… */ function faire_liste_simple(x, y) { liste = [x]; listeFormats = ['']; for (j = 0; j <= n - 1; j += abs(1)) { liste.push(((y * j) % n)); listeFormats.push(''); } return liste; }