home *** CD-ROM | disk | FTP | other *** search
-
- with Ada.Strings.Unbounded;
- use Ada.Strings.Unbounded;
-
- package Directions is
-
- type Direction is (North, South, East, West, Up, Down);
-
- Reverse_Direction : constant array(Direction) of Direction :=
- (North => South, South => North,
- East =>West, West => East,
- Up => Down, Down => Up);
-
- function To_Direction(Text : Unbounded_String) return Direction;
- -- Converts Text to Direction; raises Constraint_Error if it's not
- -- a legal direction.
-
- function Is_Direction(Text : Unbounded_String) return Boolean;
- -- Returns TRUE if Text is a direction, else false.
-
- end Directions;
-
-