text
stringlengths
0
234
Text_IO.Put(JSP.Axis_Type'Image(Js_Event.Axis));
Text_IO.Put(Ada.Characters.Latin_1.HT);
Value_IO.Put(Js_Event.Value);
end case;
Text_IO.New_Line;
Function Definition: procedure Put_LJS is new Put(LJS);
Function Body: begin
declare
-- It is also possible to use Open without parameters, it will automatically locate
-- an available "js*" file.
--
Opended_Device_Path : String := "/dev/input/js1";
begin
LJS.Open(Opended_Device_Path);
Text_IO.Put_Line("Opended device at: " & Opended_Device_Path);
loop
declare
Js_Event : LJS.Js_Event_Type := LJS.Read;
begin
Put_LJS(Js_Event);
Function Definition: procedure Close is
Function Body: begin
SIO.Close(Input_File);
Function Definition: procedure Demo is
Function Body: function Pad (S : String; Len : Positive) return String is
(S & (1 .. Len - S'Length => ' '));
procedure Title (Text : String) is
begin
New_Line;
Put_Line (Style_Wrap (Text => "=== " & Text & "===",
Style => Bright));
end Title;
begin
Put_Line (Reset_All);
Title ("BASIC COLOR TEST");
-- Named color tests: best seen in a 96-column term
for Fg in Colors'Range loop
for Bg in Colors'Range loop
if Fg /= Bg then
Put (Color_Wrap (Text => Fg'Img & " on " & Bg'Img,
Foreground => Foreground (Fg),
Background => Background (Bg)));
end if;
end loop;
end loop;
New_Line;
Title ("PALETTE COLOR TEST (subsample)");
declare
Palette : constant array (Positive range <>) of Palette_RGB :=
(0, 1, 3, 5);
begin
for R of Palette loop
for G of Palette loop
for B of Palette loop
for BR of Palette loop
for BG of Palette loop
for BB of Palette loop
Put (Color_Wrap
(Text => "X",
Foreground => Palette_Fg (R, G, B),
Background => Palette_Bg (BR, BG, BB)));
end loop;
end loop;
end loop;
end loop;
end loop;
end loop;
New_Line;
Function Definition: procedure Reset_Board is
Function Body: begin -- Reset_Board
for I of Our_Board loop
I := (others=>Empty_Piece);
end loop;
for I of Our_Board(Position'First + 1) loop
I := Player_1_Pawn;
end loop;
Our_Board(Position'First) := Starting_Backrow_Order(1);
for I of Our_Board(Position'Last - 1) loop
I := Player_2_Pawn;
end loop;
Our_Board(Position'Last) := Starting_Backrow_Order(2);
King_Status(0) := (X=>3, Y=>0);
King_Status(1) := (X=>3, Y=>7);
Last_Moved := (0, 0);