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

⟦9e4ac5a63⟧ TextFile

    Length: 2113 (0x841)
    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

    Magic_Tab : array (Dimension, Dimension) of Token;
    X_Tab, Y_Tab : Integer;

    procedure Init_Magic_Tab is
        I, J : Integer;
    begin
        for I in Magic_Tab'Range (1) loop
            for J in Magic_Tab'Range (2) loop
                Magic_Tab (I, J) := 0;
            end loop;
        end loop;
    end Init_Magic_Tab;

    procedure Move (D : Direction) is
    begin  
        case D is
            when North =>
                Y_Tab := Y_Tab - 1;
            when East =>
                X_Tab := X_Tab + 1;
            when West =>
                X_Tab := X_Tab - 1;

        end case;
        Wrap;
    end Move;

    procedure Go_To_Center is
        Center : Integer;
    begin
        Center := (Dimension'Last / 2) + 1;
        X_Tab := Center;
        Y_Tab := Center;
    end Go_To_Center;

    procedure Deposit (T : Token) is
    begin
        Magic_Tab (Y_Tab, X_Tab) := T;
    end Deposit;


    function Cell_Busy return Boolean is
    begin
        if Magic_Tab (Y_Tab, X_Tab) /= 0 then
            return True;
        else
            return False;
        end if;
    end Cell_Busy;

    function Out_Of_Range (D : Direction) return Boolean is
    begin

        if Y_Tab >= 1 and X_Tab <= 5 and X_Tab >= 1 then
            return False;
        else
            return True;
        end if;
    end Out_Of_Range;

    procedure Wrap is  
    begin
        if Y_Tab = 0 then
            Y_Tab := Dimension'Last;
        else
            if X_Tab = 0 then
                X_Tab := Dimension'Last;
            else
                if X_Tab > 5 then
                    X_Tab := Dimension'First;
                end if;
            end if;
        end if;
    end Wrap;

    procedure Display_Square is
        package Io is new Text_Io.Integer_Io (Num => Token);
        I, J : Integer;
    begin
        for I in Magic_Tab'Range (1) loop
            for J in Magic_Tab'Range (2) loop
                Io.Put (Magic_Tab (I, J));
            end loop;
            Text_Io.New_Line;
        end loop;

    end Display_Square;
end Square;