scene.org File Archive

File download

<root>­/­mags­/­hugi­/­compos/hc20fin.zip

File size:
60 091 bytes (58.68K)
File date:
2003-02-14 23:04:20
Download count:
all-time: 2 243

Preview

  • APHEX/ dir
  • APHEX/ENTRY.ASM 3.12K
  • APHEX/ENTRY.COM 131B
  • ATV/ dir
  • ATV/ENTRY.ASM 4.81K
  • ATV/ENTRY.COM 139B
  • BEEBLBRX/ dir
  • BEEBLBRX/ENTRY.ASM 3.54K
  • BEEBLBRX/ENTRY.COM 146B
  • BOILED/ dir
  • BOILED/ENTRY.ASM 3.17K
  • BOILED/ENTRY.COM 146B
  • ESPINETR/ dir
  • ESPINETR/ENTRY.ASM 3.66K
  • ESPINETR/ENTRY.COM 137B
  • GENERAL.TXT 10.46K
  • GHAZI/ dir
  • GHAZI/ENTRY.ASM 4.24K
  • GHAZI/ENTRY.COM 145B
  • GONGO/ dir
  • GONGO/ENTRY.ASM 2.62K
  • GONGO/ENTRY.COM 167B
  • HC20.TXT 4.81K
  • HC20BETA.ZIP 29.84K
  • HOUSSEM/ dir
  • HOUSSEM/ENTRY.ASM 2.32K
  • HOUSSEM/ENTRY.COM 143B
  • JEFF/ dir
  • JEFF/ENTRY.ASM 2.09K
  • JEFF/ENTRY.COM 137B
  • MEPH/ dir
  • MEPH/ENTRY.A16 11.19K
  • MEPH/ENTRY.COM 130B
  • RESULTS.TXT 784B
  • RUUD/ dir
  • RUUD/ENTRY.ASM 4.14K
  • RUUD/ENTRY.COM 125B
  • SERGO/ dir
  • SERGO/ENTRY.ASM 1.73K
  • SERGO/ENTRY.COM 130B
  • SNIPER/ dir
  • SNIPER/ENTRY.ASM 4.23K
  • SNIPER/ENTRY.COM 153B

file_id.diz

                     HUGI SIZE CODING COMPETITION 20
                        The Easter-date Compo

Welcome to the Hugi Size Coding Compo #20! After the HC19 graphical
task the votes have declared that the challenge should be a shortest
way to compute the date of Easter from a given year using the 
Gregorian Calendar. To make the program more useful, the input will
come from standard input (i.e. the keyboard or a redirected file).

                            The rules

Your entry should input any number of lines from standard input. Each
line will only contain 4 decimal digits ('0'-'9') representing a year
followed by <CR>(=0dh). The <CR> may or may not be followed by a <LF>.
After a line has been read from STDIN your program should add a dash
'-' after the year and calculate the date of Easter from the year that
was just read from STDIN. It should then output the date of Easter to
STDOUT using the months name, either March or April, followed by a space,
followed by the day of the month, all on the same line as the year.

The day of the month is a decimal value between 1 and 31. If dd<10, the
leading zero should be converted to a space. (dd is right aligned).
Each output line must end with a <CR><LF> pair and may NOT contain any
characters between the day value and the <CR><LF> pair. Your entry must
exit cleanly to DOS if the first char on the input line is <EOF>(=1ah),
it should exit directly after encountering and outputting the <EOF>.
If the output is redirected, the destination file must exactly match
what would have been output to the screen if the output hadn't been
redirected. If only the output is redirected, the characters typed at
the keyboard must be redirected to the output file instead of the screen.

Note that since we want to make this tool at least a little useful, your
entry should reply with a result after 1 line is read!! You may not read
another line without first displaying the correct output for the given line.
(We want to be able to use the keyboard).

                           Oudin's Algo

Here is an example algorithm for calculating the date of Easter from
Oudin 1940. (Thank god for cut n paste)

    C = Y / 100
    N = Y - 19 * ( Y / 19 )
    K = ( C - 17 ) / 25
    I = C - C / 4 - ( C - K ) / 3 + 19 * N + 15
    I = I - 30 * ( I / 30 )
    I = I - ( I / 28 ) * ( 1 - ( I / 28 ) * ( 29 / ( I + 1 ) )
        * ( ( 21 - N ) / 11 ) )
    J = Y + Y / 4 + I + 2 - C + C / 4
    J = J - 7 * ( J / 7 )
    L = I - J
    M = 3 + ( L + 40 ) / 44
    D = L + 28 - 31 * ( M / 4 )

Where Y is the year read from STDIN, M is the month number (3 = March)
and D is the day of the month. All variables used are integers and the
result of all divisions are rounded down to the nearest integer. What
ever algorithm you use, your result must match the outcome of the above
calculation between and including the years 1583 and 4099.

For example, using the year 2010, 
Y=2010, 
C=2010/100=20,
N=2010 - 19 X (2010/19) = 15,
etc. resulting in Easter on April 4, 2010. 

So an input line: 2010<CR>[<LF]>]
must output:      April 4

The screen will reflect:
2010-April  4<CR><LF>


                           Assumptions

All the rules stated in General.txt should be obeyed.

You may assume that any line exists of either dddd<CR>[<LF>] or
<EOF><CR>[<LF>]
where d is a decimal char '0' to '9'. You may also assume that
dddd has a value between 1582 and 4100 (but not including). If
the value of the year is not within the boundaries or any other
false input is encountered your entry may do what ever you want
it to do (even crash).

You may not assume that a <CR> is followed by <LF>, your entry
should handle both cases correctly. Also you may not assume that
the input is redirected (that means either direct keyboard input
and redirection from file must work)

                         Test suite

A test suite and an example will come with the rules. Your entry
should always pass the test suite BUT even if the entry passes
the test suite, there may still be hidden flaws or bad assumptions
which may be judged after the compo is over.
                  
                       Some interesting sites

http://aa.usno.navy.mil/faq/docs/easter.html
http://users.chariot.net.au/~gmarts/eastalg.htm

Schedule
--------
   Compo starts:                       Fri, Nov  1, 2002  (00:00:00)
   Deadline for entry submission:      Sat, Dec 14, 2002  (23:59:59)
   Entries and beta results released:  Sun, Dec 15, 2002  (when I wake up :)
   Start of Public Judgement:          Sun, Dec 15, 2002  (shortly after)
   End of Public Judgement:            Thu, Dec 19, 2002  (23:59:59)
   Final results released:             Fri, Dec 20, 2002  (promptly)

   Good luck!

   Ruud

Contributions to the rules by:

(Thanks Ruud), Dimitri Smits, Paolo, Jeff and Sniper