#include <stdio.h>
-#include "hexmap.h"
+#include "hexagon.h"
#include "tap.h"
int neighbor55(int hex, int dir) {
int neighbor;
- neighbor = HL_adjacent_hex(hex, dir);
- if (neighbor == HL_cantor_xy(5,5)) {
- return -1;
- }
+ do {
+ neighbor = HL_adjacent_hex(hex, dir++);
+ } while (neighbor == HL_cantor_xy(5,5));
return neighbor;
}