-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap.eth
More file actions
50 lines (47 loc) · 1.06 KB
/
Copy pathmap.eth
File metadata and controls
50 lines (47 loc) · 1.06 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
open 'list' in
let more_walls =
let nx = 10 and ny = 10 in
--let nx = 1 and ny = 1
let xoffset = 60 and yoffset = 10 in
let width = 2 and height = 2 in
let xstep = width + 8 and ystep = height + 8 in
let fill_color = 0xFFFFFFFF and edge_color = 0xFFFFFFFF in
range (0 .. nx-1) | flat_map (fn i ->
range (0 .. ny-1) | map (fn j ->
let x0 = xoffset + xstep*i in
let y0 = yoffset + ystep*j in
{
tag = 'filled_wall',
fill_color,
edge_color,
vertices = [
(x0, y0),
(x0+width, y0),
(x0+width, y0+height),
(x0, y0+height),
]
}
)
) | list
in
let old_walls =
[
{
tag = 'filled_wall',
fill_color = 0xFFFFFFFF,
edge_color = 0xFFFFFFFF,
vertices = [(50,50),(50,30),(30,30)]
},
{
tag = 'basic_wall',
color = 0xFFFFFFFF,
ends_spec = "solid_ends",
vertices = [(0,0),(0,200),(200,200),(200,0),(0,0)]
}
]
in
{
size = (200, 200),
has_walls = true,
obstacles = flatten [old_walls, more_walls] | list
}