Comments

begin randomize; tries:=0; a:=succ(random(100)); time:=meml[0:$46c]; { <-- Get time from system counter, it gets updated every 55ms } repeat write(#13#10'Enter a number between 1 and 100 (0 to Exit) : ');readln(b); inc(tries); if b=0 then begin writeln(#13#10'Exiting...');halt;end; if a<b then writeln('Too big...') else if a>b then writeln('Too small...'); until a=b; time:=trunc((meml[0:$46c]-time)/18.2); { <-- calculate elapsed time } writeln(#13#10#13#10'You took ',time,' seconds and ',tries,' tries to guess it.');readln;end.[/color][/code]

begin randomize; tries:=0; a:=succ(random(100)); time:=[red]gettickcount;[/red] { <-- Get time from system counter, it gets updated every millisecond } repeat write(#13#10'Enter a number between 1 and 100 (0 to Exit) : ');readln(b); inc(tries); if b=0 then begin writeln(#13#10'Exiting...');halt;end; if a<b then writeln('Too big...') else if a>b then writeln('Too small...'); until a=b; time:=trunc(([red]gettickcount[/red]-time)/[red]1000[/red]); { <-- calculate elapsed time } writeln(#13#10#13#10'You took ',time,' seconds and ',tries,' tries to guess it.');readln;end.[/color][/code]

Worked exactly like I expected to.Anyway, the code I put was just a part of the original game.The original has 3 difficulty modes (easy, medium and hard) and has the option of playing by tries, by time or both.Grace to your resolution, I managed to do it all.

Looks like the game will keep entertained some of my classmates (if not all):-)