-------------------------------------------------------------------------
--                                                                     --
--          aInvisiclue 1.0 - an Infocom Invisiclue Decoder            --
--               by Preben Randhol (c) Copyright 2002                  --
--            Licensed under the GNU Public License (GPL)              --
--                                                                     --
-- This is a small program to decode the Infocom Invisiclues. It won't --
-- translate the whole files as you should  only translate one hint at --
-- a time, but it is very easy to cut and paste.  The encoding is very --
-- simple: A => B, B => C, ..., Z => A.                                --
--                                                                     --
-- Example:                                                            --
--    The message : "Sghr hr zm dwzlokd"                               --
--    decodes to  : "This is an example"                               --
--                                                                     --
--                 Use at own risk, no warranty given.                 --
--                                                                     --
-------------------------------------------------------------------------

with Ada.Text_IO;       use Ada.Text_IO;
with Ada.Strings.Maps;  use Ada.Strings.Maps;
with Ada.Strings.Fixed; use Ada.Strings.Fixed;

procedure aInvisiclue is

   Code_Mapping : constant Character_Mapping :=
      To_Mapping (
         "ZzAaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYy",
         "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz");
   Input : String (1 .. 2048) := (others => ' ');
   Last  : Natural := 0;
begin

   New_Line;
   Put_Line ("aInvisiclue 1.0");
   Put_Line ("an Infocom Invisiclue Decoder");
   Put_Line ("by Preben Randhol (c) Copyright 2002");
   New_Line;
   Put_Line ("Licensed under the GNU Public License (GPL)");
   Put_Line ("Use at own risk, no warrenty given.");
   New_Line;
   Put_Line ("Press Ctrl-C to exit program.");
   New_Line;

   Put_Line ("What can I help you translate ? ");
   New_Line;
   loop
      Get_Line (Item => Input, Last => Last);
      Put_Line (Translate (Input (1 .. Last), Code_Mapping));
   end loop;

end aInvisiclue;


syntax highlighted by Code2HTML, v. 0.9.1