Exemplo n.º 1
0
        /// <summary>
        /// Handles a Click event on the "Find Words" button.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void uxFindWords_Click(object sender, EventArgs e)
        {
            ITrie results = new TrieWithNoChildren();

            bool[,] used = new bool[_gridSize, _gridSize];
            StringBuilder prefix = new StringBuilder();

            for (int i = 0; i < _gridSize; i++)
            {
                for (int j = 0; j < _gridSize; j++)
                {
                    results = GetWords(i, j, used, prefix, _wordList, results);
                }
            }

            uxWordsFound.Items.Clear();
            uxWordsFound.BeginUpdate();
            results.AddAll(new StringBuilder(), uxWordsFound.Items);
            uxWordsFound.EndUpdate();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Handles a Click event on the Find Words button.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void uxFindWords_Click(object sender, EventArgs e)
        {
            ITrie results = new TrieWithNoChildren();

            bool[,] used = new bool[_gridSize, _gridSize];
            StringBuilder pathHolder = new StringBuilder();

            for (int i = 0; i < _gridSize; i++)
            {
                for (int j = 0; j < _gridSize; j++)
                {
                    used[i, j] = false;
                    results    = FindWords(i, j, used, pathHolder, _wordList, results);
                }
            }
            // Add code to search the board for words.

            uxWordsFound.Items.Clear();
            uxWordsFound.BeginUpdate();
            results.AddAll(new StringBuilder(), uxWordsFound.Items);
            uxWordsFound.EndUpdate();
        }