algorithm fix

This commit is contained in:
GotPPay
2017-10-31 16:36:33 +01:00
parent 2278c0c7ca
commit acb2d6dbba

View File

@@ -257,16 +257,22 @@ function MakePairsV3(callback){
tree = []; tree = [];
done=false; done=false;
for (let i=0;i<names.length;i++){ while(max_pairs>0){
for (let j=0;j<=i;j++){ for (let i=0;i<names.length;i++){
if (matrix[i][j] === 0){ for (let j=0;j<=i;j++){
count_pairs(i,j,5); if (matrix[i][j] === 0){
if (done) break; count_pairs(i,j,5);
if (done) break;
}
} }
if (done) break;
} }
if (done) break; if (done) break;
max_pairs--;
} }
let max_count_index = 0; let max_count_index = 0;
for (let i=0;i<tree.length;i++){ for (let i=0;i<tree.length;i++){