Last active
February 2, 2024 19:46
-
-
Save ErnWong/7d236f902f6802e63eeab6dc5a791ea9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mod = (x, y) => ((x % y) + y) % y; | |
const fold = (in1, in2, out1, out2) => { | |
const count = [0, 0, 0, 0, 0, 0, 0, 0]; | |
count[mod(in1, 8)] = -1; | |
count[mod(in2, 8)] = -1; | |
count[mod(out1, 8)] = 1; | |
count[mod(out2, 8)] = 1; | |
return count; | |
} | |
const recipes = [...Array(8).keys()] | |
.map(i => i % 2 ? | |
fold(i, i - 3, i + 1, i - 1) : | |
fold(i, i - 1, i + 1, i + 3) | |
); | |
//recipes.push([1, 1, -1, -1, 1, 1, -1, -1]) | |
//recipes.push([-1, -1, 1, 1, -1, -1, 1, 1]) | |
const add = (a, b) => { | |
return [ | |
[a, ...b[0]], a.map((v, i) => v + b[1][i]) | |
]; | |
} | |
function* combo(recipes) { | |
if (!recipes.length) { | |
yield [ | |
[], | |
[0, 0, 0, 0, 0, 0, 0, 0] | |
]; | |
return; | |
} | |
const [head, ...tail] = recipes; | |
for (const rest of combo(tail)) { | |
for (let i = 0; i < 2; i++) { | |
let accumulator = rest; | |
for (let j = 0; j < i; j++) { | |
accumulator = add(head, accumulator); | |
} | |
yield accumulator; | |
} | |
} | |
} | |
const combos = [...combo(recipes)]; | |
const good = combos.filter(x => x[1].filter(y => y !== 0).length === 2); | |
const normalize = x => x.map(y => y / Math.max(...x)); | |
const mapEntries = good.toReversed().map(x => [normalize(x[1]).toString(), x]) | |
const unique = [...(new Map(mapEntries)).values()] | |
console.log(unique.map(x => `Found: ${x[1]}\nvia:${JSON.stringify(x[0])}\n\n`).join('')); | |
const reachability = [...new Set(good | |
.map(x => normalize(x[1])) | |
.map(x => | |
x | |
.map(y => y.toString().padStart(2)) | |
.join(',') | |
)).values()].sort(); | |
console.log(reachability.join('\n')); | |
//unique.forEach(x => console.log(x)) | |
///console.log(good.length) | |
//console.log(good); | |
const pairRecipes = combos | |
.filter(x => x[1].filter(y => y !== 0).length === 4) | |
.sort((a, b) => a[0].length - b[0].length); | |
const names = [...'λξζθεφγω']; | |
const namifyRecipe = x => | |
x.map((y, i) => y < 0 ? names[i] : '').join('') + | |
' → ' + | |
x.map((y, i) => y > 0 ? names[i] : '').join(''); | |
const namifyRecipes = recipes => [ | |
...recipes.map(namifyRecipe) | |
.reduce((map, recipe) => map.set(recipe, (map.get(recipe) || 0) + 1), new Map()) | |
.entries() | |
] | |
.map(([recipe, count]) => count === 1 ? recipe : `${recipe} (×${count})`) | |
.join('\n'); | |
console.log( | |
pairRecipes | |
.map(([recipes, result]) => namifyRecipe(result) + ' via ' + recipes.map(namifyRecipe).join(',')) | |
.sort() | |
.join('\n') | |
); | |
import cytoscape from 'https://unpkg.com/[email protected]/dist/cytoscape.esm.min.js'; | |
const d = document.createElement('div'); | |
d.style.width = '1000px' | |
d.style.height = '800px'; | |
document.body.appendChild(d); | |
const subgroup = [...'wxyzxwzy']; | |
const nodes = names.map((n, i) => ({ | |
data: { | |
id: i, | |
name: n, | |
parent: subgroup[i] | |
}, | |
position: { | |
x: [0, 0, 2, 2, 1, 1, 3, 3][i] * 150, | |
y: [0, 1, 0, 1, 1, 0, 1, 0][i] * 150, | |
}, | |
locked: true, | |
})); | |
const unNamify = (a, b) => [0, 0, 0, 0, 0, 0, 0, 0] | |
.map((x, i) => subgroup[i] === a ? -1 : subgroup[i] === b ? 1 : 0); | |
const getRecipes = (a, b) => | |
namifyRecipes( | |
pairRecipes[ | |
pairRecipes | |
.map(x => normalize(x[1]).join()) | |
.indexOf(unNamify(a, b).join()) | |
][0] | |
) | |
const groupings = [{ | |
data: { | |
id: 'a' | |
} | |
}, | |
{ | |
data: { | |
id: 'b' | |
} | |
}, | |
{ | |
data: { | |
id: 'ab', | |
source: 'a', | |
target: 'b', | |
recipes: 'inversion' | |
} | |
}, | |
{ | |
data: { | |
id: 'ba', | |
source: 'b', | |
target: 'a', | |
recipes: 'inversion' | |
} | |
}, | |
{ | |
data: { | |
id: 'w', | |
parent: 'a' | |
} | |
}, | |
{ | |
data: { | |
id: 'x', | |
parent: 'a' | |
} | |
}, | |
{ | |
data: { | |
id: 'wx', | |
parent: 'a', | |
source: 'w', | |
target: 'x', | |
recipes: getRecipes('w', 'x') | |
} | |
}, | |
{ | |
data: { | |
id: 'xw', | |
parent: 'a', | |
source: 'x', | |
target: 'w', | |
recipes: getRecipes('x', 'w') | |
} | |
}, | |
{ | |
data: { | |
id: 'y', | |
parent: 'b' | |
} | |
}, | |
{ | |
data: { | |
id: 'z', | |
parent: 'b' | |
} | |
}, | |
{ | |
data: { | |
id: 'yz', | |
parent: 'b', | |
source: 'y', | |
target: 'z', | |
recipes: getRecipes('y', 'z') | |
} | |
}, | |
{ | |
data: { | |
id: 'zy', | |
parent: 'b', | |
source: 'z', | |
target: 'y', | |
recipes: getRecipes('z', 'y') | |
} | |
}, | |
] | |
const edges = unique.map(([recipes, result]) => ({ | |
data: { | |
id: result.join(','), | |
source: result.findIndex(x => x < 0), | |
target: result.findIndex(x => x > 0), | |
recipes: namifyRecipes(recipes) | |
} | |
})); | |
const cy = cytoscape({ | |
container: d, | |
elements: [...nodes, ...groupings, ...edges], | |
style: [{ | |
selector: 'node[name]', | |
style: { | |
'label': 'data(name)', | |
} | |
}, | |
{ | |
selector: 'node', | |
style: { | |
'border-style': 'solid', | |
'border-width': '1px', | |
'border-color': 'black', | |
} | |
}, | |
{ | |
selector: 'edge', | |
style: { | |
'width': 3, | |
'line-color': '#ccc', | |
'target-arrow-color': '#ccc', | |
'target-arrow-shape': 'triangle', | |
'curve-style': 'bezier', | |
'control-point-step-size': '80px', | |
'label': 'data(recipes)', | |
'font-size': '8px', | |
'text-wrap': 'wrap', | |
} | |
} | |
], | |
layout: { | |
name: 'preset' | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Found: 2,0,0,0,0,-2,0,0 | |
via:[[1,-1,1,0,0,0,-1,0],[0,0,-1,0,1,-1,1,0],[0,1,0,0,0,-1,-1,1],[1,0,0,0,-1,0,1,-1]] | |
Found: 4,0,0,0,0,-4,0,0 | |
via:[[1,-1,1,0,0,0,-1,0],[1,-1,1,0,0,0,-1,0],[0,0,-1,0,1,-1,1,0],[0,0,-1,0,1,-1,1,0],[0,1,0,0,0,-1,-1,1],[0,1,0,0,0,-1,-1,1],[1,0,0,0,-1,0,1,-1],[1,0,0,0,-1,0,1,-1]] | |
Found: 6,0,0,0,0,-6,0,0 | |
via:[[1,-1,1,0,0,0,-1,0],[1,-1,1,0,0,0,-1,0],[1,-1,1,0,0,0,-1,0],[0,0,-1,0,1,-1,1,0],[0,0,-1,0,1,-1,1,0],[0,0,-1,0,1,-1,1,0],[0,1,0,0,0,-1,-1,1],[0,1,0,0,0,-1,-1,1],[0,1,0,0,0,-1,-1,1],[1,0,0,0,-1,0,1,-1],[1,0,0,0,-1,0,1,-1],[1,0,0,0,-1,0,1,-1]] | |
Found: 0,2,0,0,-2,0,0,0 | |
via:[[-1,1,0,1,0,0,0,-1],[0,0,0,-1,-1,1,0,1],[0,1,0,0,0,-1,-1,1],[1,0,0,0,-1,0,1,-1]] | |
Found: 0,4,0,0,-4,0,0,0 | |
via:[[-1,1,0,1,0,0,0,-1],[-1,1,0,1,0,0,0,-1],[0,0,0,-1,-1,1,0,1],[0,0,0,-1,-1,1,0,1],[0,1,0,0,0,-1,-1,1],[0,1,0,0,0,-1,-1,1],[1,0,0,0,-1,0,1,-1],[1,0,0,0,-1,0,1,-1]] | |
Found: 0,6,0,0,-6,0,0,0 | |
via:[[-1,1,0,1,0,0,0,-1],[-1,1,0,1,0,0,0,-1],[-1,1,0,1,0,0,0,-1],[0,0,0,-1,-1,1,0,1],[0,0,0,-1,-1,1,0,1],[0,0,0,-1,-1,1,0,1],[0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,0,1,0,0,0,-1],[0,-1,-1,1,0,1,0,0],[0,-1,-1,1,0,1,0,0],[0,-1,-1,1,0,1,0,0],[-1,0,1,-1,1,0,0,0],[-1,0,1,-1,1,0,0,0],[-1,0,1,-1,1,0,0,0],[0,0,0,-1,-1,1,0,1],[0,0,0,-1,-1,1,0,1],[0,0,0,-1,-1,1,0,1]] | |
0, 0, 0, 0, 0, 0, 1,-1 | |
0, 0, 0, 0, 0, 0,-1, 1 | |
0, 0, 0, 0, 1,-1, 0, 0 | |
0, 0, 0, 0,-1, 1, 0, 0 | |
0, 0, 0, 1, 0, 0, 0,-1 | |
0, 0, 0, 1, 0, 0,-1, 0 | |
0, 0, 0,-1, 0, 0, 0, 1 | |
0, 0, 0,-1, 0, 0, 1, 0 | |
0, 0, 1, 0, 0, 0, 0,-1 | |
0, 0, 1, 0, 0, 0,-1, 0 | |
0, 0, 1,-1, 0, 0, 0, 0 | |
0, 0,-1, 0, 0, 0, 0, 1 | |
0, 0,-1, 0, 0, 0, 1, 0 | |
0, 0,-1, 1, 0, 0, 0, 0 | |
0, 1, 0, 0, 0,-1, 0, 0 | |
0, 1, 0, 0,-1, 0, 0, 0 | |
0,-1, 0, 0, 0, 1, 0, 0 | |
0,-1, 0, 0, 1, 0, 0, 0 | |
1, 0, 0, 0, 0,-1, 0, 0 | |
1, 0, 0, 0,-1, 0, 0, 0 | |
1,-1, 0, 0, 0, 0, 0, 0 | |
-1, 0, 0, 0, 0, 1, 0, 0 | |
-1, 0, 0, 0, 1, 0, 0, 0 | |
-1, 1, 0, 0, 0, 0, 0, 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mod = (x, y) => ((x % y) + y) % y; | |
const fold = (in1, in2, out1, out2) => { | |
const count = [0, 0, 0, 0, 0, 0, 0, 0]; | |
count[mod(in1, 8)] = -1; | |
count[mod(in2, 8)] = -1; | |
count[mod(out1, 8)] = 1; | |
count[mod(out2, 8)] = 1; | |
return count; | |
} | |
const recipes = [...Array(8).keys()] | |
.map(i => i % 2 ? | |
fold(i, i - 3, i + 1, i - 1) : | |
fold(i, i - 1, i + 1, i + 3) | |
); | |
recipes.push([1, 1, -1, -1, 1, 1, -1, -1]) | |
recipes.push([-1, -1, 1, 1, -1, -1, 1, 1]) | |
const add = (a, b) => { | |
return [ | |
[a, ...b[0]], a.map((v, i) => v + b[1][i]) | |
]; | |
} | |
function* combo(recipes) { | |
if (!recipes.length) { | |
yield [ | |
[], | |
[0, 0, 0, 0, 0, 0, 0, 0] | |
]; | |
return; | |
} | |
const [head, ...tail] = recipes; | |
for (const rest of combo(tail)) { | |
for (let i = 0; i < 3; i++) { | |
let accumulator = rest; | |
for (let j = 0; j < i; j++) { | |
accumulator = add(head, accumulator); | |
} | |
yield accumulator; | |
} | |
} | |
} | |
const combos = [...combo(recipes)]; | |
const good = combos.filter(x => x[1].filter(y => y !== 0).length === 2); | |
const mapEntries = good.toReversed().map(x => [x[1].toString(), x]) | |
const unique = [...(new Map(mapEntries)).values()] | |
console.log(unique.map(x => `Found: ${x[1]}\nvia:${JSON.stringify(x[0])}\n\n`).join('')); | |
const normalize = x => x.map(y => y / Math.max(...x)); | |
const reachability = [...new Set(good | |
.map(x => normalize(x[1])) | |
.map(x => | |
x | |
.map(y => y.toString().padStart(2)) | |
.join(',') | |
)).values()].sort(); | |
console.log(reachability.join('\n')); | |
//unique.forEach(x => console.log(x)) | |
///console.log(good.length) | |
//console.log(good); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Found: 2,0,0,0,0,-2,0,0 | |
via:[[1,-1,1,0,0,0,-1,0],[0,0,-1,0,1,-1,1,0],[0,1,0,0,0,-1,-1,1],[1,0,0,0,-1,0,1,-1]] | |
Found: 4,0,0,0,0,-4,0,0 | |
via:[[1,-1,1,0,0,0,-1,0],[1,-1,1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