wutka
December 9, 2022, 7:11pm
141
[wutka][9][SPARK]advent-of-code-2022-spark/day9.adb at d97c6701bf765d9f34413a40ea4f3d94f1bbc1ca · wutka/advent-of-code-2022-spark · GitHub
I initially got it working using a binary tree library I have been working on, but using a record as a key caused complaints from gnatprove, so I used a numeric key. Then I switched it over to using Formal_Ordered_Sets instead of the tree . I hadn’t used the formal containers before, so it’s good to get some experience with one.
JC001
December 10, 2022, 12:11am
142
jklmnn
December 10, 2022, 12:36am
143
[cantanima][10][Ada]Cathode Ray Tube
wutka
December 10, 2022, 3:56pm
149
[JeremyGrosser][10][Ada][advent/day10_2.adb at 3fbc4c2e69aba82c82456bab81933175dbe8a17e · JeremyGrosser/advent · GitHub ]
My solution is broken into a couple packages, as I suspect we’ll be expanding upon this one.
private with Chests.Stacks;
private with Screen;
with Advent_IO;
package Handheld is
type CPU is tagged private;
-- Reset CPU state
procedure Initialize
(This : in out CPU;
Input : not null Advent_IO.Stream_Access);
-- Fetch, Decode, Execute a single cycle
procedure Tick
(This : in out CPU);
private
package Integer_Stacks is new Chests.Stacks
This file has been truncated. show original
with Advent_IO; use Advent_IO;
with AnsiAda;
package body Screen is
procedure Initialize
(This : in out CRT)
is
begin
String'Write (Output, AnsiAda.Clear_Screen);
end Initialize;
procedure Update
(This : in out CRT;
Cycle : Positive;
X : Integer)
is
Raster_Start_Y : constant := 4;
Beam_X : constant Natural := (Cycle - 1) mod Width;
Beam_Y : constant Natural := ((Cycle - 1) / Width) mod Height;
This file has been truncated. show original
JC001
December 10, 2022, 10:14pm
153
rocher
December 10, 2022, 11:08pm
154
[rocher][10][Ada] Literate programming version of AoC 2022/10 using Ada/SPARK support for Emacs org-mode.
1 Like
[cantanima][11][Ada]Monkey in the middle
wutka
December 11, 2022, 5:25pm
158
rvlad13
December 11, 2022, 5:30pm
159
[rvlad13][5][Ada] GitHub - rvl13/Advent_of_code_2022_Ada
[rvlad13][6][Ada] same repo
RREE
December 11, 2022, 6:30pm
160