Created
February 6, 2017 19:03
-
-
Save sr105/f3a522b3f76f80a719120f7f3dd89f1a to your computer and use it in GitHub Desktop.
count in bits manually
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
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