-
Notifications
You must be signed in to change notification settings - Fork 1
/
coordtest.py
37 lines (32 loc) · 1002 Bytes
/
coordtest.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
37
import numpy as np
arr = np.zeros((18, 18), dtype=int)
coords = [(0, 0), (1, 0), (2, 0), (3, 0), (4, 0), (5, 0), (0, 1)]
minX, minZ = 5, 5
maxX, maxZ = 15, 8
def get_coords_minecraft(x, z, coordBaseMode):
if coordBaseMode == 0:
return (minX + x, minZ + z)
if coordBaseMode == 1:
return (maxX - z, minZ + x)
if coordBaseMode == 2:
return (minX + x, maxZ - z)
if coordBaseMode == 3:
return (minX + z, minZ + x)
return None
def get_coords_sane(x, z, coordBaseMode):
if coordBaseMode == 0:
return (minX + x, minZ + z)
if coordBaseMode == 1:
return (maxX - z, minZ + x)
if coordBaseMode == 2:
return (maxX - x, maxZ - z)
if coordBaseMode == 3:
return (minX + z, maxZ - x)
#return (5, 5)
return None
for m in [0, 1, 2, 3]:
for (x, z) in coords:
xC, zC = get_coords_minecraft(x, z, m)
#xC, zC = get_coords_sane(x, z, m)
arr[xC, zC] = (m + 1)
print arr