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

⟦01c01452e⟧ TextFile

    Length: 2411 (0x96b)
    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 Move_To (Carre : in out Square; D : in Direction) is
    begin
        case D is
            when West =>
                if Carre.Colonne > Carre.Matrice'First (2) then
                    Carre.Colonne := Column'Pred (Carre.Colonne);
                else
                    Carre.Colonne := Carre.Matrice'Last (2);
                end if;
            when East =>
                if Carre.Colonne < Carre.Matrice'Last (2) then
                    Carre.Colonne := Column'Succ (Carre.Colonne);
                else
                    Carre.Colonne := Carre.Matrice'First;
                end if;
            when South =>
                if Carre.Ligne < Carre.Matrice'Last (1) then
                    Carre.Ligne := Row'Succ (Carre.Ligne);
                else
                    Carre.Ligne := Carre.Matrice'First (1);
                end if;
            when North =>
                if Carre.Ligne > Carre.Matrice'First (1) then
                    Carre.Ligne := Row'Pred (Carre.Ligne);
                else
                    Carre.Ligne := Carre.Matrice'Last (1);
                end if;
        end case;
    end Move_To;

    procedure Go_To_Center (Carre : in out Square) is
    begin
        Carre.Ligne := Carre.O / 2 + 1;
        Carre.Colonne := Carre.O / 2 + 1;
    end Go_To_Center;

    procedure Deposit (Carre : in out Square; T : in Token) is
    begin
        Carre.Matrice (Carre.Ligne, Carre.Colonne) := T;
    end Deposit;

    function Cell_Empty (Carre : in Square) return Boolean is
    begin
        return Carre.Matrice (Carre.Ligne, Carre.Colonne) = 0;
    end Cell_Empty;

    procedure Display (Carre : in Square) is
    begin
        for I in Carre.Matrice'Range (1) loop
            for J in Carre.Matrice'Range (2) loop
                Text_Io.Put (Positive'Image (Carre.Matrice (I, J)));
            end loop;
            Text_Io.New_Line;
        end loop;
    end Display;
    procedure Johnson (Carre : in out Square) is
    begin
        for I in Carre.Matrice'Range (1) loop
            for J in Carre.Matrice'Range (2) loop
                Carre.Matrice (I, J) := 0;
            end loop;
        end loop;
    end Johnson;  
    function Get_Size return Ordre is
        O : Ordre;
        Dummy : Integer;
    begin
        Text_Io.Get (Dummy);
        O := Dummy;
        return O;
    end Get_Size;
end Magic;