Ejemplo n.º 1
0
        public void test_allowed_word()
        {
            var board = new BoardLayer(Glyphs);

            var allowed = board.IsAllowed("dział");

            Assert.True(allowed);
        }
Ejemplo n.º 2
0
        public void test_disallowed_word()
        {
            var board = new BoardLayer(Glyphs);

            var disallowed = board.IsAllowed("ozdobiły");

            Assert.False(disallowed);
        }
Ejemplo n.º 3
0
        private static void Play(Dictionary dict, string line)
        {
            var board = new BoardLayer(line.Select(g => g == ' ' ? (char?)null : g));

            var words = dict
                        .MatchWords(board)
                        .OrderBy(w => w.Length)
                        .ToList();

            var allowed = words
                          .Where(w => board.IsAllowed(w))
                          .ToList();

            PrintWords(allowed);
        }