Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
with Ada.Text_IO; use Ada.Text_IO;
procedure Counter is
Count : Integer := 0;
Is_Dark : Boolean := False;
procedure Update_UI is
begin
Put_Line("Counter: " & Integer'Image(Count));
Put_Line("Theme: " & (if Is_Dark then "Dark" else "Light"));
end Update_UI;
begin
-- Initial display
Update_UI;
-- Increment counter
Count := Count + 1;
Update_UI;
-- Increment counter again
Count := Count + 1;
Update_UI;
-- Toggle theme
Is_Dark := not Is_Dark;
Update_UI;
-- Decrement counter
Count := Count - 1;
Update_UI;
-- Reset counter
Count := 0;
Update_UI;
end Counter;Coding works best on desktop or with an external keyboard.