adding clues “out field”

 

Adding missing clues “out field”

 

This process is applied for 1 to 5 clues not forced by the set of GUA2s GUA3s. At each level, either a clue is added “outfield” and we continue with the same process or no clue is assigned outfield (no UA is available) and we end in sub critical mode.

 

If an empty UA is seen (due to the limitation in cells to use) the process is cancelled for the band 3. A clue is missing and the only available cells are in a stack having already 6 clues.

 

If a non empty UA is found, then it must be hit, Any residual cell of the UA can be the “outfield” cell to add.

 

If the UA table is empty, then any “out field” “in field” cell can be added. Adding an “out field cell”, we can continue with the lowest level, keeping the “in field add” as last option.

 

Missing 2 to 5 clues

.

The process is covered by 2 preprocessor sequences, here as example, the case where 5 clues are missing

 

void G17B3HANDLER::Go_Not_Critical_miss5(){

      int wua = wactive0, ncells = 27, rawua = 0;

      FINDWUA

      APPLYWUA(hn.Go_Not_Critical_miss4())

            if (ncells == 27)   Go_Subcritical();

}

 

The first preprocessor sequence FIDWUA looks for the smallest UA, the second sequence APPLYWUA apply the UA selected, and the process end in subcritical mode if no UA is available

 

 

#define FINDWUA {register int Ra = wactive0, Rfilt =  known_b3;\

for (int iua = 0; iua < g17xy.nuasb3_2; iua++){\

register int Ru = g17xy.uasb3_2[iua];\

if (Ru & Rfilt) continue;\

Ru &= Ra;\

register int cc = _popcnt32(Ru);\

if (cc < ncells)             { ncells = cc; wua = Ru; rawua = g17xy.uasb3_2[iua]; }\

if (!cc)return;\

if (cc > 6 && ncells < 5) break;}}

 

 

#define APPLYWUA(G)uint32_t res;\

int x = wua;\

while (bitscanforward(res, x)){\

int bit = 1 << res;x ^= bit;wactive0 ^= bit;\

G17B3HANDLER hn = *this;hn.nmiss--;hn.known_b3 |= bit;\

int stack = C_box[res];\

hn.wg3.countstack.u16[stack]++;\

hn.wg3.countstack.u16[3]++;\

if (hn.wg3.countstack.u16[stack] > 5){\

hn.wactive0 &= ~(07007007 << (3 * stack));}\

G;}

 

FINDWUA catching a small UA

 

Any UA can be used here, but for a better result, a small UA must be selected.

The table of UAs used is the full B) table (UAs fully out field). On the top of the table are GUA4s GUA6s and small UA specific to the band3.

Also, generally speaking, the bigger is the number of clues to add, the bigger is the number of such UAs.

 

To use the table, we have to know the active outfield cells and the formerly assigned cells (if any).

 

The table is scanned top down but the scan is halted when the chances to find a lower UA are too low.

If an empty UA appears here, the band 3 can not produce a 17 clues.

 

A no UA will deliver ncells to the initial value, and wua to all active cells.

 

APPLYWUA processing the cells “outfield” selected

 

The field wua  contains usually the cells of the selected UA, all cells active if a “no UA” has been seen.

A “while” loop select each cell of wua, assign the cell and adjust the stack count. If the stack can accept it, the process for “one less clue to add”  is called.

 

If we have a “no ua” condition, the sub critical process is called (all missing clues added “in field”).

 

Missing one clue

 

Here the process is slightly different.

 

All remaining UAs must be hit (if we have still active UAs) .

If a cell is added “outfield”, we are in critical mode

 

As the chances to find a multiple solution using all “in field cells” are growing, the brute force is called to detect such cases.

 

Selecting cells hitting all UAs

 

This is a task similar to the selection of a small UA done in FINDWUA.

All the table is scanned in and mode ‘&’. If the result is “empty”, the scan can be halted.

 

If a “no UA” condition is seen,

the cells to process must be all active cells.

A check is done to see if an outfield add is compulsory.

If the answer is “no”, the subcritical step is first applied.

And the “add out field”  comes for all active cells after a new check that this can deliver a “not multiple” status

 

Adding a cell outfield

 

Here we have the set of cells to apply. Each cell is assigned (here the stack filter has no effect) and the critical process is called.