
        h u g i   s i z e   c o d i n g   c o m p e t i t i o n   # 8

                                 infofile v1.0


Hi all!

Welcome to the third size coding competition in 1999.

--------------------------------- [THE TASK] ---------------------------------

Credits for the rules drafts go to INT-E, TAD, and Jibz (again).

Your task is to write a Morse encoder/decoder program. The original Morse code
was  invented by Samuel Finley Breese Morse  (1791-1872), but for this compo a
slightly modified International morse code will be employed.

Your  entry  must perform a transformation of  either plain text into Morse or
Morse into plain text. Your entry must meet the following requirements:

- It must work in a Win95 DOS Box.

- It must NOT use any external files other than those specified in the command
  line.

- It  must NOT rely on any previously loaded  code or data except the DOS API,
  BIOS routines, and the DPMI host.

- It must NOT depend on its own filename, drive or path.

- Interrupts must NOT be disabled, i.e. you must not use the CLI instruction.

- Any instruction up to .586 (Pentium) can be used.

- Your entry does not have to work with LOADHIGH.

Special rules for this task:

- Your entry must read from STDIN and write to STDOUT (i.e. work as a filter).
  So for example the following must work:

    entry.com <text.mor >text.txt
    entry.com <text2.txt >text2.mor
    entry.com <text3.mor
    entry.com <text4.txt
    entry.com

- The entry must NOT assume that the input or output is always redirected.

- There is NO size limit on either the plain text or the Morse encoded file.

- For  a valid input file (of either plain  or Morse text) a time limit of one
  minute on Adok's PC is imposed for files less than 10240 bytes in size.

- If the input file contains valid Morse code, the program has to transform it
  to  valid  plain  text (see below); if  it  contains a valid plain text, the
  program  has  to transform it to valid  Morse  code (again, see below). This
  means  that  you  have  to determine the  type  of  data from the input file
  itself. In all other cases, the behaviour of the program is undefined.

- Input files must not be empty.

- A  valid file is a sequence of words, separated by word separators, preceded
  by a begin of message marker and followed by a end of message marker.

- A word is a sequence of symbols, separated by symbol separators.

- Your  program  has to support the  following symbols (lower case letters and
  upper case letters correspond to the same Morse symbol):

(TABLE 1)

TEXT    TEXT    MORSE          TEXT    MORSE
SYMBOL  SYMBOL  SYMBOL         SYMBOL  SYMBOL

A       a       ._             0       _____
B       b       _...           1       .____
C       c       _._.           2       ..___
D       d       _..            3       ...__
E       e       .              4       ...._
F       f       .._.           5       .....
G       g       __.            6       _....
H       h       ....           7       __...
I       i       ..             8       ___..
J       j       .___           9       ____.
K       k       _._            ,       __..__
L       l       ._..           .       ._._._
M       m       __             ?       ..__..
N       n       _.             /       _.._.
O       o       ___            -       _...._
P       p       .__.           :       ___...
Q       q       __._           ;       _._._.
R       r       ._.            `       ._.._.
S       s       ...            '       .____.
T       t       _              NEWLINE _..._
U       u       .._     
V       v       ..._    
W       w       .__     
X       x       _.._    
Y       y       _.__    
Z       z       __..    

Note: NEWLINE is an ASCII 13, followed directly by an ASCII 10, that means the
normal DOS newline.

- For  text,  a symbol is a text symbol  from table 1, the symbol separator is
  empty  and  the word separator is a  space. Both the begin of message marker
  and the end of message marker are empty.

- For  Morse text, the begin of message marker is "_._._/", the end of message
  marker  is "/._._.", the word separator is  "/", and the symbol separator is
  " ".  The  symbol is a  Morse symbol  from table 1.  In addition  to this, a
  Morse  file  can contain newlines between  symbols  and separator to enhance
  readability (for humans), which are to be ignored by your program. Note that
  this  means that the file  "_._._/.NEWLINE_/._._." is invalid input, because
  there  is  a  seperator  missing between "."  and  "_".  Your program is not
  allowed  to generate more than two newlines  in a row for Morse output (i.e.
  text input).

- The transformation from text to Morse code has to do the following:
  . convert each symbol to a Morse symbol according to table 1
  . replace text begin of message marker, end of message marker,
    word separator and symbol separator with the Morse equivalent.
- The transformation from Morse code to text has to do the following:
  . convert each symbol to a text symbol according to table 1. In
    case of ambiguities, the program has to choose one of the
    possible translations.
  . replace Morse begin of message marker, end of message marker,
    word separator and symbol separator with the text equivalent.

- The sequence 123, seperated by "/", means "1/2/3", that is, the seperator is
  only  _between_  each  two following elements,  not  before the first one or
  after  the last one. Only one seperator is allowed between each two elements
  of  the  sequence,  that  means that  "1//2/3"  is  invalid (only "1/2/3" is
  valid).

- When  transforming  from Morse code to text,  the  letters in the final text
  file have to be all upper case.

Here is a short summary of the format of valid text/Morse files in a BNF-alike
(or  yacc-alike)  notation. It's not meant to  be  a replacement for the above
rules but merely a short summary:

<valid file> : <BOM> <word sequence> <EOM> ;
<word sequence> : <word>
                | <word> <word separator> <word sequence> ;
<word> : <symbol>
       | <symbol> <symbol separator> <word> ;

Now, for Morse code:
<symbol> : "." | "_" | ".." | "._" ... ; (see table 1)
<symbol separator> : " " ;
<word separator> : "/" ;
<BOM> : "_._._/" ;
<EOM> : "/._._. ;

And for text:
<symbol> : "A" "B" "C" ... ; (see table 1)
<symbol separator> : "" ;
<word separator> : " " ;
<BOM> : "" ;
<EOM> : "" ;

The   transformation  just  replaces  the   text(Morse)  <EOM>,  <BOM>,  <word
separator>,  <symbol separator> and <symbol>  with the Morse(text) <EOM>, etc.
The <symbol> is translated using table 1.

  !! Please check if your program fits to all rules before submitting it !!

The  included file test.bat tests whether your program converts a sample valid
plain text file to a valid morse text file and converts the morse text back to
plain text correctly. I will check your entries with the same program or newer
versions of it that will be available at the compo web-site.

--------------------------------- [EXAMPLE] ----------------------------------

An example program by INT-E is attached (example.exe). You can use test.bat to
check if your entry works correctly.

-------------------------------- [SUBMISSION] --------------------------------

You have to send me

() the sourcecode of your entry
() the executable of your entry

so that I can analyse and evaluate your entry.

Send your entries to:
                         hugi@netway.at

It  would be best if you could send me your entry as early as possible. Then I
can  inform  you about bugs, if I find  them,  and you have enough time to fix
them.  Attention: if I find no bugs, this doesn't automatically mean that your
entry is bug-free.

You can submit updates to your entries all the time till the deadline.

Entries  that  do  not  agree with  these  rules  will  be disqualified. Their
creators will be informed about the mistake, and they can re-submit a bugfixed
version unless the compo is over.

If  the  compo  is over and a hidden  flaw  is  found in one of the originally
accepted  entries  by  the jury or the  public,  the  best older entry of this
competitor that fits all the rules will qualify instead.

------------------------------- [PRE-RESULTS] --------------------------------

The  current pre-results of this compo  will be released on the compo-homepage
and always updated after receiving a new entry. In this way I hope to make the
compo exciting.

Compo-homepage URL:
                     http://home.pages.de/~hugi-compo/

If that URL does not work, try:
                     http://www.geocities.com/siliconvalley/bay/6062/compo.htm

--------------------------------- [SCHEDULE] ---------------------------------

Jun 20, 1999                   Compo starts
Jul 31, 1999, 11:59 pm cet     Deadline for entry submission, compo is over
Aug 01, 1999                   Entries and beta results will be released,
                               Start of public judgement
Aug 07, 1999, 11:59 pm cet     End of public judgement
Aug 08, 1999                   Final results will be released

----------------------------- [PUBLIC JUDGEMENT] -----------------------------

As soon as the entries and the beta results are released, the public judgement
starts.  During this week you can discuss  and object to the entries that seem
to  break some rule. Please send your objections to the compo-mailinglist (see
below).  The  jury (see the next paragraph)  will check if your objections are
according to the rules. If they are, the invalid entry will be disqualified.

--------------------------------- [THE JURY] ---------------------------------

All entries will be checked by me. Nobody else will get to see them before the
deadline.   After   the  deadline  all  entries   will   be  released  at  the
compo-homepage  together  with  the beta results.  In  this  week, the 'public
judgement' week, people can discuss and object to the entries.

To check whether the objections are right - and for no other purpose -, a jury
will  be formed, consisting of me and two other people that I'll select during
the compo.

Jury  members  have  to  act  objectively.  They  can't  change  any  rules or
disqualify  entries by themselves. Therefore  it's no difference whether these
people take part in the compo, too, or not.

The juries of the previous compos consisted of:

() compo 1: Altair, Cydo, Adok
() compo 2: Nop, Cydo, Adok
() compo 3: Maxx, Guillermo Sais, Adok

---------------------------------- [PRIZES] ----------------------------------

I'm sorry if i disappoint you, but there are no material prizes. Everything is
just  a  matter of honor and fame.  Moreover, the 30 best competitors will get
points  and be listed in the 'world league table of assembly' situated  at the
compo-homepage.  Reaching  a good place at a  compo and even more in the world
league  table of assembly is a good visiting-card and recommendation for every
competitor!

------------------------------- [MAILINGLIST] --------------------------------

The  purpose  of the Hugi Compo Mailinglist  is to inform about new compos and
provide  a discussion forum for the competitors. At the moment there are about
170 subscribers.

To  subscribe  send a mail  to hugi-compo-subscribe@egroups.com. You'll get an
automatically  generated  mail which confirms  your  subscription within a few
hours.  Then  you  start  getting the mails  the  others  have  posted to this
mailinglist.

Mails for the list have to be sent to: hugi-compo@egroups.com

If you want to unsubscribe, send a mail to: hugi-compo-unsubscribe@egroups.com

--------------------------------- [CONTACT] ----------------------------------

Send your entries to:
                                         hugi@netway.at        [adok/hugi]
Compo-homepage
(pre-results, world league table, etc.)
                                         http://home.pages.de/~hugi-compo/
Subscribe to the mailinglist:
                                         hugi-compo-subscribe@egroups.com

------------------------------------------------------------------------------

Thanks for reading this info file! I'm looking forward to your participation!

                                                  - adok^hugi, June 20th, 1999
