rename stuff

This commit is contained in:
Maya Herrscher committed 2022-12-03 15:08:59 +01:00
1 parent 7c3d439f6e
commit 97ddc36b62
325 files changed
+85

No files matched your search

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+28
View File
@@ -0,0 +1,28 @@
#!/bin/env python3
import sys
import string
from collections import Counter
def isSmall(node): return all(c in string.ascii_lowercase for c in node)
def ext(path, ns, visits=1):
if path[-1] == 'end': return (yield path)
for n in ns[path[-1]]:
if n == 'start': continue
ext = path + (n,)
m = list(map(lambda x: x[1], Counter(n for n in ext if isSmall(n)).most_common(2)))
if m[0] > visits or len(m) > 1 and m[1] > 1: continue
yield ext
if __name__ == '__main__':
edges = [line.strip().split('-') for line in open(sys.argv[1])]
ns = { n: set() for e in edges for n in e }
for a,b in edges: ns[a].add(b); ns[b].add(a)
ps = set([('start',)])
while (n := set(np for p in ps for np in ext(p, ns))) != ps: ps = n
print(len(ps))
ps = set([('start',)])
while (n := set(np for p in ps for np in ext(p, ns, visits=2))) != ps: ps = n
print(len(ps))
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 325 files, more files were not shown because too many files have changed in this diff. Show more