]> pd.if.org Git - hexagon/blobdiff - t/adjacency.c
rework library to use structs
[hexagon] / t / adjacency.c
index 411228805f34b6a1b3d92abbfc09f57175c6ac17..2f9d26ed670de9ef16d6ab3783f5763bb0933419 100644 (file)
@@ -3,18 +3,20 @@
 #include "ctap.h"
 
 int main(void) {
-       int hex, start, dist;
+       struct HL_hex hex, start;
+
+       int dist;
        int x, y, i;
 
        plan(294);
 
        for (x = -3 ; x <= 3; x++) {
                for (y = -3 ; y <= 3; y++) {
-                       start = HL_cantor_xy(x, y);
+                       start = HL_hex_xy(x, y);
                        for (i = 0; i < 6; i++) {
                                hex = HL_adjhex(start, i);
                                dist = HL_distance(hex, start);
-                               ok(dist == 1,
+                               is_int((long)dist, 1L,
                                        "%d, %d direction %d distance one",
                                        x, y, i);
                        }