Skip to content

Instantly share code, notes, and snippets.

@jnnks
Created May 10, 2021 10:16
Show Gist options
  • Select an option

  • Save jnnks/6bc0dee9972e79b7c8ce71418f726837 to your computer and use it in GitHub Desktop.

Select an option

Save jnnks/6bc0dee9972e79b7c8ce71418f726837 to your computer and use it in GitHub Desktop.
# python 2.7
var_count = 1024
formula = "A0"
operators = {
0: "&",
1: "|",
2: "->",
3: "<->"
}
for i in range(1, var_count):
var_name = chr(65 + (i % 26)) + str(i / 26)
operator = operators[i % 4]
formula = "(" + formula + ") " + operator + " " + var_name
print formula
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment