hey guys

so I made the stupid mistake of taking a course this year becuase one of my friends took it last year and found it dreadfully easy. Unfortunatly the course format was changed this year, and we are learning to program in C (last year they learned the difference between a ball-mouse and an optical mouse).

My assignment is this: you will write a computer program that actually plays the game. it will make smart guesses until it finds the right answer. you will write your program in the C programming language.
the rules:
1/ the user will pick a number between 1 & 100 (but not tell the computer what it is)
2/ the computer will make a guess
3/the user will tell the computer whether its guess was too hight, to low, or right on
4/ steps 2 and 3 repeat until the computer guesses right, when it will output "I got it!""

there is a good way to play this game - a smart player will always cut the range of possible answers in half with every guess

the codes that will tell the computer how to evaluate it's guess are:
input of 0 means: right on
input of 1 means: too low
input of 2 means: too high


I know that I'm going to have to establish variables, (ints upper lower and guess?) and then have a loop where the comptuer calculates what the guess should be based on the last input, then guesses, then gets feedback about whether it guessed too high, low or right on.
then break the loop.

but i don't have a clue how to start any of it. back in the day when I was in grade 10, I couldn't get a handle on QBasic, I'm not surprised that even 5 years later, this is still beyond me.

thank you so much for any help you can give