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

⟦93faccad0⟧ TextFile

    Length: 2728 (0xaa8)
    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⟧ 
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦e24fb53b7⟧ 
            └─⟦this⟧ 

TextFile

separate (Towers_Of_Hanoi_Rules_For_Graphic)
package body Moving_Guru_Rule is

    function Premiss return Fact_Queries is
        The_Priority    : constant Alias.Name := Alias.P;
        The_Source      : constant Alias.Name := Alias.S;
        The_Destination : constant Alias.Name := Alias.D;
        The_Level       : constant Alias.Name := Alias.L;
    begin
        return (Movements.Exist ((Count      => Is_Equal (1),
                                  Priority   => Define_As (The_Priority),
                                  From_Tower => Define_As (The_Source),
                                  To_Tower   => Define_As (The_Destination))),

                Towers.Exist ((Location   => Is_Equal (The_Source),
                               Disk_Count => Is_Greater (0) and
                                                Define_As (The_Level))),

                Towers.Exist ((Location   => Is_Equal (The_Destination),
                               Disk_Count => Is_Any)),

                Disks.Exist ((Tower => Is_Equal (The_Source),
                              Level => Is_Equal (The_Level),
                              Size  => Is_Any)),

                Movements.Absent ((Priority => Is_Greater (The_Priority),
                                   From_Tower | To_Tower | Count => Is_Any)));
    end Premiss;

    procedure Action (The_Facts : Fact_Collection) is
        The_Movement             : Fact_Name renames The_Facts (1);  
        The_Source               : Fact_Name renames The_Facts (2);  
        The_Destination          : Fact_Name renames The_Facts (3);  
        The_Disk                 : Fact_Name renames The_Facts (4);
        The_Disk_Count           : Natural;
        The_Destination_Location : Natural;
    begin
        The_Disk_Count := Towers.Get (The_Source, Disk_Count);
        Towers.Change (The_Source, Disk_Count, The_Disk_Count - 1);
        Delete_Disk (For_Needle => Towers.Get (The_Source, Location),
                     The_Disk   => Disks.Get (The_Disk, Level),
                     Its_Size   => Disks.Get (The_Disk, Size));

        The_Disk_Count := Towers.Get (The_Destination, Disk_Count);
        Towers.Change (The_Destination, Disk_Count, The_Disk_Count + 1);
        Print_Disk (For_Needle => Towers.Get (The_Destination, Location),
                    The_Disk   => The_Disk_Count + 1,
                    Its_Size   => Disks.Get (The_Disk, Size));

        The_Destination_Location := Towers.Get (The_Destination, Location);
        Disks.Change (The_Disk, Tower, The_Destination_Location);
        Disks.Change (The_Disk, Level, The_Disk_Count + 1);

        Movements.Delete (The_Movement);
        delay 0.5;

    end Action;

end Moving_Guru_Rule;