I added the initialization to show the array. When it hits the else and tries to insert the input into the array it throws an exception. I have tried several different examples online, and have not yet found a solution. I am appreciative of any help that is given.
private char[] currentMisses;
public int makeTurn()
{
// Ask the user for a guess
Console.Write("Choose A Letter: ");
// Get the input from the user
var currentGuess = Console.ReadKey();
char input = currentGuess.KeyChar;
input = Char.ToUpper(input);
// Do input conversions
while (!char.IsLetter(input))
{
//Console.Write(input);
currentGuess = Console.ReadKey(true);
input = currentGuess.KeyChar;
input = Char.ToUpper(input);
}
// See if it exists in our word
bool test = false;
test = currentWord.Contains(input);
Console.WriteLine("Hello" + input);
// If we didn't find it
if (!test)
{
if (currentMisses != null)
{
Console.WriteLine("WORD");
// Make sure it does not currently exist in the misses array
for (int i = 0; i < currentMisses.Length; i++)
{
if (currentMisses[i] != input)
{
currentMisses[i] = input;
Console.WriteLine("In Loop");
}
Console.WriteLine("Not in Loop");
}
}
else
{
/* This is where I am trying to insert the input from the user to the char array currentMisses, I've tried multiple ways and it seems simple but I hit a roadblock*/
currentMisses[0] = input;
}