Commits

Shlomi Fish committed 4d633cb

Switched Cutoff to a slot.

  • Participants
  • Parent commits 615c3cd
  • Branches make-code-suitable-for-fc-solve

Comments (0)

Files changed (3)

 
 /* Command line flags. */
 
-extern int Cutoff;
 extern int Quiet;
 
 enum statuscode { FAIL = -1, WIN = 0, NOSOL = 1 };
      * Default should be FALSE.
      * */
     int to_stack;
+    /* Switch between depth- and breadth-first. Default is "1".*/
+    int cutoff;
 };
 
 typedef struct fc_solve_soft_thread_struct fc_solve_soft_thread_t;

patsolve/patmain.c

   "-s implies -aw10 -t4, -f implies -aw8 -t4\n";
 #define USAGE() fc_solve_msg(Usage, Progname)
 
-int Cutoff = 1;         /* switch between depth- and breadth-first */
 int Status;             /* win, lose, or fail */
 int Quiet = FALSE;      /* print entertaining messages, else exit(Status); */
 
 	for (i = 0; i < NXPARAM; i++) {
 		soft_thread->Xparam[i] = x[i];
 	}
-	Cutoff = soft_thread->Xparam[NXPARAM - 1];
+	soft_thread->cutoff = soft_thread->Xparam[NXPARAM - 1];
 	for (i = 0; i < NYPARAM; i++) {
 		soft_thread->Yparam[i] = y[i];
 	}
     soft_thread->Interactive = TRUE;
     soft_thread->Noexit = FALSE;
     soft_thread->to_stack = FALSE;
+    soft_thread->cutoff = 1;
     soft_thread->Mem_remain = (50 * 1000 * 1000);
     soft_thread->Freepos = NULL;
     /* Default variation. */
 				break;
 
 			case 'c':
-				Cutoff = atoi(curr_arg);
+				soft_thread->cutoff = atoi(curr_arg);
 				curr_arg = NULL;
 				break;
 

patsolve/patsolve.c

 		reduces the quality of solutions).  Otherwise, save it for
 		later. */
 
-		if (pos->cluster != parent->cluster || nmoves < Cutoff) {
+		if (pos->cluster != parent->cluster || nmoves < soft_thread->cutoff) {
 			qq = solve(soft_thread, pos);
 			undo_move(soft_thread, mp);
 			if (!qq) {