Esempio n. 1
0
 /*
  * When instatiated, the constructor will load the entries into the dictionary and load the letter values
  */
 public Dictionary(string User_Input, int Blank_Tiles)
 {
     master_dictionary = new List<string> ();
     int max_length = 0;
     user_input = User_Input;
     blank_tiles = Blank_Tiles;
     accepted_words = new List<Word> ();
     letter_values = new Dictionary<char, int> ();
     user_letters = new string[User_Input.Count ()];
     Load_Dictionary ();
     Load_Letter_Values ();
 }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            //this will be called whenever whenever the generate button is pressed
            //It will trigger the testing of the user input
            this.btnGenerate.TouchUpInside += delegate {
                string user_input = this.txtfieldLetters.Text;
                int blank_tiles = 0;
                if(this.txtviewTiles.HasText == true){
                    blank_tiles = Convert.ToInt32(this.txtviewTiles.Text);
                }
                Dictionary dictonary = new Dictionary (user_input, blank_tiles);
                dictonary.Test_Input();
                this.txtviewResults.Text = dictonary.Output_Words();
                dictonary.Reset();
                this.txtviewResults.EndEditing(true);
                this.txtfieldLetters.ResignFirstResponder();
                this.txtviewTiles.ResignFirstResponder();
            };
        }