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 calculate_m(): | |
# get a list of possible squared numbers, this give us the number of | |
# rows and columns to use for the canvas, eg 4 = 2 x 2, 6 = 3 x 3... | |
# Return: [] of squared numbers up to 10000 (hopefully we don't get that high!) | |
m = [] | |
for i in range(1,10000): | |
m.append(i*i) | |
return(m) | |
def grid(n,m): |
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
for i,letter in enumerate(letters): | |
# Only three numbers needed for RGB so use the first three values as a base | |
# eg: [10, 4, 21] | |
n = 255.0 / 26.0 # make sure we don't get a value above 255. (z = 26. 25 *10 = 260 but 26 * 9.8 = 248 | |
if i < 3: | |
# add the first three values to a new list (number) | |
letterPosition = alphabet.index(letter) * n # *n here to force a good large number base | |
number.append(letterPosition) | |
# Use the remaining values to fine tune the first three we have so it will be a better variant | |
elif i >= 3 and i < 6: |
NewerOlder