From 0baac4a745fb164fe4daeee9b1f013e5affbde50 Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Wed, 30 Dec 2015 21:13:18 -0800 Subject: [PATCH 1/1] Flags for start and goal --- Makefile | 2 +- sliding_tile.cc | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 40126d9..ba45d94 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ LFLAGS = SRCS = sliding_tile.cc sliding_tile_lib.cc MAIN = sliding_tile -LIBS = +LIBS = -lgflags TESTLIBS = -lgtest_main -lgtest -lgmock OBJS = $(SRCS:.cc=.o) diff --git a/sliding_tile.cc b/sliding_tile.cc index 4b7e917..572a6e3 100644 --- a/sliding_tile.cc +++ b/sliding_tile.cc @@ -1,4 +1,9 @@ #include "sliding_tile_lib.h" +#include "gflags/gflags.h" -int main() { +DEFINE_string(start, "", "The starting tile positions. 0 is the hole."); +DEFINE_string(goal, "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0", "The desired tile positions. 0 is the hole."); + +int main(int argc, char** argv) { + gflags::ParseCommandLineFlags(&argc, &argv, false); } -- 2.44.1