|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 7168 (0x1c00)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Asteroide, seg_059c3d
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦cfc2e13cd⟧ »Space Info Vol 2«
└─⟦this⟧
with Definitions;
use Definitions;
with Text_Io;
with Serveur;
with Trajectoire;
with Imprimeur;
with Random;
package body Asteroide is
Nb_Ast : Natural := 0;
procedure Deplacer (Ast : in out Objet) is
begin
Ast.Deplacer;
end Deplacer;
procedure Initialise (--Ast : in out Objet;
Pos : out Definitions.Position;
Le_Cap : out Definitions.Cap) is
T : Random.Longint;
begin
T := Random.Randomint (Definitions.Cap'Pos (Definitions.Cap'Last));
Le_Cap := Definitions.Cap'Val (T);
T := Random.Randomint (Definitions.Max_Colonnes);
Pos.Colonne := T;
T := Random.Randomint (Definitions.Max_Lignes - 1);
Pos.Ligne := T;
--Text_Io.Put_Line ("je suis dans initialise et mon numero est :" & Integer'Image(Num));
end Initialise;
procedure Changer_Position (--Ast: in out Objet;
Pos : in out Definitions.Position;
Le_Cap : in out Definitions.Cap) is
begin
Trajectoire.Suivre_Cap (Pos, Le_Cap);
end Changer_Position;
procedure Detruire (Ast : in out Objet) is
begin
Ast.Detruire;
end Detruire;
task body Objet is
Le_Cap : Definitions.Cap;
Bidon : Character;
Pos : Definitions.Position;
Pos_Sauve : Definitions.Position := (10, 10);
Numero : Natural;
Deplace : Boolean := False;
En_Vie : Boolean := True;
begin
Text_Io.Put_Line ("Tache Asteroide en route ...");
Nb_Ast := Nb_Ast + 1;
Numero := Nb_Ast;
Serveur.Serveur.Ok;
Initialise (Pos, Le_Cap);
Text_Io.Put_Line ("Tache Initialisee numero " & Integer'Image (Numero));
--Imprimeur.Imprime ('*', Pos, False);
while En_Vie loop
Serveur.Serveur.Une_Position_Aster (Pos, Numero, Pos_Sauve);
if Pos_Sauve /= (10, 10) then
Imprimeur.Imprime (' ', Pos_Sauve, False);
end if;
Pos_Sauve := Pos;
Text_Io.Put_Line ("Attente de la tache " & Integer'Image (Numero));
select
accept Deplacer do
Text_Io.Put_Line
(" OK pour pos Ordre de se deplacer accepte par" &
Integer'Image (Numero));
Deplace := True;
--Imprimeur.Imprime ('*', Pos, False);
end Deplacer;
or
accept Detruire do
Text_Io.Put_Line ("je me tue");
Imprimeur.Imprime (' ', Pos, False);
En_Vie := False;
end Detruire;
end select;
delay 0.1;
if Deplace = True and En_Vie = True then
Text_Io.Put_Line ("ok je bouge");
Imprimeur.Imprime ('*', Pos, False);
Changer_Position (Pos, Le_Cap);
Text_Io.Put_Line ("ma pos virtuelle est calculee :");
Text_Io.Put_Line (Integer'Image (Pos.Colonne) &
" , " & Integer'Image (Pos.Ligne));
Deplace := False;
end if;
end loop;
end Objet;
end Asteroide;
nblk1=6
nid=2
hdr6=a
[0x00] rec0=28 rec1=00 rec2=01 rec3=00a
[0x01] rec0=21 rec1=00 rec2=06 rec3=020
[0x02] rec0=00 rec1=00 rec2=03 rec3=026
[0x03] rec0=1b rec1=00 rec2=05 rec3=030
[0x04] rec0=0f rec1=00 rec2=04 rec3=000
[0x05] rec0=44 rec1=83 rec2=b7 rec3=7cc
tail 0x2176901b689154b5ec1ef 0x42a00088462060003
Free Block Chain:
0x2: 0000 00 00 00 15 80 12 75 72 2e 53 65 72 76 65 75 72 ┆ ur.Serveur┆