Created
December 17, 2017 22:09
-
-
Save ELC/d2e86a653cbe11ce3e424f0d29cd014c to your computer and use it in GitHub Desktop.
This file contains 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 generate_random(seed): | |
digits = len(str(seed)) | |
while True: | |
candidate_number = str(seed**2) | |
candidate_number_filled = '0' * (2 * digits - len(candidate_number)) + candidate_number | |
seed = int(candidate_number_filled[digits//2:-digits//2]) | |
yield seed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment