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

⟦84c8ed23f⟧ Ada Source

    Length: 4096 (0x1000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Balls_Boxes_Stickers_Tests, seg_011e89

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 Expertsystem;
use Expertsystem;

with Ball, Box, Sticker;
use Ball, Box, Sticker;

package body Balls_Boxes_Stickers_Tests is

------------------------------------------------------------------------------
    function Pack_It_Test
                (Ba : Ball.Object; Bo : Box.Object; S : Sticker.Object)
                return Boolean is
    begin
        return Ball.Place (Ba) = Ball.Is_On_Heap and then
                  Ball.Size (Ba) <= Box.Max_Size and then
                  Box.State (Bo) = Box.Is_Empty and then
                  Box.Size (Bo) > Ball.Size (Ba) and then
                  Sticker.Colors'Image (Sticker.Color (S)) =
                     Ball.Colors'Image (Ball.Color (Ba)) and then
                  not Box.Exist (Between               => Ball.Size (Ba),
                                 And_Size              => Box.Size (Bo),
                                 In_Kind_Of_Collection => Empty_Boxes);
    end Pack_It_Test;

------------------------------------------------------------------------------

    function Sticker_Lack_Test (Ba : Ball.Object) return Boolean is
    begin
        return Ball.Place (Ba) = Ball.Is_On_Heap and then
                  Ball.Size (Ba) <= Box.Max_Size and then  
                  not Sticker.Exist (Ball.Colors'Image (Ball.Color (Ba)),
                                     In_Kind_Of_Collection => Unused_Stickers);
    end Sticker_Lack_Test;

------------------------------------------------------------------------------

    function Box_Lack_Test (Ba : Ball.Object) return Boolean is
        Ok : Boolean;
    begin
        return Ball.Place (Ba) = Ball.Is_On_Heap and then
                  Ball.Size (Ba) <= Box.Max_Size and then
                  not Box.Exist (Greater_Than          => Ball.Size (Ba),
                                 In_Kind_Of_Collection => Empty_Boxes);
    end Box_Lack_Test;

------------------------------------------------------------------------------

    function Too_Big_Test (Ba : Ball.Object) return Boolean is
    begin
        return Ball.Place (Ba) = Ball.Is_On_Heap and then
                  Ball.Size (Ba) > Box.Max_Size;
    end Too_Big_Test;

end Balls_Boxes_Stickers_Tests;

E3 Meta Data

    nblk1=3
    nid=0
    hdr6=6
        [0x00] rec0=1a rec1=00 rec2=01 rec3=01a
        [0x01] rec0=15 rec1=00 rec2=02 rec3=088
        [0x02] rec0=09 rec1=00 rec2=03 rec3=000
    tail 0x2170df00282466ccfb766 0x42a00088462063c03