diff options
author | Raúl Benencia <rul@kalgan.cc> | 2015-03-28 17:11:05 -0300 |
---|---|---|
committer | Raúl Benencia <rul@kalgan.cc> | 2015-03-28 17:11:05 -0300 |
commit | e42268acc5fd600e18073d745e99e7491ccdafc4 (patch) | |
tree | 238b2e03375bbf699307fc4e5cf0c13596395e32 | |
parent | 922eef24c4ee4116c51eaf175b55f71e94fce6c4 (diff) |
implement coordinate setters and getters
-rw-r--r-- | include/coordinate.h | 10 | ||||
-rw-r--r-- | lib/coordinate.c | 14 |
2 files changed, 24 insertions, 0 deletions
diff --git a/include/coordinate.h b/include/coordinate.h index bc63122..4c98f3f 100644 --- a/include/coordinate.h +++ b/include/coordinate.h @@ -36,6 +36,16 @@ Coord coord_set_col(Coord c, char col); Coord coord_set_row(Coord c, char row); /* + * Get Coord row + */ +char coord_get_row(Coord c); + +/* + * Get Coord column + */ +char coord_get_col(Coord c); + +/* * Returns the next coordinate. Useful for traversing the board forwards. */ Coord coord_next(Coord); diff --git a/lib/coordinate.c b/lib/coordinate.c index 7518a78..f92c22a 100644 --- a/lib/coordinate.c +++ b/lib/coordinate.c @@ -72,6 +72,20 @@ Coord coord_set_col(Coord c, char col) { } /* + * Get Coord row + */ +char coord_get_row(Coord c) { + return c.row; +} + +/* + * Get Coord column + */ +char coord_get_col(Coord c) { + return c.col; +} + +/* * Returns the next coordinate. Useful for traversing the board forwards. */ Coord coord_next(Coord c) { |