I started to use C# a few days ago within an algorithm course. I have a homework and there is something I need explanation for. I need to create a hangman game with three levels, each level has four words to be guessed.
What I want to print on the screen is:
Level 1 : oooo
Level 2 : oooo
Level 3 : oooo
The "emtpy circle" will be filled each time a word is found within a level.
To render this, I decided to create a char[ ].
Here is the function I am using:
public static char[] DisplayEmptyCircles(List<string> listLevel)
{
char[] emptyCircle = new char[listLevel.Count];
for (int counterCircles = 0; counterCircles < listLevel.Count; counterCircles++)
{
emptyCircle[counterCircles] = Convert.ToChar(9675);
}
return emptyCircle;
}
When I use these two separate instructions everything goes well:
Console.Write("Level 1 : ");
Console.Write(DisplayEmptyCircles(firstLevel));
But I first used this one and got a System.Char[ ] printed instead of the empty circles :
Console.WriteLine("Level 1 : " + DisplayEmptyCircles(firstLevel));
Can someone tell me why?
I am sorry I know the question was asked already but I know barely nothing about C#. It's just to start learning and understanding.