From 4baca8241a4b4663260a492cfab7bdb07ce9d447 Mon Sep 17 00:00:00 2001 From: Joshua Moerman Date: Tue, 18 Feb 2014 16:12:51 +0100 Subject: [PATCH] Changes program options and output a bit --- src/PuzzleWuzzleGenerator.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/PuzzleWuzzleGenerator.cpp b/src/PuzzleWuzzleGenerator.cpp index 0e1596d..cb41113 100644 --- a/src/PuzzleWuzzleGenerator.cpp +++ b/src/PuzzleWuzzleGenerator.cpp @@ -20,11 +20,11 @@ int main(int argc, char** argv){ // Describe program options po::options_description opts; opts.add_options() - ("w", po::value(&w), "width of puzzles") - ("h", po::value(&h), "height of puzzles") - ("c", po::value(&c), "number of colors") + ("width,w", po::value(&w), "width of puzzles") + ("height,h", po::value(&h), "height of puzzles") + ("colors,c", po::value(&c), "number of colors") ("explosion_size", po::value(&explosion_size), "minimum explosion size") - ("n", po::value(&n), "number of grids to test") + ("sample_size,n", po::value(&n), "number of grids to test") ("verbose", po::bool_switch(), "prints a lot") ("help", po::bool_switch(), "show this help"); @@ -41,10 +41,6 @@ int main(int argc, char** argv){ bool verbose = vm["verbose"].as(); -#define OUT(x) std::cout << #x << " = " << x << "\n" - OUT(w); OUT(h); OUT(c); OUT(explosion_size); -#undef OUT - std::random_device rd; std::mt19937 gen(rd()); @@ -52,11 +48,11 @@ int main(int argc, char** argv){ int solvable = 0; int unsolvable = 0; - while(--n){ + while(n--){ auto field = random_dynamic_grid(w, h, c, gen); if(verbose){ - std::cout << "\n= puzzle " << n << " =\n"; + std::cout << "= Puzzle " << n << " =\n"; field.print(std::cout); } @@ -65,9 +61,6 @@ int main(int argc, char** argv){ ++solvable; if(verbose){ std::cout << solution.solution_traces.size() << " solutions\n"; - for(auto&& t : solution.solution_traces[0]){ - std::cout << "(" << t.first << ", " << t.second << ")\n"; - } } } else { ++unsolvable;