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 == 'e' && yx.y > 0 && (yx.x < UINT8_MAX || !(yx.y % 2)))
24 yx.x = yx.x + (yx.y % 2);
27 else if (d == 'd' && yx.x < UINT8_MAX)
31 else if (d == 'c' && yx.y < UINT8_MAX && (yx.x < UINT8_MAX || !(yx.y % 2)))
33 yx.x = yx.x + (yx.y % 2);
36 else if (d == 'x' && yx.y < UINT8_MAX && (yx.x > 0 || yx.y % 2))
38 yx.x = yx.x - !(yx.y % 2);
41 else if (d == 's' && yx.x > 0)
45 else if (d == 'w' && yx.y > 0 && (yx.x > 0 || yx.y % 2))
47 yx.x = yx.x - !(yx.y % 2);