From d8143db289b441562a69dcfa783d7d80c2f544c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Benencia?= Date: Tue, 31 Mar 2015 16:20:39 -0300 Subject: input_move instead of coordinates. Introduce game_is_move_valid() --- lib/input.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'lib/input.c') diff --git a/lib/input.c b/lib/input.c index 63df8c5..8b696e1 100644 --- a/lib/input.c +++ b/lib/input.c @@ -3,6 +3,7 @@ #include "coordinate.h" #include "input.h" +#include "move.h" #define LENGTH 80 @@ -25,14 +26,21 @@ static Coord _input_coord() { return coord_init(line); } -Coord input_orig_coord() { +static Coord _input_orig_coord() { printf("Orig coordinate: "); return _input_coord(); } -Coord input_dest_coord() { +static Coord _input_dest_coord() { printf("Dest coordinate: "); return _input_coord(); } + +Move input_move() { + Coord orig = _input_orig_coord(); + Coord dest = _input_dest_coord(); + + return move_init(orig, dest); +} -- cgit v1.2.3