evo-alphas.html
001|
002| from sys import stdout, argv, exc_info
003| from traceback import extract_tb
004| from os import path, environ
005| from time import process_time_ns
006| from random import randint
007| from files import datafile, textfile, linefile, csvfile
008| from goodies import divisions, intervals, marker, combine
009| from webpage import KWARG
010| from evolution import Alphabet,RandString, GetAlphabet,GetFullAlphabet
011|
012| BasePath = r'C:\CJS\prj\Python\app\arc\evo'
013|
014| def dump_random_strings (count, length):
015| for _ in range(count):
016| print(RandString(length))
017| print()
018|
019| Alphabets = [
020| GetAlphabet(0,0,0,0,0),
021| GetAlphabet(1,0,0,0,0),
022| GetAlphabet(1,0,1,0,0),
023| GetAlphabet(1,0,0,1,0),
024| GetAlphabet(1,0,1,1,0),
025| GetAlphabet(1,0,0,1,1),
026| GetAlphabet(1,0,1,1,1),
027| GetAlphabet(0,1,0,0,0),
028| GetAlphabet(0,1,1,0,0),
029| GetAlphabet(0,1,0,1,0),
030| GetAlphabet(0,1,1,1,0),
031| GetAlphabet(0,1,0,1,1),
032| GetAlphabet(0,1,1,1,1),
033| GetAlphabet(1,1,0,0,0),
034| GetAlphabet(1,1,1,0,0),
035| GetAlphabet(1,1,0,1,0),
036| GetAlphabet(1,1,1,1,0),
037| GetAlphabet(1,1,0,1,1),
038| GetAlphabet(1,1,1,1,1),
039| GetFullAlphabet()
040| ]
041| def list_Alphabets ():
042| for ix,a in enumerate(Alphabets):
043| print('[%2d] (%d) <%s>' % (ix,len(a),a))
044| print()
045|
046| def wrap_around_demo ():
047| adjust = lambda n: (n if n < (len(Alphabet)/2) else abs(n-len(Alphabet)))
048|
049| h = list(range(1,len(Alphabet)))
050| g = [adjust(n) for n in h]
051| print(h)
052| print(g)
053|
054|
055|
056|
057| '''eof'''
058|