I would start by changing the gap between the number the computer is guessing. For example, if the number is 50 and the gap is 0 to 100 and the computer picks 22, the random generator the computer is picking from should change the gap to 22 to 100.Your if statements should have a modifier of the randim number gap from the computer. Im reletively new to programming, so if anyone else wants to comment on mine feel free, i learn through helping. :-)
Well you have to sort out an algorithm!!! The most fair thing to do is to divide the interval in two parts, so, if the interval is 1 -100, you ask the user: "is 50?" and then he can answer "yes" or "smaller" or "bigger".. then you divide the interval 0-49 or 51-100 in two parts and so and so, in max 7 times you arrive at the solution.