Play it for three times and we can get the final result.

var
number, guess: integer;

begin
randomize;
number:= random(3)+1;
writeln('Wellcome to the game of snap.');
if guess>number then begin writeln('It''s too big! Please try again.'); end
else
if guess<number then begin writeln('It''s too small! Please try again!'); end
else begin writeln ('CONGRATULATIONS, you have chosen the right number."); end;
until guess=number;
sleep(10000);
end.

What do you think? :)

``````{
Question
"Play it for three times and we can get the final result."
}
Program Solution01;
Var number,guess,i,counter:Integer;
Begin {main}
Randomize;
counter:=0;
For i:=1 To 3 Do Begin {three times}
number:=1+Random(3);{in every round,random number between 1 and 3}
WriteLn('---------------------------------');
WriteLn(i,'. Welcome to the game of snap.');
Repeat
Write('Give me a number between 1 and 3: ');

If (guess<number) Then Begin
WriteLn('It''s too small!'+' Number was: ',number);
if (i<>3) then WriteLn('Please try again!')
Else WriteLn('Game Over.');
Break;
End;
If (guess>number) Then Begin
WriteLn('It''s too big!'+' Number was: ',number);
if (i<>3) then WriteLn('Please try again!')
Else WriteLn('Game Over.');
Break;
End;
If (guess = number) Then Begin
WriteLn('CONGRATULATIONS!!!!');
if (i<>3) then WriteLn('You have chosen the right number!!!')
Else WriteLn('Game Over.');
counter:=counter+1;
Break;{exit the loop}
End;
Until guess = number;
End;
WriteLn('---------------------------------');
WriteLn;
WriteLn('Your total points: ',counter,' of 3');
WriteLn('---------------------------------');