Created
January 3, 2020 23:00
-
-
Save hammertoe/295a556080652caf80ba45efb18efcfb to your computer and use it in GitHub Desktop.
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 fft(inp): | |
inp = tuple(inp) | |
total = "" | |
for i, c in enumerate(inp, 1): | |
pat = [ [item] * i for item in base_pat ] | |
pat = [item for sublist in pat for item in sublist] | |
l1 = len(pat) | |
l2 = len(inp) | |
pat = pat * math.ceil((l2+1)/l1) | |
pat = pat[1:l2+1] | |
out = np.array(inp, dtype=int) * np.array(pat, dtype=int) | |
final = np.sum(out) | |
final = str(final)[-1] | |
total = total + final | |
return total | |
for i in range(100): | |
line = fft(line) | |
print(line) | |
print(line[:8]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment