Thanks! I think it didn't work initially for me was because i did not add in the min when i did range/2. I understand mathematically how it works when you work it out manually. But how did you know to add the min to range/2?
Let's say, Min is 50, and max is 90. (for our purposes here that is)
the Range is max - min, or 90 - 50 = 40. there are 40 numbers between 50 and 90.
Half of t hat range is 20. but we can't guess 20, cause it's not even higher than min. So we add Min to it, 20+50=70. 70 is half way between 50 and 90.
This is also why you were originally adding min to your random.. You picked a random number between 0 and range - 1, then add min to it.
So actually if i did the guessVal=(x+y)/2 ---> it will also work right? ?Interesting to learn it in so many ways. I guess i kept thinking it should be more complicated for some reason. Thanks again!