DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

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

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦d399b16ce⟧ Ada Source

    Length: 6144 (0x1800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Fractales, seg_030530

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



with Elementary_Functions;
with Easy_X;
with Graphiques;  
with Text_Io;

package body Fractales is
    procedure Croissance (Chaine : in String; Nb_Iterations : in Integer) is
    begin
        null;
    end Croissance;
    procedure Affichage (Chaine : in String;
                         X_Min : in Integer;
                         Y_Min : in Integer;
                         Facteur : in Float) is
        X_Utilisateur, Y_Utilisateur : Integer;
        Delta_X : Integer := 100;
        Delta_Y : Integer := 100;
        Alpha : Float := 0.0;
        Angle : constant := 60.0;
        X : Float := 0.0;  
        Y : Float := 0.0;
        Pi : constant := 3.1415;
    begin
        X_Utilisateur := Delta_X - Integer (Facteur * Float (X_Min));
        Y_Utilisateur := Delta_Y - Integer (Facteur * Float (Y_Min));
        for I in Chaine'Range loop
            Text_Io.Put (Chaine (I));

            if (Chaine (I) = 'A') then
                X := X + 2.0 * Elementary_Functions.Cos (Alpha / 180.0 * Pi);
                Y := Y + Elementary_Functions.Sin (Alpha / 180.0 * Pi);
            end if;
            if (Chaine (I) = '+') then
                Alpha := Alpha + Angle;
            end if;
            if (Chaine (I) = '-') then
                Alpha := Alpha - Angle;
            end if;
            Graphiques.Move (X_Utilisateur, Y_Utilisateur);
            X_Utilisateur := Delta_X - Integer (Facteur * (X - Float (X_Min)));
            Y_Utilisateur := Delta_Y - Integer (Facteur * (Y - Float (Y_Min)));
            Graphiques.Draw (X_Utilisateur, Y_Utilisateur);
        end loop;
    end Affichage;
    procedure Echelle (Chaine : in String;
                       X_Min : in out Integer;
                       Y_Min : in out Integer;
                       Facteur : in out Float) is
        X_Utilisateur, Y_Utilisateur : Integer;
        Delta_X, Delta_Y : Integer;
        Alpha : Float := 0.0;
        Angle : constant := 60.0;       X_Max : Integer := -200;
        Y_Max : Integer := -200;
        X : Float := 0.0;
        Y : Float := 0.0;
        Pi : constant := 3.1415;
    begin
        for I in Chaine'Range loop
            Text_Io.Put (Chaine (I));

            if (Chaine (I) = 'A') then
                X := X + 2.0 * Elementary_Functions.Cos (Alpha / 180.0 * Pi);
                Y := Y + Elementary_Functions.Sin (Alpha / 180.0 * Pi);
            end if;
            if (Chaine (I) = '+') then
                Alpha := Alpha + Angle;
            end if;
            if (Chaine (I) = '-') then
                Alpha := Alpha - Angle;
            end if;

            if (Integer (X) < X_Min) then
                X_Min := Integer (X);
            end if;
            if (Integer (X) > X_Max) then
                X_Max := Integer (X);
            end if;
            if (Integer (Y) < Y_Min) then
                Y_Min := Integer (Y);
            end if;
            if (Integer (Y) > Y_Max) then
                Y_Max := Integer (Y);
            end if;
        end loop;  
        Facteur := 500.0 / Float (Y_Max - Y_Min);
    end Echelle;
    procedure Dessin is
        Display : String (1 .. 4) := "arum";
        Chaine : String (1 .. 128) :=
           "A-A++A-A-A-A++A-A++A-A++A-A-A-A++A-A++A-A++A-A-A-A++A-A++A-A++A-A-A-A++A-A++A-A++A-A-A-A++A-A++A-A++A-A-A-A++A-A";
        Facteur : Float := 10.0;
        X_Min : Integer := 200;
        Y_Min : Integer := 200;

    begin
        Easy_X.Open (Display, "Fenetre", 0, 0, 1000, 1000);

        loop
            Text_Io.Put (Chaine);
            Text_Io.New_Line;
            Echelle (Chaine, X_Min, Y_Min, Facteur);
            Affichage (Chaine, X_Min, Y_Min, Facteur);
            Text_Io.New_Line;
        end loop;

        Easy_X.Close;
    end Dessin;
end Fractales;


E3 Meta Data

    nblk1=5
    nid=0
    hdr6=a
        [0x00] rec0=1f rec1=00 rec2=01 rec3=02c
        [0x01] rec0=00 rec1=00 rec2=04 rec3=038
        [0x02] rec0=17 rec1=00 rec2=05 rec3=002
        [0x03] rec0=1d rec1=00 rec2=03 rec3=022
        [0x04] rec0=1d rec1=00 rec2=02 rec3=000
    tail 0x21729c4d4849b92009781 0x42a00088462060003