Simple digit code breaker

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
function tryCode(indications) {
if(!indications)
return proposition;
var a = proposition[0], b = proposition[1], c = proposition[2];
if(indications[0] > 0)
a++;
if(indications[1] > 0)
b++;
if(indications[2] > 0)
c++;
proposition = [a, b, c];
return proposition;
}
var proposition = [0, 0, 0];