tree = ['']
window_start = 1
window_end = 4
for count2 in range(25):
window = 'abbacbccacbbbababcabccacabcbcb'[int(window_start - 1) :
int(window_end)]
window_start = window_start + 1
window_end = window_end + 1
char_location = 1
node = 1
for count in range(4):
char_in_window = window[int(char_location - 1)]
char_location = char_location + 1
if tree[int(node - 1)].find(char_in_window) + 1 == 0:
tree[int(node - 1)] = str(tree[int(node - 1)]) + str(char_in_window)
if char_location != 5:
if node == len(tree):
tree.append([])
tree[int((node + 1) - 1)].append(len(tree) + 1)
tree.append('')
node = len(tree)
else:
if char_location == 5:
goto = node + 0
else:
goto = node + 1
node = tree[int(node - 1)].find(char_in_window) + 1
node = tree[int(goto - 1)][int(node - 1)]
print(tree)
REFACTOR!
tree = ['']
window_start = 1
window_end = 4
for count2 in range(2):
window = 'aaaaa'[window_start - 1 : window_end]
window_start = window_start + 1
window_end = window_end + 1
char_location = 1
node = 1
for count in range(4):
char_in_window = window[char_location - 1]
char_location = char_location + 1
if tree[node - 1].find(char_in_window) + 1 == 0:
tree[node - 1] = str(tree[node - 1]) + str(char_in_window)
if char_location != 5:
if node == len(tree):
tree.append([])
tree[(node + 1 - 1)].append(len(tree) + 1)
tree.append('')
node = len(tree)
else:
if char_location == 5:
goto = node + 0
else:
goto = node + 1
node = tree[node - 1].find(char_in_window) + 1
node = tree[goto - 1][node - 1]
print(tree)
------------------------------------------
Artificial General Intelligence List: AGI
Permalink:
https://agi.topicbox.com/groups/agi/T11f5dc3052b454b3-Me708b98bce3951615244c5c3
Delivery options: https://agi.topicbox.com/groups/agi/subscription