Exemple #1
0
        public void fillIn(bonusword word)
        {
            bonusWord = word;

            this.correct = rand.Next(0, 3);

            if (correct == 0)
            {
                this.sentence1Text.contents = this.rightSentences[rand.Next(this.rightSentences.Count)].Replace("<*word*>", word.word);
                this.sentence2Text.contents = this.wrongSentences[rand.Next(this.wrongSentences.Count)].Replace("<*word*>", word.word);
                this.sentence3Text.contents = this.wrongSentences[rand.Next(this.wrongSentences.Count)].Replace("<*word*>", word.word);
            }
            else if (correct == 1)
            {
                this.sentence2Text.contents = this.rightSentences[rand.Next(this.rightSentences.Count)].Replace("<*word*>", word.word);
                this.sentence1Text.contents = this.wrongSentences[rand.Next(this.wrongSentences.Count)].Replace("<*word*>", word.word);
                this.sentence3Text.contents = this.wrongSentences[rand.Next(this.wrongSentences.Count)].Replace("<*word*>", word.word);
            }
            else if (correct == 2)
            {
                this.sentence3Text.contents = this.rightSentences[rand.Next(this.rightSentences.Count)].Replace("<*word*>", word.word);
                this.sentence1Text.contents = this.wrongSentences[rand.Next(this.wrongSentences.Count)].Replace("<*word*>", word.word);
                this.sentence2Text.contents = this.wrongSentences[rand.Next(this.wrongSentences.Count)].Replace("<*word*>", word.word);
            }
        }
Exemple #2
0
        private void newBonusWord()
        {
            if (this.language == "english")
            {
                bonusWord = this.bonusEnglish[rand.Next(this.bonusEnglish.Count)];
                while (bonusWord.length != (int)Math.Floor(bonusWordLength))
                {
                    bonusWord = this.bonusEnglish[rand.Next(this.bonusEnglish.Count)];
                }
                bonusString = bonusWord.word.ToUpper();
            }
            else
            {
                bonusString = this.bonus[rand.Next(this.bonus.Count)].ToUpper();
                while (bonusString.Length != (int)Math.Floor(bonusWordLength))
                {
                    bonusString = this.bonus[rand.Next(this.bonus.Count)].ToUpper();
                }
            }
            buttonBonus.contents = bonusString;

            bonusSeed.Clear();
            foreach (char c in bonusString)
            {
                bonusSeed.Add(c);
            }
            Console.Out.WriteLine(bonusSeed);
        }