From 727e3c59346da4f91284b34b4c18f2e0ba155e53 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Sat, 9 Aug 2025 16:03:28 +0200 Subject: Initial commit --- stack/src/main.adb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 stack/src/main.adb (limited to 'stack/src/main.adb') 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 @@ +with Ada.Assertions; use Ada.Assertions; +with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; +with Ada.Text_IO; use Ada.Text_IO; + +with Stack; + +procedure Main is + package IntStack is new Stack (Integer); + S : IntStack.Stack; + Val : Integer; +begin + Put_Line ("Hello world!"); + for I in 1 .. 5 loop + IntStack.Push (S, I); + end loop; + while not IntStack.Empty (S) loop + Assert (IntStack.Pop (S, Val)); + Put_Line (Val'Image); + end loop; +end Main; -- cgit v1.2.3