You still do not include all relevant code in your question.
It shoes letters have been guessed at the very start of the game, when which, obviously you haven’t guessed any.
The problem is at this point of your code:
array<bool, 26> guessed;
This does not set the elements of the array
to false
, and they have an indeterminate value.
If you want that they are false
you need to write:
array<bool, 26> guessed{};
To avoid such problems, you can go with AAA Style (Almost Always Auto), and define your variables that way:
auto guessed = array<bool, 26>();
solved This code is not working properly and it doesn’t make any sense why it isn’t to me. Does anyone have a guess what the problem might be?