summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/move.h3
-rw-r--r--lib/move.c10
2 files changed, 12 insertions, 1 deletions
diff --git a/include/move.h b/include/move.h
index 9f61775..3844fe2 100644
--- a/include/move.h
+++ b/include/move.h
@@ -8,6 +8,9 @@
*/
Move move_init(Coord, Coord);
+Coord move_get_orig(Move);
+Coord move_get_dest(Move);
+
/*
* Returns 1 if Move is a valid chess movement.
*/
diff --git a/lib/move.c b/lib/move.c
index 3eefcdd..74a8eae 100644
--- a/lib/move.c
+++ b/lib/move.c
@@ -11,7 +11,15 @@ Move move_init(Coord orig, Coord dest) {
m.dest = dest;
return m;
-}
+}
+
+Coord move_get_orig(Move m) {
+ return m.orig;
+}
+
+Coord move_get_dest(Move m) {
+ return m.dest;
+}
/*
* Returns 1 if Move is a valid chess movement.
nihil fit ex nihilo