added spaces :)

This commit is contained in:
Raphael Lacroix 2020-05-31 23:20:57 +02:00
parent 64907ba9de
commit 6f8525518a

View file

@ -14,7 +14,7 @@ procedure td is
for I in 1 .. Max_Plongeurs loop
if Table.Plongeurs(I).Present then
Counter := Counter+1;
Counter := Counter + 1;
end if;
end loop;
@ -56,11 +56,11 @@ procedure td is
elsif Palanq.Plongeurs(I).Role = Eleve then -- if he is present and is a student we increment student
Student := Student + 1;
else -- if he is present and is neither a teacher nor a student we increment other
Other := Other +1;
Other := Other + 1;
end if;
end if;
end loop;
return (Teacher = 1 and Other = 0 and (Student > 0 and Student <5)); -- we return the value taken by the condition
return (Teacher = 1 and Other = 0 and (Student > 0 and Student < 5)); -- we return the value taken by the condition
end Est_Plongee_Technique;
-- //follow the white rabbit
@ -72,7 +72,7 @@ procedure td is
begin
while (not Tech) loop -- while our plongee is not technique we keep on looking at the next entry
I := I+1; -- I miss the i++ so bad
I := I + 1; -- I miss the i++ so bad
Tech := Est_Plongee_Technique(Fiche.Tab_Palanquees(I)); -- we take the value of whether the Ith plongee is technique
end loop;
return I;
@ -172,7 +172,7 @@ procedure td is
Sorted: Boolean := False; -- there to store the state of sorting of the array at the end
J : Integer := 0;-- there to increment
I : Integer := 0;-- there to increment
NB_Swimmer: Integer :=8; -- could be more;
NB_Swimmer: Integer := 8; -- could be more;
Running : Boolean:= True;
Event : T_Evenement;
TDepart : Float := 0.0; -- the time of the start of the race
@ -181,8 +181,8 @@ procedure td is
type T_TableArr is array (1..NB_Swimmer) of Float; -- time at which the awimmer arrives
TableTime: T_TableTime := (others => (others => 0.0));
TableNum : T_TableNum :=(others => 0);
Arrival : T_TableArr :=(others => 0.0);
TableNum : T_TableNum := (others => 0);
Arrival : T_TableArr := (others => 0.0);
begin
while Running loop
@ -195,15 +195,15 @@ procedure td is
Running := False; -- we stop the race
Put_Line("False start at line" & Integer'Image(Event.Num));
else
TableTime(Event.Num,1) := Event.Date; -- starting value
TableTime(Event.Num,4) := Event.Date; -- Last value
TableTime(Event.Num, 1) := Event.Date; -- starting value
TableTime(Event.Num, 4) := Event.Date; -- Last value
end if;
elsif (Event.Emetteur = Capteur_Nord and (Event.Date - TableTime(Event.Num,4)>5.0)) then -- it's hard to do 50m in less than 5 seconds
if TableNum(Event.Num) = 0 then
TableTime(Event.Num,2) := Event.Date; -- we store the value at the first 50 m
TableTime(Event.Num, 2) := Event.Date; -- we store the value at the first 50 m
TableNum(Event.Num):=TableNum(Event.Num)+1; -- we increment the numer of runs
elsif TableNum(Event.Num) = 15 then -- it means he's finishing his last run
TableTime(Event.Num,3) := Event.Date; -- we store the arrival's date
TableTime(Event.Num, 3) := Event.Date; -- we store the arrival's date
end if;
elsif Event.Emetteur = Bouton_Fin then -- the director of the race stopped it (probably saw someone arrive)
Running := False;
@ -212,14 +212,14 @@ procedure td is
-- we store the times of arrival
for I in 1 .. NB_Swimmer loop
Arrival(I) := TableTime(I,3);
Arrival(I) := TableTime(I, 3);
end loop;
-- We order the table:
while not Sorted loop
for I in 1 .. NB_Swimmer-1 loop -- for every value if it is greater than the next one we swop them
if Arrival(I)>Arrival(I+1) then
if Arrival(I) > Arrival(I+1) then
Temp := Arrival(I); -- there to store a value
Arrival(I) := Arrival(I+1);
Arrival(I+1) := Temp;
@ -231,7 +231,7 @@ procedure td is
--here we check for if it's sorted (if not we give it another go)
Sorted := True; --it starts true
for I in 1 .. NB_Swimmer-1 loop
if Arrival(I)>Arrival(I+1) then -- if a value is greater than the next one (as it's not supposed to be)
if Arrival(I) > Arrival(I+1) then -- if a value is greater than the next one (as it's not supposed to be)
Sorted := False; -- we set the sorted value to false
end if;
end loop;