Godtone
Joined 17 December 2020
m →My Python 3 code: really dumb error in the code that was causing make_val() to misbehave when using wart_tendency = 0 |
→My Python 3 code: made prime_limit function less tedious to type by shorting to prime_lim as its consistent with odd_lim |
||
| Line 447: | Line 447: | ||
# Returns a list of primes up to and (if applicable) including the limit, | # Returns a list of primes up to and (if applicable) including the limit, | ||
# representing the corresponding prime limit. | # representing the corresponding prime limit. | ||
def | def prime_lim(limit): # includes limit (if applicable) | ||
l = [] | l = [] | ||
i = 0 | i = 0 | ||
| Line 596: | Line 596: | ||
def pval(f, et2, p=None): | def pval(f, et2, p=None): | ||
if p==None: | if p==None: | ||
p = | p = prime_lim(prime_idx( len(f)-1 )) | ||
return sum([ f[i]*round(steps(p[i],et2)) for i in range(len(f)) ]) | return sum([ f[i]*round(steps(p[i],et2)) for i in range(len(f)) ]) | ||
def map_iv(val_map, x): # assumes same harmonic subgroup | def map_iv(val_map, x): # assumes same harmonic subgroup | ||
| Line 627: | Line 627: | ||
else: # prime_idx(53) = 251 is the highest prime reachable | else: # prime_idx(53) = 251 is the highest prime reachable | ||
return 53 # with extended warts | return 53 # with extended warts | ||
def alphawarts(alphabet, gens = | def alphawarts(alphabet, gens = prime_lim(256)): | ||
return [gens[idx_alpha(c)] for c in alphabet] | return [gens[idx_alpha(c)] for c in alphabet] | ||
# the wart_tendency determines if a wart's behaviour is: | # the wart_tendency determines if a wart's behaviour is: | ||