This is a simple hangman game written in C# (.NET 6). This was done as an example for a friend who's learning programming. Hopefully this can be useful to others as well.
- A word is selected from the list of words (value assigned to
choosenWord
). - We initialize an empty array that will contain all the letters that have been submitted. This array is called
letters
. - We also store a count of how many lives are left. This variable is called
lives
. - The main game loop runs as long as the lives have not reached 0.
- Inside the loop, the following happens:
- We loop through each letter of the choosen word.