home · contact · privacy
Moved lots of stuff into new library actors.
[plomrogue] / src / yx_uint16.c
1 #include "stdint.h"
2 #include "yx_uint16.h"
3
4 extern char yx_uint16_cmp (struct yx_uint16 a, struct yx_uint16 b) {
5 // Compare two coordinates of type yx_uint16.
6   if (a.y == b.y && a.x == b.x) return 1;
7   else                          return 0; }
8
9 extern struct yx_uint16 mv_yx_in_dir (char d, struct yx_uint16 yx) {
10 // Return yx coordinates one step to the direction d of yx.
11   if      (d == NORTH) yx.y--;
12   else if (d == EAST)  yx.x++;
13   else if (d == SOUTH) yx.y++;
14   else if (d == WEST)  yx.x--;
15   return yx; }
16