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,11 +0,0 @@
package Pascal is
type Row is array (Natural range <>) of Natural;
function Length(R: Row) return Positive;
function First_Row(Max_Length: Positive) return Row;
function Next_Row(R: Row) return Row;
end Pascal;

View file

@ -1,26 +0,0 @@
package body Pascal is
function First_Row(Max_Length: Positive) return Row is
R: Row(0 .. Max_Length) := (0 | 1 => 1, others => 0);
begin
return R;
end First_Row;
function Next_Row(R: Row) return Row is
S: Row(R'Range);
begin
S(0) := Length(R)+1;
S(Length(S)) := 1;
for J in reverse 2 .. Length(R) loop
S(J) := R(J)+R(J-1);
end loop;
S(1) := 1;
return S;
end Next_Row;
function Length(R: Row) return Positive is
begin
return R(0);
end Length;
end Pascal;

View file

@ -1,18 +0,0 @@
with Ada.Text_IO, Ada.Integer_Text_IO, Ada.Command_Line, Pascal; use Pascal;
procedure Triangle is
Number_Of_Rows: Positive := Integer'Value(Ada.Command_Line.Argument(1));
Row: Pascal.Row := First_Row(Number_Of_Rows);
begin
loop
-- print one row
for J in 1 .. Length(Row) loop
Ada.Integer_Text_IO.Put(Row(J), 5);
end loop;
Ada.Text_IO.New_Line;
exit when Length(Row) >= Number_Of_Rows;
Row := Next_Row(Row);
end loop;
end Triangle;