-- hello5.adb
--    Purpose: Bounce a message back and forth across the screen.

with
  Terminal_Interface.Curses;

use
  Terminal_Interface.Curses;

procedure Hello is
   Left_Edge  : constant := 10;
   Right_Edge : constant := 30;
   Row        : constant Line_Position := 10;
   Message    : constant String := "Hello";
   Blank      : constant String := "     ";
   Dir        : Integer := +1;
   Pos        : Integer := Left_Edge;
begin
   Init_Screen;
   Clear;
   loop
      Move_Cursor (Line => Row, Column => Column_Position (Pos));
      Add (Str => Message);
      Move_Cursor (Line => Lines - 1, Column => Columns - 1);
      Refresh;
      delay 0.3;
      Move_Cursor (Line => Row, Column => Column_Position (Pos));
      Add (Str => Blank);
      Pos := Pos + Dir;
      if not (Pos in Left_Edge .. Right_Edge) then
	 Dir := - Dir;
      end if;
   end loop;
   End_Screen;
exception
   when others =>
      End_Screen;
end Hello;

