|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: B T
Length: 7498 (0x1d4a)
Types: TextFile
Names: »B«
└─⟦149519bd4⟧ Bits:30000546 8mm tape, Rational 1000, !projects 93-07-13
└─⟦124ff5788⟧ »DATA«
└─⟦this⟧
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
└─⟦129cab021⟧ »DATA«
└─⟦this⟧
└─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16
└─⟦6f12a12be⟧ »DATA«
└─⟦this⟧
└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
└─⟦d65440be7⟧ »DATA«
└─⟦this⟧
--=========================================
with Expertsystem;
use Expertsystem;
with Ne_Robot, Ne_Brique;
use Ne_Robot, Ne_Brique;
procedure Ne_Mise_En_Casier is
package Robotetbrique is
procedure Miseenboite;
end Robotetbrique;
package body Robotetbrique is
A_Brick, A_Robot : Expertsystem.Reference;
function Peutmettreenboite return Boolean is
begin
Reglesaisir:
declare
function Robot_Match (R : Reference) return Boolean is
begin
return Peutprendre (R) and then not Tientbrique (R);
end Robot_Match;
function Brick_Match (B : Reference) return Boolean is
begin
return Surtas (B) and then Laplusgrandedutas (B);
end Brick_Match;
function Robot_Ok is
new Expertsystem.Collection.Findone (Robot_Match);
function Brick_Ok is
new Expertsystem.Collection.Findone (Brick_Match);
begin
A_Brick := Brick_Ok (Ne_Brique.All_Bricks);
A_Robot := Robot_Ok (Ne_Robot.All_Robots);
if Expertsystem.Collection.Isnotnull (A_Robot) and
Expertsystem.Collection.Isnotnull (A_Brick) then
Ne_Robot.Modifierpince (A_Robot, True);
Ne_Brique.Modifierlieu (A_Brick, Pince);
Put ("Le ");
Put (Ne_Robot.Nom (A_Robot));
Put (" prend la plus grande brique (taille=");
Put (Integer (Ne_Brique.Taille (A_Brick)));
Put_Line (") du tas dans sa pince ");
return True;
end if;
end Reglesaisir;
---------------------
Regletenir:
declare
function Robot_Match (R : Reference) return Boolean is
begin
return Peutprendre (R) and then Tientbrique (R) and then
Un_Plus_Ancien_Robot (R);
end Robot_Match;
function Brick_Match (B : Reference) return Boolean is
begin
return Danspince (B);
end Brick_Match;
function Robot_Ok is
new Expertsystem.Collection.Findone (Robot_Match);
function Brick_Ok is
new Expertsystem.Collection.Findone (Brick_Match);
begin
A_Brick := Brick_Ok (Ne_Brique.All_Bricks);
A_Robot := Robot_Ok (Ne_Robot.All_Robots);
if Expertsystem.Collection.Isnotnull (A_Robot) and
Expertsystem.Collection.Isnotnull (A_Brick) then
Ne_Robot.Modifiertache (A_Robot, Deposer);
Ne_Robot.Modifieranc (A_Robot, Ne_Robot.Anciennete);
Put ("Le ");
Put (Ne_Robot.Nom (A_Robot));
Put_Line (" va deposer la brique");
return True;
end if;
end Regletenir;
---------------------------------
Reglecaser:
declare
Rb : Tuple.Object;
Unebrique, Unrobot : Reference;
function Robot_Match (R : Reference) return Boolean is
begin
return Peutdeposer (R) and then
Un_Plus_Ancien_Robot (R);
end Robot_Match;
function Brick_Match (B : Reference) return Boolean is
begin
return Danspince (B);
end Brick_Match;
function Robot_Ok is
new Expertsystem.Collection.Findone (Robot_Match);
function Brick_Ok is
new Expertsystem.Collection.Findone (Brick_Match);
begin
A_Brick := Brick_Ok (Ne_Brique.All_Bricks);
A_Robot := Robot_Ok (Ne_Robot.All_Robots);
if Expertsystem.Collection.Isnotnull (A_Robot) and
Expertsystem.Collection.Isnotnull (A_Brick) then
Ne_Brique.Modifierlieu (A_Brick, Boite);
Ne_Robot.Modifiertache (A_Robot, Prendre);
Ne_Robot.Modifierboite (A_Robot,
Ne_Robot.Derniereboite);
Ne_Brique.Modifierboite
(A_Brick, Ne_Robot.Numeroboite (A_Robot));
Ne_Robot.Modifieranc (A_Robot, Ne_Robot.Anciennete);
Put ("Le ");
Put (Ne_Robot.Nom (A_Robot));
Put (" depose la brique dans la case");
Put (Integer (Ne_Robot.Numeroboite (A_Robot)));
Put_Line ("");
Ne_Robot.Modifierpince (A_Robot, False);
return True;
end if;
end Reglecaser;
------------------------------------
Reglearreter:
declare
Rb : Tuple.Object;
Unrobot : Reference;
function Robot_Match (R : Reference) return Boolean is
begin
return Peutprendre (R) and then not Tientbrique (R);
end Robot_Match;
function Brick_Match (B : Reference) return Boolean is
begin
return not Surtas (B);
end Brick_Match;
function Robot_Ok is
new Expertsystem.Collection.Findone (Robot_Match);
function Brick_Ok is
new Expertsystem.Collection.Findone (Brick_Match);
begin
A_Brick := Brick_Ok (Ne_Brique.All_Bricks);
A_Robot := Robot_Ok (Ne_Robot.All_Robots);
if Expertsystem.Collection.Isnotnull (A_Robot) and
Expertsystem.Collection.Isnotnull (A_Brick) then
Put ("Le ");
Put (Ne_Robot.Nom (A_Robot));
Put_Line (" se suicide (plus de briques)");
Ne_Robot.Sesuicide (A_Robot);
return True;
end if;
end Reglearreter;
------------------------------------
return False;
end Peutmettreenboite;
procedure Mettreenboite is
begin
loop
exit when not Peutmettreenboite;
end loop;
end Mettreenboite;
procedure Miseenboite is
begin
Ne_Robot.Creer;
Ne_Brique.Creer;
loop
Mettreenboite;
-- autres contextes a traiter
exit;
end loop;
end Miseenboite;
end Robotetbrique;
begin
Robotetbrique.Miseenboite;
end Ne_Mise_En_Casier;