Commits

Shlomi Fish committed ae63e91

Now tracing the solution for every position in the outputted queue.

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

  • Participants
  • Parent commits d337c6b

Comments (0)

Files changed (1)

fc-solve/source/dbm_solver.c

                 )
             {
                 int i;
+                int trace_num;
+                fcs_encoded_state_buffer_t * trace;
+
                 for (i=0; i < item->key.s[0] ; i++)
                 {
                     printf("%.2X", (int)item->key.s[1 + i]);
                 }
+
                 printf ("%s", ";");
+
+                calc_trace(&instance, &(item->key), &trace, &trace_num);
+
+                /*
+                 * We stop at 1 because the deepest state does not contain
+                 * a move (as it is the ultimate state).
+                 * */
+#define PENULTIMATE_DEPTH 1
+                for (i = trace_num-1 ; i >= PENULTIMATE_DEPTH ; i--)
+                {
+                    printf("%.2X,", trace[i].s[1+trace[i].s[0]]);
+                }
+                free(trace);
                 printf ("\n");
+
+#undef PENULTIMATE_DEPTH
             }
         }
     }