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

⟦8b314f1b9⟧ TextFile

    Length: 2064 (0x810)
    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 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;