-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
51 lines (43 loc) · 1.16 KB
/
test.py
File metadata and controls
51 lines (43 loc) · 1.16 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
48
49
50
51
import multiprocessing
from brains import move
from oldbr import oldmove
import time
ta1=[[ 5, 4, 3, 20, 9, 3, 4, 5],
[ 1, 1, 1, 1, 1, 1, 1, 1],
[ 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0],
[-1, -1, -1, 1, -1, -1, -1, -1],
[-5, -4, -3, -20, -9, -3, -4, -1]]
ta2=[[ 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0],
[ 1, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0],
[-1, 0, 0, 0, 0, 0, 0, 0]]
TA=ta1
VAL=4
AR=(1,TA,VAL)
# if __name__ == "__main__":
# p1 = multiprocessing.Process(target=move, args=AR)
# p2 = multiprocessing.Process(target=oldmove, args=AR)
# p1.start()
# p2.start()
# at1=time.time()
# a=move(1,TA,VAL)
# at2=time.time()
# print(a)
# print('new\n\n\nold')
# bt1=time.time()
# b=oldmove(1,TA,VAL)
# bt2=time.time()
# print(b)
# print(a==b)
# print(f'\n\n{at2-at1}\n{bt2-bt1}')
t1=time.time()
ans=move(*AR)
t2=time.time()
print("TIME NEEDED IS : ",t2-t1)