rj
2012-12-19 23:14:21
I'm making a basic script that has nothing to do with botting but it appears to have broken logic. It picks a random number and if you put a higher number it is supposed to say to high and if it's to low then it sais to low. But, everytime it sais to low no matter what. Heres the script:
Program Game;
const
RANDOM_PICK = 100;
var
Number,Tries,GuessInt:Integer;
Response,Guess:String;
Procedure DisplayResults;
begin
if (StrToInt(Guess)) > RANDOM_PICK then
begin
Writeln('TO HIGH!');
end;
if (StrToInt(Guess)) < RANDOM_PICK then
begin
Writeln('TO LOW')
end;
if (StrToInt(Guess)) = RANDOM_PICK then
begin
Writeln('WINNER')
end;
end;
Procedure AskGuess;
begin
If (InputQuery('Guess number', 'Number', Guess)) Then
begin
Writeln(StrToInt(Guess));
DisplayResults;
end;
end;
Procedure PickNumber;
begin
Number := Random(RANDOM_PICK);
Writeln('' + IntToStr(Number))
AskGuess;
end;
Begin
PickNumber;
end.