private void SuDoQueEx_SolResult(UALS ISPB, UALS ISPR) { Result = "SueDeCoq"; if (SolInfoB) { ISPB.UCellLst.ForEach(P => P.SetNoBBgColor(P.FreeB, AttCr, SolBkCr)); ISPR.UCellLst.ForEach(P => P.SetNoBBgColor(P.FreeB, AttCr, SolBkCr)); string ptmp = ""; ISPB.UCellLst.ForEach(p => { ptmp += $" {p.rc.ToRCString()}"; }); string po = "\r Cells"; if (ISPB.Level == 1) { po += "(block) "; } else { po += $"-{ISPB.Level}(block)"; } po += $": {ISPB.ToStringRCN()}"; po += "\r Cells" + ((ISPR.Level == 1)? "": "-2"); po += ((ISPR.tfx < 9)? "(row)":"(col)"); po += ((ISPR.Level == 1)? " ": " "); po += ": " + ISPR.ToStringRCN(); ResultLong = "SueDeCoq" + po; } }
private void _SolResult_ALSChain(Stack <UALSPair> SolStack) { string st = "ALS Chain"; if (SolInfoB) { int nc = 0, noB; Color cr; var SSrev = SolStack.ToList(); SSrev.Reverse(); foreach (var LKA in SSrev) { noB = (1 << LKA.nRCC); UALS UA = LKA.ALSpre; cr = _ColorsLst[nc++]; UA.UCellLst.ForEach(P => P.SetNoBBgColor(noB, AttCr, cr)); st += $"\r ALS {nc}: {UA.ToStringRCN()} -> #{(LKA.nRCC+1)}"; } var LKB = SSrev.Last(); noB = (1 << LKB.nRCC); cr = _ColorsLst[nc]; LKB.ALSnxt.UCellLst.ForEach(P => P.SetNoBBgColor(noB, AttCr, cr)); st += $"\r ALS {(nc+1)}: {LKB.ALSnxt.ToStringRCN()}"; ResultLong = st; } Result = "ALS Chain"; }
private void ALSXYWing_SolResult(UALS UA, UALS UB, UALS UC, int RccAC, int RccBC) { string st = "ALS XY-Wing "; if (SolInfoB) { UA.UCellLst.ForEach(P => P.SetNoBBgColor(RccAC, AttCr, SolBkCr)); UB.UCellLst.ForEach(P => P.SetNoBBgColor(RccBC, AttCr, SolBkCr2)); UC.UCellLst.ForEach(P => P.SetNoBBgColor(RccAC | RccBC, AttCr, SolBkCr3)); st += "\r ALS A: " + UA.ToStringRCN(); st += "\r ALS B: " + UB.ToStringRCN(); st += "\r ALS C: " + UC.ToStringRCN(); st += "\r RCC AC: #" + RccAC.ToBitStringN(9); st += "\r RCC BC: #" + RccBC.ToBitStringN(9); ResultLong = st; } Result = "ALS XY-Wing"; }
private void ALSXZ_SolResult(int RCC, UALS UA, UALS UB) { string st = "ALS-XZ " + ((RCC.BitCount() == 1)? "(Singly Linked)": "(Doubly Linked)"); Result = st; if (SolInfoB) { foreach (var P in UA.UCellLst) { P.SetNoBBgColor(P.FreeB, AttCr2, SolBkCr); } foreach (var P in UB.UCellLst) { P.SetNoBBgColor(P.FreeB, AttCr2, SolBkCr2); } st += "\r ALS1: " + UA.ToStringRCN(); st += "\r ALS2: " + UB.ToStringRCN(); st += "\r RCC: #" + RCC.ToBitStringN(9); ResultLong = st; } }