-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction1.py
More file actions
47 lines (47 loc) · 1.42 KB
/
Copy pathfunction1.py
File metadata and controls
47 lines (47 loc) · 1.42 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
def reverse(a):
for i in range(len(a)):
if (300+i)<len(a):
for j in range(i,300+i,1):
x = 0
y = 0
if a[i,0]>a[j,0]:
x = a[i,0]
a[i,0] = a[j,0]
a[j,0] = x
y = a[i, 1]
a[i,1] = a[j,1]
a[j,1] = y
else:
for j in range(i,len(a),1):
x = 0
y = 0
if a[i, 0] > a[j, 0]:
x = a[i, 0]
a[i, 0] = a[j, 0]
a[j, 0] = x
y = a[i, 1]
a[i, 1] = a[j, 1]
a[j, 1] = y
if (i-300)>0:
for j in range(i-300,i,1):
x = 0
y = 0
if a[i,0] < a[j,0]:
x = a[i,0]
a[i,0] = a[j,0]
a[j,0] = x
y = a[i, 1]
a[i,1] = a[j,1]
a[j,1] = y
else:
for j in range(0,i,1):
x = 0
y = 0
if a[i, 0] < a[j, 0]:
x = a[i, 0]
a[i, 0] = a[j, 0]
a[j, 0] = x
y = a[i, 1]
a[i, 1] = a[j, 1]
a[j, 1] = y
return 0