Commit 65f6be8a authored by Philippe Dpt35's avatar Philippe Dpt35

Optimisation de ls foncion estPresent

parent 7a01ce30
......@@ -32,14 +32,12 @@ function alea(min,max) {
}
function estPresent(nombre, tableau) {
var present = false;
for (var i = 0; i < tableau.length; i++) {
if (tableau[i] === nombre) {
present = true;
break;
if ( tableau[i] === nombre ) {
return true;
}
}
return present;
return false;
}
function aleaDifferent(min,max,quantite) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment