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

⟦0b7ed69e6⟧ Ada Source

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

Derivation

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

E3 Source Code



with Text_Io;

package body Square is
    procedure Move (D : Direction) is
    begin
        case D is
            when North =>
                I := I - 1;
                if I = 0 then
                    I := N;
                end if;
            when South =>
                I := I + 1;
                if I = N + 1 then
                    I := 1;
                end if;
            when East =>
                J := J + 1;
                if J = N + 1 then
                    J := 1;
                end if;
            when West =>
                J := J - 1;
                if J = 0 then
                    J := N;
                end if;
        end case;

    end Move;


    procedure Go_To_Center is
    begin
        I := (N + 1) / 2;
        J := (N + 1) / 2;

    end Go_To_Center;


    procedure Deposit (T : Token) is
    begin
        Magic_Board (I, J) := T;

    end Deposit;


    function Is_Busy return Boolean is

        Occ : Boolean;

    begin
        if (Magic_Board (I, J) = 0) then
            Occ := False;
        else
            Occ := True;
        end if;
        return Occ;

    end Is_Busy;

    procedure Displ_Square is
        package My_Int is new Text_Io.Integer_Io (Num => Token);
    begin
        for A in 1 .. N loop
            for B in 1 .. N loop
                My_Int.Put (Magic_Board (A, B));
            end loop;
            Text_Io.Put_Line (" ");
        end loop;
    end Displ_Square;
end Square;

E3 Meta Data

    nblk1=2
    nid=0
    hdr6=4
        [0x00] rec0=30 rec1=00 rec2=01 rec3=020
        [0x01] rec0=19 rec1=00 rec2=02 rec3=001
    tail 0x2173dc5f886005895fe96 0x42a00088462060003