|
|
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 Player_Interface, seg_04861a
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦5a81ac88f⟧ »Space Info Vol 1«
└─⟦this⟧
with Text_Io, Unbounded_String, Player_Error, String_Utilities;
package body Player_Interface is
type Array_Of_Words is array (1 .. Max_Word) of String (1 .. 100);
Words : Array_Of_Words;
procedure Initialyze_Table is
begin
for I in 1 .. Max_Word loop
Words (I) := (others => ' ');
end loop;
end Initialyze_Table;
function Get_Word (Position : in Word_Positions) return String is
begin
return String_Utilities.Strip_Trailing (Words (Position));
end Get_Word;
function Is_Separator (What : in Character) return Boolean is
begin
return What = ' ';
end Is_Separator;
procedure Ask_Player is
begin
Text_Io.New_Line (2);
Text_Io.Put (" Entrer votre action : ");
end Ask_Player;
procedure Get_Command_Player (S : out String; Line_Length : out Natural) is
L : Natural;
begin
Text_Io.Get_Line (S, L);
Line_Length := L;
for I in L + 1 .. S'Last loop
S (I) := ' ';
end loop;
Text_Io.New_Line;
end Get_Command_Player;
procedure Resynchro (Source_String : in String;
Length_Of_Source_String : in Natural;
Index : in out Positive) is
begin
while ((Index <= Length_Of_Source_String) and then
(Is_Separator (Source_String (Index)))) loop
Index := Index + 1;
end loop;
end Resynchro;
procedure Get_Identifier (Source_String : in String;
Length_Of_Source_String : in Natural;
Index : in out Positive;
Target_String : out String) is
Start_Index : Positive;
begin
Start_Index := Index;
while ((Index <= Length_Of_Source_String) and then (not Is_Separator (Source_String (Index)))) loop
Target_String (Target_String'First + Index - Start_Index) :=
Source_String (Index);
Index := Index + 1;
end loop;
end Get_Identifier;
procedure Split (The_String : in String; Length_Of_The_String : Natural) is
Number_Of_Words : Natural := 1;
Index : Positive := 1;
begin
while (Index <= Length_Of_The_String) loop
Resynchro (The_String, Length_Of_The_String, Index);
if (Index <= Length_Of_The_String) then
Words (Number_Of_Words) := (others => ' ');
Get_Identifier (The_String, Length_Of_The_String,
Index, Words (Number_Of_Words));
Number_Of_Words := Number_Of_Words + 1;
end if;
end loop;
exception
when Constraint_Error =>
Player_Error.Set_Type_Error
(Player_Error.Too_Many_Words_In_Command);
raise Player_Error.Excep_Raise;
end Split;
procedure Get_Command is
Readed_String : String (1 .. 100);
Length_Of_Readed_String : Natural;
begin
Initialyze_Table;
Ask_Player;
Get_Command_Player (Readed_String, Length_Of_Readed_String);
String_Utilities.Lower_Case (Readed_String);
Split (Readed_String, Length_Of_Readed_String);
end Get_Command;
end Player_Interface;
nblk1=6
nid=2
hdr6=8
[0x00] rec0=25 rec1=00 rec2=01 rec3=03e
[0x01] rec0=1a rec1=00 rec2=04 rec3=002
[0x02] rec0=17 rec1=00 rec2=05 rec3=016
[0x03] rec0=10 rec1=00 rec2=03 rec3=000
[0x04] rec0=10 rec1=00 rec2=03 rec3=000
[0x05] rec0=01 rec1=00 rec2=03 rec3=001
tail 0x215459a5a865975972c87 0x42a00088462060003
Free Block Chain:
0x2: 0000 00 06 00 2b 80 24 3c 3d 20 4c 65 6e 67 74 68 5f ┆ + $<= Length_┆
0x6: 0000 00 00 00 69 80 05 62 65 67 69 6e 05 00 1d 20 20 ┆ i begin ┆