A freepascal clock

A basical console clock written in freepascal by me, even if it’s an old language, I have to practice on it for school.

Here you got the code, I’ve added little comments but it isn’t a lot. hh = hour mm = minutes ss= seconds


01
02
 
03
uses crt;
04
 
05
var hh, mm, ss :integer;
06
 
07
BEGIN
08
ss:=0;
09
mm:=0;
10
hh:=0;
11
 
12
writeln('Donne le heure: ');
13
readln(hh);
14
writeln('donnez les minutes');
15
readln(mm);
16
clrscr;
17
 
18
while ss<60 do //59 seconds because on 60 mm+1
19
begin
20
ss:= ss + 1;  //count the seconds
21
 
22
writeln(hh,' : ', mm,' : ', ss);
23
 
24
delay(1);
25
clrscr;
26
 
27
if ss=59 then  //if 59 then mm + 1
28
begin
29
mm:= mm + 1;
30
ss:=0;
31
 
32
if mm=59 then  // 60 minutes but 59 minutes and 59 sec => hh+1
33
begin
34
hh:=  hh + 1;
35
mm:=0;
36
ss:=0;
37
 
38
if hh=23 then //24 hr, i don't do days
39
begin
40
hh:=0;
41
end;
42
end;
43
 
44
end;
45
end
46
END.