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

⟦e63074f9f⟧ TextFile

    Length: 1755 (0x6db)
    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

package body Histo is
    function Create_Histo return Object is
        Histo : Object := (others => 0);
    begin
        return Histo;
    end Create_Histo;


    procedure Destroy_Histo (Histo : in out Object) is
    begin
        Histo := (others => 0);
    end Destroy_Histo;


    function Get_Item_Occ
                (Item : in Discret; Histo : in Object) return Natural is
    begin
        return Histo (Item);
    end Get_Item_Occ;


    procedure Inc_Item_Occ (Item : in Discret; Histo : in out Object) is
    begin
        Histo (Item) := Histo (Item) + 1;
    end Inc_Item_Occ;


    procedure Dec_Item_Occ (Item : in Discret; Histo : in out Object) is
    begin
        if Histo (Item) > 0 then
            Histo (Item) := Histo (Item) - 1;
        end if;
    end Dec_Item_Occ;

    function Get_Max (Histo : Object) return Natural is
        I : Discret;
        Max : Natural;
    begin  
        for I in Discret'First .. Discret'Last loop
            if Max < Histo (I) then
                Max := Histo (I);
            end if;
        end loop;
        return Max;
    end Get_Max;

    procedure Put (Histo : Object) is
        Max, J : Natural := 0;
        I : Discret;

    begin
        Max := Get_Max (Histo);
        Text_Io.Put_Line ("Classe    Quantite    Histogramme");
        Text_Io.New_Line (2);
        for I in Discret'First .. Discret'Last loop
            Text_Io.Put (Discret'Image (I));
            Text_Io.Set_Col (13);
            Text_Io.Put (Natural'Image (Histo (I)));
            Text_Io.Set_Col (20);
            for J in 1 .. Natural (((80 - 20) * Histo (I)) / Max) loop
                Text_Io.Put ("#");
            end loop;
            Text_Io.New_Line (1);
        end loop;
    end Put;

end Histo;