Data update

This commit is contained in:
Ingy döt Net 2026-02-01 16:33:20 -08:00
parent 5150844a7d
commit 4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions

View file

@ -1,28 +0,0 @@
-- Permutations by swapping
-- J. Carter 2024 Jun
-- Uses the PragmAda Reusable Components (https://github.com/jrcarter/PragmARC)
with Ada.Text_IO;
with PragmARC.Permutations;
procedure Permutations_By_Swapping is
package Permutations is new PragmARC.Permutations (Element => Positive);
Permutation : Permutations.Sequence_Lists.Vector;
begin -- Permutations_By_Swapping
Permutations.Generate (Initial => (1, 2, 3), Result => Permutation);
Output : for I in 1 .. Permutation.Last_Index loop
One_Permutation : declare
Sequence : Permutations.Sequence renames Permutation.Element (I);
begin -- One_Permutation
Ada.Text_IO.Put (Item => '(');
Print : for J in Sequence'Range loop
Ada.Text_IO.Put (Item => (if J > 1 then "," else "") & Sequence (J)'Image);
end loop Print;
Ada.Text_IO.Put_Line (Item => ") " & (if I rem 2 = 0 then '-' else '+') & '1');
end One_Permutation;
end loop Output;
end Permutations_By_Swapping;