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
| from copy import deepcopy as copy | |
| LOWERLIMIT = 1 | |
| UPPERLIMIT = 10 ** 12 | |
| NUMDIGITS = 1 | |
| def recur(i): | |
| queue = [[int(j) for j in str(i)]] | |
| z = 0 | |
| while z < len(queue): | |
| for j in xrange(len(queue[z]) - 1): |
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
| from itertools import permutations | |
| seen = dict() | |
| seenline = set() | |
| i = 0 | |
| while True: | |
| current = sorted(set([int("".join(j)) for j in list(permutations(str(i)))])) | |
| if current[-1] not in seen: |
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
| from random import choice | |
| from copy import deepcopy | |
| import string | |
| def do_save(current_cards, save_file="mydeck.txt"): | |
| filehandle = file(save_file, "w") | |
| for card in current_cards: | |
| filehandle.writelines(card) | |
| filehandle.close() | |
| print "Current card list saved." |