Datenbank mit komischen Nomen von Wikipedia
This commit is contained in:
parent
d218b291aa
commit
3e162c84b3
|
@ -75,6 +75,7 @@
|
|||
public MudTextField<string> textField;
|
||||
|
||||
public List<string> PreviousGuesses = new List<string>();
|
||||
public List<string> SecretList = new List<string>();
|
||||
|
||||
//Keine Ahnung wie das funktionert... Danke StackOverflow :)
|
||||
public IMask mask = new RegexMask(@"^[A-Za-z]{0,5}$");
|
||||
|
@ -82,10 +83,31 @@
|
|||
public string secret = "penis";
|
||||
private bool found = false;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
try
|
||||
{
|
||||
string text = File.ReadAllText("nomen.txt");
|
||||
string[] splitArray = text.Split(",");
|
||||
|
||||
foreach(var w in splitArray)
|
||||
{
|
||||
SecretList.Add(w);
|
||||
}
|
||||
|
||||
Random r = new Random();
|
||||
|
||||
secret = SecretList.ElementAt<string>(r.Next(SecretList.Count));
|
||||
Console.WriteLine("[SECRET]: " + secret.ToLower());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void Check4Enter(KeyboardEventArgs e)
|
||||
{
|
||||
Console.Out.WriteLine(e);
|
||||
Console.Out.WriteLine(e.Code);
|
||||
if (e.Code == "Enter" || e.Code == "NumpadEnter")
|
||||
{
|
||||
if(found)
|
||||
|
@ -103,7 +125,6 @@
|
|||
{
|
||||
if(Input != null && Input.Length == 5 && !found)
|
||||
{
|
||||
Console.Out.WriteLine(Input);
|
||||
PreviousGuesses.Add(Input);
|
||||
if(secret.ToLower() == Input.ToLower())
|
||||
{
|
||||
|
@ -123,5 +144,9 @@
|
|||
PreviousGuesses.Clear();
|
||||
hideAlert = true;
|
||||
found = false;
|
||||
|
||||
Random r = new Random();
|
||||
secret = SecretList.ElementAt<string>(r.Next(SecretList.Count));
|
||||
Console.WriteLine("[SECRET]: " + secret.ToLower());
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue