Commits

Shlomi Fish  committed e62c5c9

Fixed a bug in the command line parsing with "-opt".

"-opt" (and possibly others) were not handle correctly.

git-svn-id: file:///home/shlomif/Backup/svn-dumps/google-code/svnsync-repos/fc-solve/trunk@1162 e7e8a897-7ba4-4ee7-b36f-f4c66519b19a

  • Participants
  • Parent commits 07daf3b

Comments (0)

Files changed (4)

File fc-solve/source/cmd_line.c

 p += 2;
 { switch(*(p++)) { 
 case '\0':
-
-{
-if (*p == '\0')
 {
-
 opt = FCS_OPT_OPTIMIZE_SOLUTION;
 }
-}
 
 break;
 

File fc-solve/source/gen-cmd-line-radix-tree.pl

         {
             return "{ switch(*(p++)) { " 
                 . join("", (map { "\ncase '" . (length($_) ? $_ : q{\\0}) . "':\n"
-                    . $render->($node->{$_}) 
+                    . (length($_)
+                        ? $render->($node->{$_})
+                        : "{\nopt = $node->{$_};\n}\n"
+                    )
                     . "\nbreak;\n"
                 } @k))
                 . "\n}\n}\n";

File fc-solve/source/t/t/verify-solutions-freecell.t

 use strict;
 use warnings;
 
-use Test::More tests => 10;
+use Test::More tests => 11;
 use Carp;
 use Data::Dumper;
 use String::ShellQuote;
 verify_solution_test({deal => 200, variant => "eight_off", theme => [],},
     "Eight Off #200 with default heuristic"
 );
+
+# TEST
+verify_solution_test({deal => 24, theme => ["-opt"],}, 
+    "-opt should work."
+);
+

File fc-solve/source/ver.txt

-2.11.10
+2.11.11