
        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   # 6

                                 infofile v1.1


Hi all!

After a long break, welcome to another size coding competition.

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

Credits  for  the  idea go to Stefan  this  time,  and credits for the example
program and the first draft of the rules to Jibz, furthermore for additions to
INT-E.

This  time  the task is quite extraordinary:  You have to write an interpreter
for  the  programming language 'Brainfuck'. Don't blame  us  for the name - it
does  not  come  from  us. This  simple  programming  language  was originally
developed  on  the  Amiga  by  Urban Mueller (umueller@amiga.physik.unizh.ch).
There are even Brainfuck compilers for Amiga which are smaller than 255 bytes.
We  thought it would be interesting to see  how small a PC implementation of a
Brainfuck  interpreter would be and therefore it would be a nice task for this
compo series.

You can find the original Brainfuck archive at:
ftp://ftp.uni-paderborn.de/pub/aminet/dev/lang/brainfuck-2.lha

Brainfuck  is  a  very simple language.  There  are only eight commands, whose
meaning is as follows:

  Cmd Effect                               Equivalent in C
  --- ------                               ---------------
  +   Increase element under pointer       data[dp]++;
  -   Decrase element under pointer        data[dp]--;
  >   Increase pointer                     dp++;
  <   Decrease pointer                     dp--;
  [   Start loop, counter under pointer    while(data[dp]) {
  ]   Indicates end of loop                }
  .   Output ASCII code under pointer      putchar(data[dp] & 0x00ff);
  ,   Read char and store ASCII under ptr  data[dp]=(unsigned short)getchar();

Sounds interesting? Then read the following rules!


- A  Brainfuck source file must  contain a correct Brainfuck program, i.e. the
  brackets [] have to be balanced.  It  can contain comments  using characters
  other  than '+','-','.',',','[',']','<','>', and it  can take more  than one
  line.

- NUL (ascii 0)  is an illegal  character.  Brainfuck  source files, input and
  output  must not contain it.  Ascii 0Dh without  0Ah is  illegal,  too  (for
  output this means that the program may not output a single 0Dh).

- ^Z means EOF (end of file) for console input. Your entry has to handle stdin
  input  like  DOS function 3Fh. That means that  you do NOT have to check for
  non-terminal ^Z in keyboard input.

- The maximum size of a Brainfuck source file is 10000 bytes.

- The  interpreter  must take as its  argument  the name (with extension) of a
  single  Brainfuck  source  file.  It  can  be  assumed  that  it  exists, is
  accessible  and contains a valid Brainfuck  program. You may assume that the
  system, hidden and read-only flags are not set for this file.

  So a typical use is:

    entry reverse.b <normal.txt >reversed.txt

- The brainfuck source file must not be modified. The program must not use any
  external files other than the source file,  stdin (if redirected) and stdout
  (if redirected).

- The  interpreter  must  read the input  for  the  Brainfuck program (for the
  command  ',')  from  stdin (you must NOT  assume  that  this input is always
  redirected).

- ',' has to convert an input of 0Dh 0Ah (= the ENTER key) to 0Ah.

- ','  has to set [dp] to the  ascii value of the character read, zero-extended
  or to 0FFFFh (-1) for EOF.

- The  interpreter  must  print the output  of  the Brainfuck program (for the
  command '.') to stdout. This output must be redirectible.

- '.' has to convert 0Ah to 0Dh 0Ah.

- '.' must not modify the value of [dp].

- The  data buffer must contain at least 10000 16bit cells (i.e. 10000 words).
  The data buffer must be  initialised  to all zeros and the data pointer must
  be set to  point  at the first  element  in the  buffer  before  the program
  execution begins.

- Time limit: one minute for testit.bat on a Pentium 200.

- Other than these rules common sense applies!

- In case of any questions first check the original archive:
  ftp://ftp.uni-paderborn.de/pub/aminet/dev/lang/brainfuck-2.lha

- Hint:  Take  a look at DOS function  AH=3Fh. It echoes console input without
  writing it to stdout.


As always, your entry must...
                          ...have the filename entry.com.
                          ...work in Windows95 DOS box.
                          ...work at least on my PC.
                          ...exit without crashing when regular input.
                          ...not depend on its filename.

All instructions till .586 (Pentium) can be used.

Your entry does not have to work with LOADHIGH.

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

The included file testit.bat tests your program with some sample source files.
I will check your entries with the same program.

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

An  example  program by Jibz is attached  (entry.*). You can use testit.bat to
check  if  your entry works correctly  with the attached same Brainfuck source
files.

-------------------------------- [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.

The sourcecode should be able to be assembled with tasm, nasm or a386.

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 coders
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] ---------------------------------

Jan. 25, 1999                   Compo starts
Mar. 25, 1999, 11:59 pm cet     Deadline for entry submission, compo is over
Mar. 26, 1999                   Entries and beta results will be released,
                                Start of public judgement
Apr. 01, 1999, 11:59 pm cet     End of public judgement
Apr. 02, 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
110 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, January 24th, 1999
