diff options
| author | Michael VanOverbeek <[email protected]> | 2017-02-26 08:37:06 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-02-26 08:37:06 -0500 |
| commit | e1e0d142dc6a1c1f1b21d7ae2b7d7e699963d268 (patch) | |
| tree | e670f4d26dbd03f218275550aa12640f729e12b5 /ShiftOS.WinForms/Applications/ShiftLetters.cs | |
| parent | ab8c5c6f467b9ae61c27cdfb1a68c2812cb7d78f (diff) | |
| parent | 3a46014d655a9d36e51fec5a6ddddde9937647e1 (diff) | |
| download | shiftos_thereturn-e1e0d142dc6a1c1f1b21d7ae2b7d7e699963d268.tar.gz shiftos_thereturn-e1e0d142dc6a1c1f1b21d7ae2b7d7e699963d268.tar.bz2 shiftos_thereturn-e1e0d142dc6a1c1f1b21d7ae2b7d7e699963d268.zip | |
Merge branch 'master' into master
Diffstat (limited to 'ShiftOS.WinForms/Applications/ShiftLetters.cs')
| -rw-r--r-- | ShiftOS.WinForms/Applications/ShiftLetters.cs | 58 |
1 files changed, 55 insertions, 3 deletions
diff --git a/ShiftOS.WinForms/Applications/ShiftLetters.cs b/ShiftOS.WinForms/Applications/ShiftLetters.cs index 4514157..aa3bf18 100644 --- a/ShiftOS.WinForms/Applications/ShiftLetters.cs +++ b/ShiftOS.WinForms/Applications/ShiftLetters.cs @@ -66,9 +66,59 @@ namespace ShiftOS.WinForms.Applications lbllives.Visible = true; lblword.Visible = true; btnrestart.Visible = false; - if ((String)comboBox1.SelectedItem == "ShiftOS") word = shiftWordlist[rng.Next(shiftWordlist.Count)]; - else if ((String)comboBox1.SelectedItem == "Contributors") word = contributorsWordlist[rng.Next(contributorsWordlist.Count)]; - else throw new NullWordlistException(":P"); + + var wordlist = new List<string> + { + "shiftos", + "devx", + "artpad", + "shifter", + "pong", + "shiftorium", + "codepoints", + "shiftletters", + "shops", + "mud", + "notification", + "namechanger", + "skinning", + "skinloader", + "calculator", + "fileskimmer", + "lua", + "shiftnet", + "terminal", + "textpad" + }; + foreach(var w in shiftWordlist) + { + if (!wordlist.Contains(w.ToLower()) + { + wordlist.Add(w.ToLower()); + } + } + foreach(var w in contributorsWordlist) + { + if (!wordlist.Contains(w.ToLower()) + { + wordlist.Add(w.ToLower()); + } + } + //This can diversify the amount of ShiftOS-related words in the game. + foreach(var upg in Shiftorium.GetDefaults()) + { + foreach(var w in upg.Name.Split(' ')) + { + if (!wordlist.Contains(w.ToLower())) + wordlist.Add(w.ToLower()); + } + } + word = wordlist[rng.Next(wordlist.Count)]; + while(word == lastword) + { + word = wordlist[rng.Next(wordlist.Count)]; + } + lastword = word; //to make the game not choose the same word twice or more in a row lbllives.Text = "You have 7 lives left!"; lblword.Text = ""; for (int i=0; i<word.Length; i++) @@ -100,6 +150,8 @@ namespace ShiftOS.WinForms.Applications } + string lastword = ""; + private void tbguess_TextChanged(object sender, EventArgs e) { if (this.tbguess.Text.Length == 1) |
