-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate_matrix.py
38 lines (28 loc) · 1.58 KB
/
generate_matrix.py
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
import random
f = file("matrix.txt", 'w' )
for x in range(10):
for y in range(10):
mid_point = random.randrange(0, 101)
lower_point = random.randrange(0, mid_point)
upper_point = random.randrange(mid_point, 101)
f.write("o0 " + str(x) + " " + str(y) + " " + str(lower_point) + " " + str(mid_point-lower_point) + " " + str(upper_point-mid_point) + " " + str(100-upper_point) + " 0\n")
for x in range(10):
for y in range(10):
mid_point = random.randrange(1, 101)
print mid_point
lower_point = random.randrange(0, mid_point)
upper_point = random.randrange(mid_point, 101)
f.write("o1 " + str(x) + " " + str(y) + " " + str(lower_point) + " " + str(mid_point-lower_point) + " " + str(upper_point-mid_point) + " " + str(100-upper_point) + " 0\n")
for x in range(10):
for y in range(10):
mid_point = random.randrange(1, 101)
lower_point = random.randrange(0, mid_point)
upper_point = random.randrange(mid_point, 101)
f.write("a0 " + str(x) + " " + str(y) + " " + str(lower_point) + " " + str(mid_point-lower_point) + " " + str(upper_point-mid_point) + " " + str(100-upper_point) + " 0\n")
for x in range(10):
for y in range(10):
mid_point = random.randrange(1, 101)
lower_point = random.randrange(0, mid_point)
upper_point = random.randrange(mid_point, 101)
f.write("a1 " + str(x) + " " + str(y) + " " + str(lower_point) + " " + str(mid_point-lower_point) + " " + str(upper_point-mid_point) + " " + str(100-upper_point) + " 0\n")
f.close()