Commits

Shlomi Fish committed f3fcd02

A working state ordering that is used in scans.c.

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

  • Participants
  • Parent commits 0ca8b36

Comments (0)

Files changed (3)

File fc-solve/arch_doc/summary/Techniques.txt

 1. fcs_isa.c/fcs_isa.h - Short for Indirect State Allocation, this module
 allocated vectors of states, each one is of constant size.
 
-2. alloc.c/alloc.h - allocates block of arbitrary size in a compact manner.
+2. alloc.c/alloc.h - allocates blocks of arbitrary size in a compact manner.
 
 Both of these modules support releasing the last allocated block and the last 
 one alone.

File fc-solve/source/preset.c

     int is_group, is_start_group;
     test_ret_t test_read;
     int num_chars_read;
-    
+
     if (tests_order->tests)
     {
         free(tests_order->tests);
                                         
                     for(i=0;i<(int)(sizeof(freecell_solver_states_orders_names)/sizeof(freecell_solver_states_orders_names[0]));i++)
                     {
-                        if (!strcmp(s,freecell_solver_states_orders_names[i].name))
+                        int len_name;
+                        
+                        len_name = strlen(freecell_solver_states_orders_names[i].name);
+                        if (!strncmp(s,freecell_solver_states_orders_names[i].name, len_name))
                         {
 
                             found = 1;
                             if (order->init_instance(
                                 order,
                                 order_instance,
-                                s,
+                                s+len_name,
                                 &end_of_spec
                                 ))
                             {
                                 *error_string = strdup("Failed in initializing a states order");
                                 return 6;
                             }
-    
 
                             /*
                              * Advance the string pointer

File fc-solve/source/scans.c

 
 
             {
-                int j;
-                int swap_save;
                 int * rand_array, * ra_ptr;
                 num_states = derived_states_list->num_states;
 
                  * */
                 if (to_randomize && (tests_order_tests[ test_index-1 ].test & FCS_TEST_ORDER_FLAG_RANDOM))
                 {
+                    tests_order_tests[test_index - 1].states_order_instance->order->order_states(
+                        tests_order_tests[test_index - 1].states_order_instance,
+                        ptr_state_with_locations,
+                        derived_states_list,
+                        rand_array
+                        );
+                }
+#if 0
+                if (to_randomize && (tests_order_tests[ test_index-1 ].test & FCS_TEST_ORDER_FLAG_RANDOM))
+                {
                     a = num_states-1;
                     while (a > 0)
                     {
                         a--;
                     }
                 }
+#endif
             }
 
             /* We just performed a test, so the index of the first state that