|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 6144 (0x1800)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Magic, seg_0318ac
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦5a81ac88f⟧ »Space Info Vol 1«
└─⟦this⟧
with Text_Io;
package body Magic is
procedure Move (Dir : in Direction; Tab : in out Square) is
begin
case Dir is
when North =>
if Tab.A'First (1) = Tab.Current_Line then
Tab.Current_Line := Tab.A'Last (1);
else
Tab.Current_Line := Line'Pred (Tab.Current_Line);
end if;
when East =>
if Tab.Current_Row = Tab.A'Last (2) then
Tab.Current_Row := Tab.A'First (2);
else
Tab.Current_Row := Row'Succ (Tab.Current_Row);
end if;
when West =>
if Tab.Current_Row = Tab.A'First (2) then
Tab.Current_Row := Tab.A'Last (2);
else
Tab.Current_Row := Row'Pred (Tab.Current_Row);
end if;
end case;
end Move;
procedure Set (X : in Token; Tab : in out Square) is
begin
Tab.A (Tab.Current_Line, Tab.Current_Row) := X;
end Set;
function Full (Tab : in Square) return Boolean is
begin
return (Tab.A (Tab.Current_Line, Tab.Current_Row) > 0);
end Full;
procedure Display (Tab : in out Square) is
package Io is new Text_Io.Integer_Io (Token);
begin
Walking (Tab);
for I in Tab.A'Range (1) loop
for J in Tab.A'Range (2) loop
Io.Put (Tab.A (I, J));
end loop;
Text_Io.Put_Line ("");
end loop;
Text_Io.Put_Line ("");
end Display;
procedure Walking (Tab : in out Square) is
X : Token := 1;
begin
Tab.Current_Line := Tab.A'Last (1) / 2;
Tab.Current_Row := Tab.A'Last (2) / 2 + 1;
Set (X, Tab);
while X < Tab.A'Last (1) * Tab.A'Last (2) loop
while Full (Tab) loop
Move (East, Tab);
Move (North, Tab);
if Full (Tab) then
Move (West, Tab);
Move (North, Tab);
end if;
end loop;
X := X + 1;
Set (X, Tab);
end loop;
end Walking;
procedure Blanking (Tab : in out Square) is
begin
for I in Tab.A'Range (1) loop
for J in Tab.A'Range (2) loop
Tab.Current_Line := I;
Tab.Current_Row := J;
Set (0, Tab);
end loop;
end loop;
end Blanking;
end Magic;
nblk1=5
nid=5
hdr6=6
[0x00] rec0=26 rec1=00 rec2=01 rec3=01a
[0x01] rec0=2d rec1=00 rec2=04 rec3=016
[0x02] rec0=1f rec1=00 rec2=02 rec3=000
[0x03] rec0=08 rec1=00 rec2=05 rec3=000
[0x04] rec0=08 rec1=00 rec2=05 rec3=000
tail 0x2152a1b8284be75f6bd43 0x42a00088462060003
Free Block Chain:
0x5: 0000 00 03 00 84 80 0b 74 5f 52 6f 77 20 3a 3d 20 4a ┆ t_Row := J┆
0x3: 0000 00 00 00 04 80 01 72 01 02 03 30 2c 20 54 61 62 ┆ r 0, Tab┆