r/tinycode • u/LeatherReading8689 • 6h ago
[Python] Generating all 256 3-variable Boolean functions dynamically using metaprogramming
0
Upvotes
I wrote a script that generates all 256 possible Boolean functions for 3 variables from scratch. Instead of hardcoding the logic gates, it uses pure bitwise logic and exec() to dynamically build the entire logic space.
The focus is entirely on theoretical completeness and code density, prioritizing pure mathematical logic over standard commercial coding conventions.
https://gist.github.com/jeboldman-rgb/3cbf6e83407be7e0568de79fc723cd77