|
|
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: 5120 (0x1400)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Square, seg_02f4ce
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦cfc2e13cd⟧ »Space Info Vol 2«
└─⟦this⟧
with Text_Io;
package body Square is
package Int_Io is new Text_Io.Integer_Io (Num => Token);
X, Y : Integer;
Square : array (1 .. Size, 1 .. Size) of Token;
procedure Go_To_Center is
begin
X := (Size / 2) + 1;
Y := (Size / 2) + 1;
Move (North);
end Go_To_Center;
procedure Deposit (T : Token) is
begin
Square (X, Y) := T;
end Deposit;
procedure Set_X (A : Integer) is
begin
X := A;
end Set_X;
procedure Set_Y (O : Integer) is
begin
Y := O;
end Set_Y;
procedure Move (D : Direction) is
begin
case D is
when North =>
begin
Y := Y - 1;
if (Y = 0) then
Y := Size;
end if;
end;
when South =>
begin
Y := Y + 1;
if (Y > Size) then
Y := 1;
end if;
end;
when East =>
begin
X := X + 1;
if (X > Size) then
X := 1;
end if;
end;
when West =>
begin
X := X - 1;
if (X = 0) then
X := Size;
end if;
end;
end case;
end Move;
function Get_Token return Token is
begin
return (Square (X, Y));
end Get_Token;
procedure Display is
begin
for I in 1 .. Size loop
Set_Y (O => I);
for J in 1 .. Size loop
Set_X (A => J);
Int_Io.Put (Get_Token);
Text_Io.Put ('|');
end loop;
Text_Io.Put_Line ("");
end loop;
end Display;
begin
for I in 1 .. Size loop
for J in 1 .. Size loop
Square (I, J) := Token (0);
end loop;
end loop;
end Square;
nblk1=4
nid=3
hdr6=6
[0x00] rec0=26 rec1=00 rec2=01 rec3=034
[0x01] rec0=25 rec1=00 rec2=04 rec3=024
[0x02] rec0=19 rec1=00 rec2=02 rec3=000
[0x03] rec0=11 rec1=00 rec2=02 rec3=000
tail 0x217283032848d785bd4ff 0x42a00088462060003
Free Block Chain:
0x3: 0000 00 00 00 a4 80 07 3d 20 53 69 7a 65 3b 07 00 1b ┆ = Size; ┆