I would have put this into a topic for everyone’s completion of this, but there doesn’t appear to be one. As such, I’ll include the relevant code I used below. Screenshots are a bit of a bother for me when I can just as easily copy and paste the relevant code into the discussion. Here is my for loop solution:
for (int count = 5; count != 0; count–)
I chose this solution to do away with the Magic Number issue without the need of creating another variable. By doing this, count becomes the number that will need to be modified. Zero is not a magic number and altering count will always work for varying how many guesses are alloted.
I’m not sure if this was an efficiently clever solution, or if I’ve made some sort of error in judgment without realising it. Either way, this was my approach to the challenge! I hope it was okay to create a new topic for this. I saw that others had…