Skip to content

Commit f5bc967

Browse files
Calculate NDirectValues
1 parent 2a00add commit f5bc967

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

calcNdirectValues.mjs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env node
2+
3+
// import zlib from "node:zlib";
4+
5+
// console.log(zlib.constants);
6+
7+
const go = (arr, current, step, max) => {
8+
arr.push(current);
9+
if (current === max) { return arr; }
10+
return go(arr, current + step, step, max);
11+
}
12+
13+
for (var i = 0; i <= 3; i++) {
14+
const foo = go([], 0, 1 << i, 15 << i);
15+
console.log(`When 'Npostfix' is ${i}, then possible values are: ${foo.join(", ")}`);
16+
17+
// Generate type class instances
18+
// for (var j = 0; j < foo.length; j++) {
19+
// console.log(`${j == 0 ? "" : "else "}instance IsValidNDirectFor ${i} ${foo[j]}`);
20+
// if (j + 1 === foo.length) {
21+
// console.log(`else instance Fail "number must be one of ${foo.join(", ")}" => IsValidNDirectFor ${i} i`);
22+
// console.log("");
23+
// };
24+
// }
25+
}

0 commit comments

Comments
 (0)