Jan-04-2018, 02:16 AM
(This post was last modified: Jan-04-2018, 02:16 AM by ShadowWarrior17.)
Just use two points and add them and divide them by two and that's your first guess, just like a human would do. 0+100//2=50. Then an input would be if the guess is too high or low. Then the guess would be either 25 or 75 etc. Mathematically speaking, this should take about 8-10 steps, which is probably the quickest; unless you're randomly guessing or brute forcing.
Here's something I came up with quickly:
Here's something I came up with quickly:
h=100 l=0 answer="" while answer != "yes": m=(h+l)//2 print("Is it",m,"?") answer=input("lower, higher or yes?") if answer=="lower": h*=1.5 elif answer=="higher": h*=0.5Though I'm not sure on it's reliability, just it's idea.