DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦1c042a816⟧ Ada Source

    Length: 7168 (0x1c00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Square, seg_02f6f8

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦5a81ac88f⟧ »Space Info Vol 1« 
        └─⟦this⟧ 

E3 Source Code



with Text_Io;
package body Square is
    subtype Size is Natural range 1 .. 5;
    type Table is array (Size, Size) of Token;

    type Cell is
        record
            Line : Size;
            Column : Size;
        end record;

    Cursor : Cell;
    The_Table : Table;

    procedure Move (D : Direction) is
    begin
        case D is
            when North =>
                if Cursor.Line < Size'Last then
                    Cursor.Line := Size'Succ (Cursor.Line);
                else
                    Cursor.Line := Size'First;
                end if;
            when South =>
                if Cursor.Line > Size'First then
                    Cursor.Line := Size'Pred (Cursor.Line);
                else
                    Cursor.Line := Size'Last;
                end if;
            when East =>
                if Cursor.Column < Size'Last then
                    Cursor.Column := Size'Succ (Cursor.Column);
                else
                    Cursor.Column := Size'First;
                end if;
            when West =>
                if Cursor.Column > Size'First then
                    Cursor.Column := Size'Pred (Cursor.Column);
                else
                    Cursor.Column := Size'Last;
                end if;
        end case;
    end Move;

    procedure Go_To_Center is
    begin
        Cursor.Line := 3;
        Cursor.Column := 3;
    end Go_To_Center;

    procedure Deposit (T : Token) is
    begin
        The_Table (Cursor.Line, Cursor.Column) := T;
    end Deposit;

    function Cell_Busy return Boolean is
    begin
        return The_Table (Cursor.Line, Cursor.Column) > 0;
    end Cell_Busy;

    procedure Display is
        package Io is new Text_Io.Integer_Io (Token);
    begin
        for I in reverse Size loop
            for J in Size loop
                Io.Put (The_Table (I, J));
            end loop;
            Text_Io.New_Line;
        end loop;
    end Display;

begin
    for I in Size loop
        for J in Size loop
            The_Table (I, J) := 0;
        end loop;
    end loop;
end Square;

E3 Meta Data

    nblk1=6
    nid=4
    hdr6=6
        [0x00] rec0=22 rec1=00 rec2=01 rec3=024
        [0x01] rec0=23 rec1=00 rec2=03 rec3=028
        [0x02] rec0=0b rec1=00 rec2=02 rec3=000
        [0x03] rec0=0a rec1=00 rec2=04 rec3=000
        [0x04] rec0=80 rec1=00 rec2=00 rec3=100
        [0x05] rec0=42 rec1=46 rec2=3e rec3=3b3
    tail 0x215288da684906b81ccab 0x42a00088462060003
Free Block Chain:
  0x4: 0000  00 05 00 b7 80 06 20 6c 6f 6f 70 3b 06 00 10 20  ┆       loop;    ┆
  0x5: 0000  00 06 03 fc 80 1e 72 2e 43 6f 6c 75 6d 6e 20 3a  ┆      r.Column :┆
  0x6: 0000  00 00 00 0f 80 0c 20 20 20 20 20 20 20 43 75 72  ┆             Cur┆