|
|
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: 1632 (0x660)
Types: TextFile
Names: »B«
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
└─⟦129cab021⟧ »DATA«
└─⟦this⟧
└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
└─⟦d65440be7⟧ »DATA«
└─⟦this⟧
package body Square is
subtype Tablesize is Integer range 1 .. Size;
type Table is array (Tablesize, Tablesize) of Token;
type Cell is
record
Line : Tablesize;
Column : Tablesize;
end record;
Mysquare : Table;
Current_Cell : Cell;
procedure Go_To_Center is
begin
Current_Cell.Line := (Size / 2) + 1;
Current_Cell.Column := (Size / 2) + 1;
end Go_To_Center;
procedure Move (D : Direction) is
begin
case D is
when North =>
Current_Cell.Line := (Current_Cell.Line mod Size) + 1;
when East =>
Current_Cell.Column := (Current_Cell.Column mod Size) + 1;
when South =>
if Current_Cell.Line = 1 then
Current_Cell.Line := Size;
else
Current_Cell.Line := Current_Cell.Line - 1;
end if;
when West =>
if Current_Cell.Column = 1 then
Current_Cell.Column := Size;
else
Current_Cell.Column := Current_Cell.Column - 1;
end if;
end case;
end Move;
procedure Deposit (T : Token) is
begin
Mysquare (Current_Cell.Line, Current_Cell.Column) := T;
end Deposit;
function Cell_Busy return Boolean is
begin
return Mysquare (Current_Cell.Line, Current_Cell.Column) > 0;
end Cell_Busy;
begin
for I in 1 .. Size loop
for J in 1 .. Size loop
Mysquare (I, J) := 0;
end loop;
end loop;
end Square;