public void CrossBoardPreprocessTest() { ICrossBoard cb = new CrossBoard(); cb.SetBoardSize(5, 5); for (int i = 0; i < 5; i++) { var sw = new StartWord(); sw.StartX = i; sw.StartY = 0; cb.AddStartWord(sw); if (i > 0) { sw.StartX = 0; sw.StartY = i; cb.AddStartWord(sw); } else { sw.StartX = 2; sw.StartY = 2; cb.AddStartWord(sw); } } cb.Preprocess(new Dictionary(cb.MaxWordLength)); Assert.Equal(8, cb.GetPatternCount()); }
public void CrossBoardPreprocessTest() { ICrossBoard cb = new CrossBoard(5, 5); for (int i = 0; i < 5; i++) { var sw = new StartWord(); sw.StartX = i; sw.StartY = 0; cb.AddStartWord(sw); if (i > 0) { sw.StartX = 0; sw.StartY = i; cb.AddStartWord(sw); } else { sw.StartX = 2; sw.StartY = 2; cb.AddStartWord(sw); } } cb.Preprocess(new Dictionary(cb.MaxWordLength)); Assert.Equal(8, cb.GetPatternCount()); }
static void oldTest() { //prepare cross board ICrossBoard cb = new CrossBoard(); CreateCross(cb); var dict = new Dictionary("../../../dict/cz", cb.MaxWordLength); cb.Preprocess(dict); CrossPattern cp = cb.GetCrossPattern(32); CrossTransformation trans = cp.TryFill(null, "ADELAVOJTAHELA".AsSpan(), dict); //length 14 trans.Transform(cp); }
static void oldTest() { //prepare cross board ICrossBoard cb = new CrossBoard(); CreateCross(cb); var dict = new Dictionary("../../../dict/cz", cb.MaxWordLength); cb.Preprocess(dict); CrossPattern cp = cb.GetCrossPattern(32); CrossTransformation trans = cp.TryFill("ADELAVOJTAHELA", dict); //length 14 trans.Transform(cp); }