r/programminghomework • • Sep 26 '18

c++ homework help

random number guessing game. 1-100

i have been stuck for hours and shit is a mess now. idk even know what im staring at anymore, any help appreciated.

https://onlinegdb.com/ByFv-U_tm

2 Upvotes

4 comments sorted by

View all comments

Show parent comment

2

u/thediabloman Sep 26 '18

It looks okay. I would probably move your three instances of calls to the getGuess method into the beginning of the while loop.

If you want to challenge yourself, think of a way to do it without a loop. Imagine each round as a separate instance of the game with different boundaries. What are the boundaries of when the game repeats and when it does not. Hint: It is possible for a method to call itself.

1

u/Raider7oh7 Sep 26 '18

Thanks will give it a shot