I am trying to make what I thought was a simple game.
Here's what it is the user inputs a number and the computer tries to guess the number. This is done by means of less or more using the inputbox. function.
This is what I have so far:-
procedure TForm1.StartClick(Sender: TObject);
Var a,b,d:string;
begin
a:=InputBox('User Input','Please enter number between 0 and 100','0');
User.Caption:='User Inputs ' + a;
randomize;
b:=IntToStr(random(100));
Comp.Caption:='Computer Guesses ' + b;
if b<>a then
Res.Caption:='Wrong';
if b > a then
d:=Inputbox('User Input','Is it less or more?','less');
if b=a then
Res.Caption:='Right'
end;
end.
but I am, at a lost as how to take the string of the inputbox and tell the computer it is less more so as it can add or subtract from is original guess until it gets it right.
Any help would be much appericated.
Thanks.