still has some bugs
This commit is contained in:
@@ -44,7 +44,7 @@ namespace WindowsFormsApp1
|
||||
{
|
||||
if (CharNotInList(guess, Data.charfound))
|
||||
{
|
||||
Data.charfound.Add(guess);
|
||||
Data.charfound.Insert(0, guess);
|
||||
Data.charfound.Sort();
|
||||
label1.Text = labelTextChange(label1.Text);
|
||||
}
|
||||
@@ -123,9 +123,32 @@ namespace WindowsFormsApp1
|
||||
}
|
||||
|
||||
|
||||
public static string labelTextChange(string temp)
|
||||
public string labelTextChange(string current)
|
||||
{
|
||||
return temp;
|
||||
char[] temp = Data.word.ToCharArray();
|
||||
char[] sol = current.ToCharArray();
|
||||
while (Indexofchar(temp) != -1)
|
||||
{
|
||||
int a = Indexofchar(temp);
|
||||
sol[a] = Data.charfound[0];
|
||||
temp[a] = '_';
|
||||
}
|
||||
|
||||
string asd = sol.ToString();
|
||||
|
||||
return asd;
|
||||
}
|
||||
|
||||
public int Indexofchar(char[] arr)
|
||||
{
|
||||
for (int i = 0; i < arr.Length; i++)
|
||||
{
|
||||
if (arr[i] == Data.wordchar[0])
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user