]> pd.if.org Git - hexagon/blob - t/adjacency.c
move astar to lib
[hexagon] / t / adjacency.c
1 #include "hexagon.h"
2
3 #include "ctap.h"
4
5 int main(void) {
6         struct HL_hex hex, start;
7
8         int dist;
9         int x, y, i;
10
11         plan(294);
12
13         for (x = -3 ; x <= 3; x++) {
14                 for (y = -3 ; y <= 3; y++) {
15                         start = HL_hex_xy(x, y);
16                         for (i = 0; i < 6; i++) {
17                                 hex = HL_adjhex(start, i);
18                                 dist = HL_distance(hex, start);
19                                 is_int((long)dist, 1L,
20                                         "%d, %d direction %d distance one",
21                                         x, y, i);
22                         }
23                 }
24         }
25
26         return 0;
27 }