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 - metrics - download
Index: B T

⟦01b82a182⟧ TextFile

    Length: 1632 (0x660)
    Types: TextFile
    Names: »B«

Derivation

└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
    └─⟦5cb1d1d7f⟧ »DATA« 
        └─⟦3b1ee7bd8⟧ 
            └─⟦this⟧ 

TextFile

with Io;
package body Square is
    -- definition of the actual 'checker-board'
    subtype Edge is Natural range 0 .. Size - 1;
    Board : array (Edge, Edge) of Natural := (others => (others => 0));
    -- position of the cursor
    X, Y : Edge := Size / 2;

    procedure Go_To_Center is
    begin
        X := Size / 2;
        Y := Size / 2;
    end Go_To_Center;

    procedure Go (Which_Direction : in Direction) is
    begin
        case Which_Direction is

            when North =>
                Y := (Y + 1) mod Size;
            when South =>
                Y := (Y - 1) mod Size;
            when East =>
                X := (X + 1) mod Size;
            when West =>
                X := (X - 1) mod Size;
            when North_East =>
                Go (North);
                Go (East);
            when South_East =>
                Go (South);
                Go (East);
            when North_West =>
                Go (North);
                Go (West);
            when South_West =>
                Go (South);
                Go (West);
        end case;
    end Go;
    function Is_Already_Occupied return Boolean is
    begin
        return Board (X, Y) > 0;
    end Is_Already_Occupied;

    procedure Deposit (Token : Positive) is
    begin
        Board (X, Y) := Token;
    end Deposit;

    procedure Display is
    begin
        for Y in reverse Edge loop
            for X in Edge loop
                Io.Put (Board (X, Y), Width => 3);
            end loop;  
            Io.New_Line;
        end loop;
    end Display;
    procedure Toto is
    begin
        null;
    end Toto;
end Square;