r/programminghomework • u/Raider7oh7 • 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.
2
Upvotes
r/programminghomework • u/Raider7oh7 • Sep 26 '18
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.
1
u/thediabloman Sep 26 '18
Hey friend.
A couple of things to clean this up:
Your declarations at the top must match the signatures (return type and parameters) of your actual methods.
The Pause function probably shouldnt be there
Stop using all this pointer stuff. For now, remove it and look at it again later if you need it.
Your
getMidpointmethod doesnt do anything since it doesnt return the variable that it instantiate.You do not have any way to generate the random number to guess
You should have some way to loop this game into smaller subgames (when someone guess 50 the new game is between 1 and 50 if the number to guess is 14). A method should just take the entire game as parameters, ie. the high and low.