From b2bd8eb462f222db64efbc729c6ce2cfb5b65d61 Mon Sep 17 00:00:00 2001 From: lempamo Date: Sat, 25 Feb 2017 20:28:58 -0500 Subject: Added custom wordlist feature to shiftletters --- ShiftOS.WinForms/Applications/ShiftLetters.cs | 50 +++++++++++++-------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'ShiftOS.WinForms/Applications/ShiftLetters.cs') diff --git a/ShiftOS.WinForms/Applications/ShiftLetters.cs b/ShiftOS.WinForms/Applications/ShiftLetters.cs index 0dd1505..4e02e3c 100644 --- a/ShiftOS.WinForms/Applications/ShiftLetters.cs +++ b/ShiftOS.WinForms/Applications/ShiftLetters.cs @@ -46,6 +46,11 @@ namespace ShiftOS.WinForms.Applications string word = ""; static Random rng = new Random(); string guessedCharacters = ""; + List shiftWordlist = new List { "shiftos", "devx", "artpad", "shifter", "pong", + "shiftorium", "codepoints", "shiftletters", "shops", "mud", "notification", "namechanger", + "skinning", "skinloader", "calculator", "fileskimmer", "lua", "shiftnet", "terminal", "textpad"}; + List contributorsWordlist = new List { "12padams", "carverh", "computelinux", "lempamo", + "wowmom98", "michaeltheshifter", "arencclc", "therandommelon", "pfg", "craftxbox"}; public ShiftLetters() { @@ -56,34 +61,14 @@ namespace ShiftOS.WinForms.Applications { guessedCharacters = ""; lives = 7; + comboBox1.Visible = false; tbguess.Visible = true; lbllives.Visible = true; lblword.Visible = true; btnrestart.Visible = false; - var wordlist = new List - { - "shiftos", - "devx", - "artpad", - "shifter", - "pong", - "shiftorium", - "codepoints", - "shiftletters", - "shops", - "mud", - "notification", - "namechanger", - "skinning", - "skinloader", - "calculator", - "fileskimmer", - "lua", - "shiftnet", - "terminal", - "textpad" - }; - word = wordlist[rng.Next(wordlist.Count)]; + 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"); lbllives.Text = "You have 7 lives left!"; lblword.Text = ""; for (int i=0; i