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

⟦fb4312f45⟧ Ada Source

    Length: 5120 (0x1400)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, procedure Towers_Of_Hanoi_Graphic_Solution, seg_02a270, seg_02a473

Derivation

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

E3 Source Code



with Fact;
with Towers_Of_Hanoi_Frames;
with Towers_Of_Hanoi_Graphic;
with Towers_Of_Hanoi_Rule_Base;
with Towers_Of_Hanoi_Rules_For_Graphic;
with Text_Io;

use Fact;
use Towers_Of_Hanoi_Frames;

procedure Towers_Of_Hanoi_Graphic_Solution is

    Initial_Tower_Size : constant := 10;
    Initial_Priority   : constant := 1;
    Disk_Size          : Natural;
    function Firable_On_Facts return Fact.Collection
        renames Towers_Of_Hanoi_Rule_Base.Rule_Base.Firable_On_Facts;

    function Firable_On_Rule return Towers_Of_Hanoi_Rule_Base.Rule_Base.Rule_Id
        renames Towers_Of_Hanoi_Rule_Base.Rule_Base.Firable_On_Rule;

    package Toh_Rules renames Towers_Of_Hanoi_Rules_For_Graphic;

begin

    Towers.Add ((Location => 1, Disk_Count => Initial_Tower_Size));
    Towers.Add ((Location => 2, Disk_Count => 0));
    Towers.Add ((Location => 3, Disk_Count => 0));

    for I in 1 .. Initial_Tower_Size loop
        Disk_Size := 12 - I;
        Disks.Add ((Tower => 1, Level => I, Size => Disk_Size));
        Towers_Of_Hanoi_Graphic.Print_Disk (1, I, Disk_Size);
    end loop;

    Movements.Add ((From_Tower => 1,
                    To_Tower   => 3,
                    Count      => Initial_Tower_Size,
                    Priority   => Initial_Priority));

    for I in 1 .. 3 loop
        Towers_Of_Hanoi_Graphic.Print_Needle (I, Height => 15);
    end loop;

    delay 1.5;

    loop
        declare
            Result : constant Fact.Collection := Firable_On_Facts;
        begin
            exit when Result = Empty_Collection;
            Toh_Rules.Do_Action (For_Rule => Firable_On_Rule,  
                                 On_Facts => Result);
        end;
    end loop;

end Towers_Of_Hanoi_Graphic_Solution;

E3 Meta Data

    nblk1=4
    nid=3
    hdr6=4
        [0x00] rec0=21 rec1=00 rec2=01 rec3=00a
        [0x01] rec0=1a rec1=00 rec2=02 rec3=001
        [0x02] rec0=0a rec1=00 rec2=00 rec3=004
        [0x03] rec0=02 rec1=23 rec2=6e rec3=142
    tail 0x21522588083e24cf6487d 0x42a00088462063c03
Free Block Chain:
  0x3: 0000  00 04 03 fc 80 06 43 6c 6f 63 6b 3b 06 00 00 00  ┆      Clock;    ┆
  0x4: 0000  00 00 00 0d 80 0a 20 43 61 6c 65 6e 64 61 72 2e  ┆       Calendar.┆