Skip to content

Instantly share code, notes, and snippets.

View SagePtr's full-sized avatar
🍴
Eating everything

Sage Pointer SagePtr

🍴
Eating everything
View GitHub Profile
@SagePtr
SagePtr / gist:67d99bef609ad44925ccb1fbeacf81aa
Created July 7, 2025 17:59
Turing Complete finding optimal 3-bit decoder
const { Combination } = require("js-combinatorics");
const and = (a,b) => a & b;
const nor = (a,b) => !(a | b);
const or = (a,b) => (a | b);
const nand = (a,b) => !(a & b);
const b2i = (a) => a ? 1 : 0;
const ops = [
{'name': 'and', 'fn': and},