]> pd.if.org Git - hexagon/blob - t/cantor.c
move astar to lib
[hexagon] / t / cantor.c
1 #include <stdio.h>
2
3 #include "hexagon.h"
4
5 #include "ctap.h"
6
7 int main(void) {
8         int hex;
9         struct HL_hex in;
10         struct HL_hex out;
11         int x, y;
12
13         plan(81*2);
14
15         for (x=-4;x<=4;x++) {
16                 for (y=-4;y<=4;y++) {
17                         in.x = x;
18                         in.y = y;
19                         hex = HL_cantor(in);
20                         out = HL_uncantor(hex);
21                         is_int(x, out.x, "x check %d %d", x, y);
22                         is_int(y, out.y, "y check %d %d", x, y);
23                 }
24         }
25
26         return 0;
27 }