home
·
contact
·
privacy
projects
/
plomrogue
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Dead shoggoths corpse to "magic meat" that can now be "used" i.e. consumed for hitpoi...
[plomrogue]
/
src
/
yx_uint16.c
1
/* yx_uint16.c */
2
3
4
5
#include "yx_uint16.h" /* for uint8_t, uint16_t */
6
7
8
9
extern uint8_t yx_uint16_cmp(struct yx_uint16 * a, struct yx_uint16 * b)
10
{
11
if (a->y == b->y && a->x == b->x)
12
{
13
return 1;
14
}
15
else
16
{
17
return 0;
18
}
19
}
20
21
22
23
extern struct yx_uint16 mv_yx_in_dir(char d, struct yx_uint16 yx)
24
{
25
if (d == 'N')
26
{
27
yx.y--;
28
}
29
else if (d == 'E')
30
{
31
yx.x++;
32
}
33
else if (d == 'S')
34
{
35
yx.y++;
36
}
37
else if (d == 'W')
38
{
39
yx.x--;
40
}
41
return yx;
42
}