new files
This commit is contained in:
parent
3af7344581
commit
86c034bb8b
1364 changed files with 21352 additions and 0 deletions
11
Task/Collections/Ada/collections-1.ada
Normal file
11
Task/Collections/Ada/collections-1.ada
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
procedure Array_Collection is
|
||||
|
||||
A : array (-3 .. -1) of Integer := (1, 2, 3);
|
||||
|
||||
begin
|
||||
|
||||
A (-3) := 3;
|
||||
A (-2) := 2;
|
||||
A (-1) := 1;
|
||||
|
||||
end Array_Collection;
|
||||
12
Task/Collections/Ada/collections-2.ada
Normal file
12
Task/Collections/Ada/collections-2.ada
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
procedure Array_Collection is
|
||||
|
||||
type Array_Type is array (1 .. 3) of Integer;
|
||||
A : Array_Type := (1, 2, 3);
|
||||
|
||||
begin
|
||||
|
||||
A (1) := 3;
|
||||
A (2) := 2;
|
||||
A (3) := 1;
|
||||
|
||||
end Array_Collection;
|
||||
13
Task/Collections/Ada/collections-3.ada
Normal file
13
Task/Collections/Ada/collections-3.ada
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
procedure Array_Collection is
|
||||
|
||||
type Array_Type is array (positive range <>) of Integer; -- may be indexed with any positive
|
||||
-- Integer value
|
||||
A : Array_Type(1 .. 3); -- creates an array of three integers, indexed from 1 to 3
|
||||
|
||||
begin
|
||||
|
||||
A (1) := 3;
|
||||
A (2) := 2;
|
||||
A (3) := 1;
|
||||
|
||||
end Array_Collection;
|
||||
17
Task/Collections/Ada/collections-4.ada
Normal file
17
Task/Collections/Ada/collections-4.ada
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
with Ada.Containers.Doubly_Linked_Lists;
|
||||
use Ada.Containers;
|
||||
|
||||
procedure Doubly_Linked_List is
|
||||
|
||||
package DL_List_Pkg is new Doubly_Linked_Lists (Integer);
|
||||
use DL_List_Pkg;
|
||||
|
||||
DL_List : List;
|
||||
|
||||
begin
|
||||
|
||||
DL_List.Append (1);
|
||||
DL_List.Append (2);
|
||||
DL_List.Append (3);
|
||||
|
||||
end Doubly_Linked_List;
|
||||
17
Task/Collections/Ada/collections-5.ada
Normal file
17
Task/Collections/Ada/collections-5.ada
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
with Ada.Containers.Vectors;
|
||||
use Ada.Containers;
|
||||
|
||||
procedure Vector_Example is
|
||||
|
||||
package Vector_Pkg is new Vectors (Natural, Integer);
|
||||
use Vector_Pkg;
|
||||
|
||||
V : Vector;
|
||||
|
||||
begin
|
||||
|
||||
V.Append (1);
|
||||
V.Append (2);
|
||||
V.Append (3);
|
||||
|
||||
end Vector_Example;
|
||||
Loading…
Add table
Add a link
Reference in a new issue