예제 #1
0
 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());
 }
예제 #2
0
        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());
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }