/// <summary> /// 减少提示数 /// </summary> /// <returns></returns> public SudokuMarket LessNoticeNumber() { SudokuMarket result = new SudokuMarket(this.initValues); do { var allcount = result.SubMarkets.Count; Random rm = new Random(); var temp = RandomHelper.GetRandom(0, true, allcount, false, 1, rm, false); result = result.SubMarkets[temp[0]]; } while (result.SubMarkets.Count != 0); return(result); }
public SudokuMarket GetMarket(List <int> includes, int exceptValue) { SudokuMarket result = null; var list = this.SubMarkets.Where(c => !c.initLists.Contains(exceptValue) && includes.Except(c.initLists).Count() == 0) .ToList(); Console.WriteLine("要处理列表个数为: " + list.Count + " 提示书个数为" + list[0].initLists.Count); if (list.Exists(c => c.SubMarkets.Count == 0)) { result = list.First(c => c.SubMarkets.Count == 0); return(result); } else { result = list[0].GetMarket(includes, exceptValue); } return(result); }