-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdriver.py
More file actions
27 lines (22 loc) · 820 Bytes
/
driver.py
File metadata and controls
27 lines (22 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import numpy as np
import os
import sys
from draw_rothe import draw_diagram, compile_latex
from reconstruct_permutation import reconstruct_permutation, reconstruct_permutation_complete
from make_transition import get_new_lehmer_code
def draw(lehmer, latex):
w = reconstruct_permutation_complete(lehmer)
latex = latex + draw_diagram(w) + '\n\n\\newline\n\\vspace{1.0cm}\n\n'
compile_latex(latex)
return latex
if __name__ == '__main__':
latex = ''
lehmer_code = [int(char) for char in sys.argv[1:]]
latex = draw(lehmer_code, latex)
while True:
print('Please choose a pivot')
pivot = int(input()) - 1
lehmer_code = get_new_lehmer_code(lehmer_code, pivot)
print(lehmer_code)
latex = draw(lehmer_code, latex)
print('Permutation is vexilliary')