refined last details,
finally wrote sth in the readme
This commit is contained in:
parent
d3fe16ed86
commit
10ffa53ae5
2 changed files with 33 additions and 11 deletions
|
@ -0,0 +1,8 @@
|
||||||
|
> This is the exercise we have to do for our Ada 2nd semester exam:
|
||||||
|
|
||||||
|
|
||||||
|
- Both Tds a r=separated by a comment with their names
|
||||||
|
- I did all of the question of exercise 2 in order
|
||||||
|
- I did the paper question of exercise 3 then the rest of the question (except the optionnal one on strings)
|
||||||
|
- the elvish sentence means "One Ring to rule them all, One Ring to find them, One Ring to bring them all, and in the darkness bind them" I thought it was totally appropriate
|
||||||
|
- the INSA logo is from the 1st semester Test :)
|
|
@ -1,3 +1,5 @@
|
||||||
|
-- shall we play a game?
|
||||||
|
|
||||||
with Fiche_Plongee, Capteurs, Gada.Text_IO;
|
with Fiche_Plongee, Capteurs, Gada.Text_IO;
|
||||||
use Fiche_Plongee, Capteurs, Gada.Text_IO;
|
use Fiche_Plongee, Capteurs, Gada.Text_IO;
|
||||||
|
|
||||||
|
@ -15,10 +17,13 @@ procedure td is
|
||||||
Counter := Counter+1;
|
Counter := Counter+1;
|
||||||
end if;
|
end if;
|
||||||
end loop;
|
end loop;
|
||||||
|
|
||||||
return Counter;
|
return Counter;
|
||||||
end Effectif_Palanquee;
|
end Effectif_Palanquee;
|
||||||
|
|
||||||
|
|
||||||
|
-- Wake up Neo
|
||||||
|
|
||||||
|
|
||||||
function Effectif_Fiche(Table: T_Fiche_Secu) return integer is
|
function Effectif_Fiche(Table: T_Fiche_Secu) return integer is
|
||||||
I : Integer := 0; -- to go through the table
|
I : Integer := 0; -- to go through the table
|
||||||
|
@ -36,7 +41,9 @@ procedure td is
|
||||||
|
|
||||||
return Counter;
|
return Counter;
|
||||||
end Effectif_Fiche;
|
end Effectif_Fiche;
|
||||||
|
|
||||||
|
-- the matrix has you
|
||||||
|
|
||||||
function Est_Plongee_Technique(Palanq : T_Palanq) return Boolean is
|
function Est_Plongee_Technique(Palanq : T_Palanq) return Boolean is
|
||||||
I : Integer := 1; -- to go through the table
|
I : Integer := 1; -- to go through the table
|
||||||
Teacher : Integer := 0; -- to store the number of teachers
|
Teacher : Integer := 0; -- to store the number of teachers
|
||||||
|
@ -57,7 +64,8 @@ procedure td is
|
||||||
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;
|
end Est_Plongee_Technique;
|
||||||
|
|
||||||
|
-- follow the white rabbit
|
||||||
|
|
||||||
function Numero_Premiere_Technique(Fiche : T_Fiche_Secu) return Integer is
|
function Numero_Premiere_Technique(Fiche : T_Fiche_Secu) return Integer is
|
||||||
I : Integer := 1; -- to go through the table
|
I : Integer := 1; -- to go through the table
|
||||||
Tech : Boolean := Est_Plongee_Technique(Fiche.Tab_Palanquees(I)); -- we initialize this as the very first entry of the table
|
Tech : Boolean := Est_Plongee_Technique(Fiche.Tab_Palanquees(I)); -- we initialize this as the very first entry of the table
|
||||||
|
@ -71,6 +79,8 @@ procedure td is
|
||||||
return I;
|
return I;
|
||||||
end Numero_Premiere_Technique;
|
end Numero_Premiere_Technique;
|
||||||
|
|
||||||
|
-- the two that are one will become the one that is all
|
||||||
|
|
||||||
function Durees_Fiche_OK(Fiche: T_Fiche_Secu) return Boolean is
|
function Durees_Fiche_OK(Fiche: T_Fiche_Secu) return Boolean is
|
||||||
I : Integer := 1; -- to go through the table
|
I : Integer := 1; -- to go through the table
|
||||||
Good : Boolean := True; -- if it stays good all along then it's good else it's not
|
Good : Boolean := True; -- if it stays good all along then it's good else it's not
|
||||||
|
@ -83,6 +93,7 @@ procedure td is
|
||||||
return Good;
|
return Good;
|
||||||
end Durees_Fiche_OK;
|
end Durees_Fiche_OK;
|
||||||
|
|
||||||
|
-- Do you know Twitch Prime?
|
||||||
|
|
||||||
function Profondeur_Max(Table: T_palanq) return Integer is
|
function Profondeur_Max(Table: T_palanq) return Integer is
|
||||||
I : Integer := 0; -- to go through the table
|
I : Integer := 0; -- to go through the table
|
||||||
|
@ -99,6 +110,8 @@ procedure td is
|
||||||
|
|
||||||
end Profondeur_Max;
|
end Profondeur_Max;
|
||||||
|
|
||||||
|
--Ash nazg durbatulûk, ash nazg gimbatul, ash nazg thrakatulûk, agh burzum-ishi krimpatul
|
||||||
|
|
||||||
function Profondeur_Fiche_OK(Fiche: T_Fiche_Secu) return Boolean is
|
function Profondeur_Fiche_OK(Fiche: T_Fiche_Secu) return Boolean is
|
||||||
I : Integer := 1; -- to go through the table
|
I : Integer := 1; -- to go through the table
|
||||||
Good : Boolean := True; -- to be returned
|
Good : Boolean := True; -- to be returned
|
||||||
|
@ -142,7 +155,9 @@ procedure td is
|
||||||
-- (Nord,2,32481.8)
|
-- (Nord,2,32481.8)
|
||||||
-- (Nord,1,32483.8)
|
-- (Nord,1,32483.8)
|
||||||
|
|
||||||
|
-- where we go we don't need roads
|
||||||
|
|
||||||
|
|
||||||
procedure Course is
|
procedure Course is
|
||||||
Temp: Float := 0.0; -- there to store a value
|
Temp: Float := 0.0; -- there to store a value
|
||||||
Rank: Integer := 0;
|
Rank: Integer := 0;
|
||||||
|
@ -214,6 +229,8 @@ procedure td is
|
||||||
end loop;
|
end loop;
|
||||||
end loop;
|
end loop;
|
||||||
|
|
||||||
|
|
||||||
|
--we then print out the lines
|
||||||
for I in 1 .. NB_Swimmer loop
|
for I in 1 .. NB_Swimmer loop
|
||||||
J := 0;
|
J := 0;
|
||||||
while (Arrival(I) /= TableTime(J,3)) loop
|
while (Arrival(I) /= TableTime(J,3)) loop
|
||||||
|
@ -225,21 +242,18 @@ procedure td is
|
||||||
|
|
||||||
end Course;
|
end Course;
|
||||||
|
|
||||||
|
-- It is the nature of human kind to push itself towards the horyzon, we test our limits, we face our fears, we rise to the challenge, and become something greater than ourselves, a civilization.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Put_Line("42");
|
Put_Line("42");
|
||||||
|
|
||||||
|
-- As we do not have usable numerical data I did not do numerical testes :/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end td;
|
end td;
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
--
|
--
|
||||||
--
|
--
|
||||||
|
|
Loading…
Reference in a new issue