Hi! I wasn’t sure if it’s appropriate to post this as a new post or if I should have posted it as a reply to
this thread, but I figured since the other post is 4 months old and my question is a bit different I should make a new one. Sorry if that’s not correct.
The guess the number game of that review has become a sort of obsession for me, since there are some things I just can’t seem to wrap my head around. I have tried many approaches, and I have made a few variants that work as they should.
Using a do-while loop (that I haven’t really learned about at this point in the course), and one version using a method to initialize the guessing (methods were a topic later on in the course).
I guess when I learn about the for loops I will get an even better way to make the game.
But my question is:
Is there any way to make this number guessing game do the following things with using only if-else, and or switch statements:
- User inputs guesses
- User gets notified if the number is too high/too low
- User can guess again
- AND when they guess correctly they get the option to start the game over again.
Since my knowledge of C# is at such a low level I can’t seem to figure this out, and it’s not for lack of trying! So if anyone with more experience could just let me know “this is impossible”, it would be really great for my peace of mind
Or - if it is possible - give me a hint for how I can do it!
Links to the different variants of the game that I have made so far (to not make this post a million pages long )
using method: https://pastebin.com/uLQtLJ4h
latest attempt at if/else and switch, not working properly: https://pastebin.com/LHiCmcpH