|
|
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: 3040 (0xbe0)
Types: TextFile
Notes: R1k Text-file segment
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦cfc2e13cd⟧ »Space Info Vol 2«
└─⟦78d79bb0d⟧
└─⟦this⟧
with Coordonnees;
use Coordonnees;
with Cap;
use Cap;
with Action;
use Action;
package body Point is
function Creer
(Terminal : in Integer; X0, Y0 : in Tcoordonnees; C : Character)
return Objet is
begin
return Objet'(Terminal => Terminal, X => X0, Y => Y0, R => C);
end Creer;
procedure Bouger_Nord (X, Y : in out Tcoordonnees) is
begin
if Y = 1 then
Y := Max_Lin;
else
Y := Y - 1;
end if;
end Bouger_Nord;
procedure Bouger_Sud (X, Y : in out Tcoordonnees) is
begin
if Y = Max_Lin then
Y := 1;
else
Y := Y + 1;
end if;
end Bouger_Sud;
procedure Bouger_Est (X, Y : in out Tcoordonnees) is
begin
if X = Max_Col then
X := 1;
else
X := X + 1;
end if;
end Bouger_Est;
procedure Bouger_Ouest (X, Y : in out Tcoordonnees) is
begin
if X = 1 then
X := Max_Col;
else
X := X - 1;
end if;
end Bouger_Ouest;
procedure Bouger (Point : in out Objet; Sens : Tdirection) is
begin
case Sens is
when Sud =>
Bouger_Sud (Point.X, Point.Y);
when Nord =>
Bouger_Nord (Point.X, Point.Y);
when Est =>
Bouger_Est (Point.X, Point.Y);
when Ouest =>
Bouger_Ouest (Point.X, Point.Y);
when Sud_Est =>
Bouger_Sud (Point.X, Point.Y);
Bouger_Est (Point.X, Point.Y);
when Sud_Ouest =>
Bouger_Sud (Point.X, Point.Y);
Bouger_Ouest (Point.X, Point.Y);
when Nord_Est =>
Bouger_Nord (Point.X, Point.Y);
Bouger_Est (Point.X, Point.Y);
when Nord_Ouest =>
Bouger_Nord (Point.X, Point.Y);
Bouger_Ouest (Point.X, Point.Y);
end case;
end Bouger;
procedure Afficher (No_Terminal : in Integer; Point : in Objet) is
Terminal : Mon_Terminal.Handle
renames Mes_Terminaux (No_Terminal).Handle;
begin
Mon_Terminal.Ecrire
(Terminal => Terminal, C => Point.R, X => Point.X, Y => Point.Y);
end Afficher;
procedure Effacer (No_Terminal : in Integer; Point : in Objet) is
Terminal : Mon_Terminal.Handle
renames Mes_Terminaux (No_Terminal).Handle;
begin
Mon_Terminal.Ecrire
(Terminal => Terminal, C => ' ', X => Point.X, Y => Point.Y);
end Effacer;
function Pos_X (Point : in Objet) return Tcoordonnees is
begin
return Point.X;
end Pos_X;
function Pos_Y (Point : in Objet) return Tcoordonnees is
begin
return Point.Y;
end Pos_Y;
function Graphe (Point : in Objet) return Character is
begin
return Point.R;
end Graphe;
procedure Detruire (Point : in out Objet) is
begin
null;
end Detruire;
end Point