Skip to content

Instantly share code, notes, and snippets.

@sr105
Created February 6, 2017 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sr105/f3a522b3f76f80a719120f7f3dd89f1a to your computer and use it in GitHub Desktop.
Save sr105/f3a522b3f76f80a719120f7f3dd89f1a to your computer and use it in GitHub Desktop.
count in bits manually
def test(counter=[0], bits=[], stop=24):
if len(bits) == stop:
print(*bits, ' ', counter[0])
counter[0] += 1
return
bits.append(0)
test(counter, bits)
bits[-1] = 1
test(counter, bits)
bits.pop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment