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

⟦4e55e2f69⟧ Ada Source

    Length: 5120 (0x1400)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Ne_Balls_Boxes_Stickers_Actions, seg_010452

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 Text_Io;
with Tuple;

with Ball, Box, Sticker;

package body Ne_Balls_Boxes_Stickers_Actions is
    procedure Pack_It_Action (The_Tuple : Tuple.Object) is
        A_Ball    : Ball.Object;
        A_Box     : Box.Object;
        A_Sticker : Sticker.Object;
    begin  
        Tuple.Split (The_Tuple, A_Ball, A_Box, A_Sticker);
        Ball.Change (A_Ball, With_Place => Ball.Is_In_Box);
        Box.Change (A_Box, With_State => Box.Is_Full);
        Sticker.Change (A_Sticker, With_State => Sticker.Is_Used);
        Text_Io.Put_Line ("Rule PACK_IT : ball (" &
                          Ball.Colors'Image (Ball.Color (A_Ball)) & "/" &
                          Natural'Image (Ball.Size (A_Ball)) & ") in box (" &
                          Natural'Image (Box.Size (A_Box)) & ")");
    end Pack_It_Action;


    procedure Sticker_Lack_Action (The_Tuple : Tuple.Object) is
        A_Ball : Ball.Object;
    begin
        Tuple.Split (The_Tuple, A_Ball);
        Ball.Change (A_Ball, With_Place => Ball.Is_In_Box);
        Text_Io.Put_Line
           ("Rule STICKER_LACK : there are no stickers left with color " &
            Ball.Colors'Image (Ball.Color (A_Ball)));
    end Sticker_Lack_Action;


    procedure Box_Lack_Action (The_Tuple : Tuple.Object) is
        A_Ball : Ball.Object;
    begin
        Tuple.Split (The_Tuple, A_Ball);
        Ball.Change (A_Ball, With_Place => Ball.Is_In_Box);
        Text_Io.Put_Line
           ("Rule BOX_LACK : there are no boxes left with size greater then " &
            Natural'Image (Ball.Size (A_Ball)));
    end Box_Lack_Action;


    procedure Too_Big_Action (The_Tuple : Tuple.Object) is
        A_Ball : Ball.Object;
    begin
        Tuple.Split (The_Tuple, A_Ball);
        Ball.Change (A_Ball, With_Place => Ball.Is_In_Box);
        Text_Io.Put_Line ("Rule TOO_BIG : the " &
                          Ball.Colors'Image (Ball.Color (A_Ball)) &
                          " ball with size " &
                          Natural'Image (Ball.Size (A_Ball)) & " is too BIG");
    end Too_Big_Action;

end Ne_Balls_Boxes_Stickers_Actions;

E3 Meta Data

    nblk1=4
    nid=0
    hdr6=8
        [0x00] rec0=1c rec1=00 rec2=01 rec3=00c
        [0x01] rec0=00 rec1=00 rec2=02 rec3=006
        [0x02] rec0=19 rec1=00 rec2=04 rec3=03e
        [0x03] rec0=05 rec1=00 rec2=03 rec3=000
    tail 0x2170c0830822c82294328 0x42a00088462063c03