rename stuff
This commit is contained in:
1 parent
7c3d439f6e
commit
97ddc36b62
325 files changed
+85
No files matched your search
Executable
+46
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from blist import blist
|
||||
|
||||
def destination(c, out):
|
||||
while True:
|
||||
if c-1>0 and c-1 not in out:
|
||||
return c-1, order.index(c-1)
|
||||
else:
|
||||
if c>1:
|
||||
c = c-1
|
||||
else:
|
||||
c = highest+1
|
||||
|
||||
|
||||
def move(order):
|
||||
rem = order
|
||||
a = rem.pop(1)
|
||||
b = rem.pop(1)
|
||||
c = rem.pop(1)
|
||||
|
||||
_, dest = destination(order[0], [a,b,c])
|
||||
|
||||
rem.insert(dest+1, a)
|
||||
rem.insert(dest+2, b)
|
||||
rem.insert(dest+3, c)
|
||||
|
||||
if __name__ == "__main__":
|
||||
#test_order = [3,8,9,1,2,5,4,6,7]
|
||||
order = blist([1,9,8,7,5,3,4,6,2])
|
||||
for x in range(10,1000001):
|
||||
order.append(x)
|
||||
current_index = 0
|
||||
lowest = min(order)
|
||||
highest = 1000000
|
||||
#highest = max(order)
|
||||
for i in range(10000000):
|
||||
print(i)
|
||||
move(order)
|
||||
current_index += 1
|
||||
last = order.pop(0)
|
||||
order.append(last)
|
||||
|
||||
order = order[order.index(1):] + order[:order.index(1)]
|
||||
print(order)
|
||||
print(order[1]*order[2])
|
||||
Reference in new issue
Block a user