Anonymous user
Nonoblock: Difference between revisions
m
Use ternary
m (Handle the case where there is a full line.) |
m (Use ternary) |
||
Line 933:
};
const
const maxVal = numGaps - grpSize * minVal + minVal;
const sumsToTrg = sumsTo(numGaps);
const hasInnerZero = hasInner(0);
const noInnerZero = compose(inv, hasInnerZero);
return maxVal <= 0
? (grpSize === 2 ? [[0]] : [])
.filter(noInnerZero)▼
: (looper(mkArr(grpSize, minVal), maxVal)[1])
.filter(sumsToTrg);▼
▲ .filter(noInnerZero)
▲ .filter(sumsToTrg);
}
Line 947 ⟶ 949:
const grpSize = blocks.length + 1;
const numGaps = cells - sumArr(blocks);
const combine = zipArr([...blocks]);
const choices = toBin(choose(0, 1));
const output = compose(console.log, arrJoin(''));
};
|