diff options
author | 3gg <3gg@shellblade.net> | 2025-08-09 16:03:28 +0200 |
---|---|---|
committer | 3gg <3gg@shellblade.net> | 2025-08-09 16:03:28 +0200 |
commit | 727e3c59346da4f91284b34b4c18f2e0ba155e53 (patch) | |
tree | 807dccd5cba3c6bae2f8d0c9910157e306c6da5b /stack/src/main.adb |
Diffstat (limited to 'stack/src/main.adb')
-rw-r--r-- | stack/src/main.adb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/stack/src/main.adb b/stack/src/main.adb new file mode 100644 index 0000000..977a46b --- /dev/null +++ b/stack/src/main.adb | |||
@@ -0,0 +1,20 @@ | |||
1 | with Ada.Assertions; use Ada.Assertions; | ||
2 | with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; | ||
3 | with Ada.Text_IO; use Ada.Text_IO; | ||
4 | |||
5 | with Stack; | ||
6 | |||
7 | procedure Main is | ||
8 | package IntStack is new Stack (Integer); | ||
9 | S : IntStack.Stack; | ||
10 | Val : Integer; | ||
11 | begin | ||
12 | Put_Line ("Hello world!"); | ||
13 | for I in 1 .. 5 loop | ||
14 | IntStack.Push (S, I); | ||
15 | end loop; | ||
16 | while not IntStack.Empty (S) loop | ||
17 | Assert (IntStack.Pop (S, Val)); | ||
18 | Put_Line (Val'Image); | ||
19 | end loop; | ||
20 | end Main; | ||