1 /* src/server/yx_uint8.c */
4 #include <stdint.h> /* uint8_t, UINT8_MAX */
5 #include "../common/yx_uint8.h" /* yx_uint8 struct */
9 extern uint8_t yx_uint8_cmp(struct yx_uint8 * a, struct yx_uint8 * b)
11 if (a->y == b->y && a->x == b->x)
20 extern struct yx_uint8 mv_yx_in_dir(char d, struct yx_uint8 yx)
22 if (d == '8' && yx.y > 0)
26 else if (d == '9' && yx.y > 0 && yx.x < UINT8_MAX)
31 else if (d == '6' && yx.x < UINT8_MAX)
35 else if (d == '3' && yx.x < UINT8_MAX && yx.y < UINT8_MAX)
40 else if (d == '2' && yx.y < UINT8_MAX)
44 else if (d == '1' && yx.y < UINT8_MAX && yx.x > 0)
49 else if (d == '4' && yx.x > 0)
53 else if (d == '7' && yx.x > 0 && yx.y > 0)