DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

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 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦a657e594c⟧ TextFile

    Length: 1763 (0x6e3)
    Types: TextFile
    Names: »B«

Derivation

└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 
└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
    └─ ⟦d65440be7⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with Text_Io;
package body Magic 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 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;
begin
    for I in Square_Large loop
        for J in Square_Large loop
            Magic (I, J) := Token'First;
        end loop;
    end loop;



end Magic;