home *** CD-ROM | disk | FTP | other *** search
/ Solo Programadores 22 / SOLO_22.iso / docs / lovelace / directio.ads < prev    next >
Encoding:
Text File  |  1995-10-24  |  643 b   |  23 lines

  1.  
  2. with Ada.Strings.Unbounded;
  3. use  Ada.Strings.Unbounded;
  4.  
  5. package Directions is
  6.  
  7.  type Direction is (North, South, East, West, Up, Down);
  8.  
  9.  Reverse_Direction : constant array(Direction) of Direction :=
  10.                     (North => South, South => North,
  11.                      East =>West, West => East,
  12.                      Up => Down, Down => Up);
  13.  
  14.  function To_Direction(Text : Unbounded_String) return Direction;
  15.  -- Converts Text to Direction; raises Constraint_Error if it's not
  16.  -- a legal direction.
  17.  
  18.  function Is_Direction(Text : Unbounded_String) return Boolean;
  19.  -- Returns TRUE if Text is a direction, else false.
  20.  
  21. end Directions;
  22.  
  23.