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

⟦f3f9d4fea⟧ Ada Source

    Length: 3072 (0xc00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Square, seg_03e7d1

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
    procedure Display_Square is
        package My_Int is new Text_Io.Integer_Io (Num => Token);
    begin
        Text_Io.Put_Line ("Magic Square started ...");
        Text_Io.Put_Line ("");
        for J in Square_Large loop
            for I in Square_Large loop
                if I = 1 then
                    Text_Io.Put ("|");
                end if;
                My_Int.Put (Magic (I, J));
                Text_Io.Put ("|");
            end loop;
            Text_Io.Put_Line ("");
        end loop;
    end Display_Square;


    procedure Clear_My_Square is
    begin  
        for I in Square_Large loop
            for J in Square_Large loop
                Magic (I, J) := Token'First;
            end loop;
        end loop;
    end Clear_My_Square;

    procedure Move (D : Direction) is
    begin
        case D is
            when North =>
                Y := Y - 1;
            when South =>
                Y := Y + 1;
            when East =>
                X := X + 1;
            when West =>
                X := X - 1;
        end case;

    end Move;

    procedure Go_To_Center is
    begin
        X := (Large / 2) + 1;
        Y := X;
    end Go_To_Center;

    procedure Deposit (T : Token) is
    begin
        Magic (X, Y) := T;
    end Deposit;

    function Get_Token return Token is
    begin
        return Magic (X, Y);
    end Get_Token;

    procedure Wrap_If_Edge is
    begin  
        if X > Square_Large'Last then
            X := Square_Large'First;
        end if;

        if X < Square_Large'First then
            X := Square_Large'Last;
        end if;

        if Y > Magic'Last then
            Y := Magic'First;
        end if;

        if Y < Square_Large'First then
            Y := Square_Large'Last;
        end if;
    end Wrap_If_Edge;
end Square;

E3 Meta Data

    nblk1=2
    nid=0
    hdr6=4
        [0x00] rec0=24 rec1=00 rec2=01 rec3=028
        [0x01] rec0=2d rec1=00 rec2=02 rec3=001
    tail 0x21537819e860084dacefb 0x42a00088462060003