Format/typo check 1996/schweikh1
This commit is contained in:
1 parent
c7ae827d81
commit
f704c2989e
2 files changed
+31
-15
No files matched your search
+20
-15
@@ -23,8 +23,8 @@ To find the day that Easter falls on in the current year:
|
|||||||
|
|
||||||
## Judges' remarks:
|
## Judges' remarks:
|
||||||
|
|
||||||
Look at the source. There is something very odd going on here.\
|
Look at the source. There is something very odd going on here.
|
||||||
Where does the real code come from if everything is a C pre-processor\
|
Where does the real code come from if everything is a C pre-processor
|
||||||
statement?
|
statement?
|
||||||
|
|
||||||
Clearly this is either the Best Use or the Worst Abuse of the
|
Clearly this is either the Best Use or the Worst Abuse of the
|
||||||
@@ -39,10 +39,12 @@ This program is an implementation of an algorithm that calculates
|
|||||||
the date of the Sunday following the first full moon after the
|
the date of the Sunday following the first full moon after the
|
||||||
spring equinox. (Also known as "Easter", defined this way by the
|
spring equinox. (Also known as "Easter", defined this way by the
|
||||||
Nicaean Concilium in 325 Anno Domini.) The algorithm is attributed
|
Nicaean Concilium in 325 Anno Domini.) The algorithm is attributed
|
||||||
to the famous mathematician Carl Friedrich Gauss ["Meyers Handbuch
|
to the famous mathematician [Carl Friedrich
|
||||||
ueber das Weltall", Meyer, 5th Edition, 1973, p149] and is suitable
|
Gauss](https://en.wikipedia.org/wiki/Carl_Friedrich_Gauss) ["Meyers Handbuch
|
||||||
for anni domini within the Gregorian Calendar, that is, from 1582 AD
|
ueber das Weltall" 'Handbook About Space', Meyer, 5th Edition, 1973, p149] and is suitable
|
||||||
to 2199 AD:
|
for anni domini within the [Gregorian
|
||||||
|
Calendar](https://en.wikipedia.org/wiki/Gregorian_calendar), that is, from ad 1582
|
||||||
|
to ad 2199:
|
||||||
|
|
||||||
```
|
```
|
||||||
Let J be the year.
|
Let J be the year.
|
||||||
@@ -70,18 +72,18 @@ with the following exceptions:
|
|||||||
|
|
||||||
```
|
```
|
||||||
April 26 must always be changed to April 19
|
April 26 must always be changed to April 19
|
||||||
April 25 must be changed to April 18 if d is 28 and a greater than 10
|
April 25 must be changed to April 18 if d is 28 and a is greater than 10
|
||||||
```
|
```
|
||||||
|
|
||||||
### Example:
|
### Example:
|
||||||
|
|
||||||
```
|
```
|
||||||
J = 1962, M = 24, N = 5
|
J = 1962, M = 24, N = 5
|
||||||
a = J % 19 = 5
|
a = J % 19 == 5
|
||||||
b = J % 4 = 2
|
b = J % 4 == 2
|
||||||
c = J % 7 = 2
|
c = J % 7 == 2
|
||||||
d = 119 % 30 = 29
|
d = 119 % 30 == 29
|
||||||
e = 191 % 7 = 2
|
e = 191 % 7 == 2
|
||||||
```
|
```
|
||||||
|
|
||||||
March 53 is invalid, so the result is April 22 1962.
|
March 53 is invalid, so the result is April 22 1962.
|
||||||
@@ -101,7 +103,7 @@ Nobody can learn that by heart so I gently remind the reader by
|
|||||||
defining a macro that expresses this clearly (line 25). This goes up
|
defining a macro that expresses this clearly (line 25). This goes up
|
||||||
to the definition of a translation unit. Unfortunately, due to the
|
to the definition of a translation unit. Unfortunately, due to the
|
||||||
IOCCC's size restrictions, I had to abbreviate some syntactic
|
IOCCC's size restrictions, I had to abbreviate some syntactic
|
||||||
elements. "ae" actually reads "assignment expression". I had to stop
|
elements. `ae` actually reads "assignment expression". I had to stop
|
||||||
at some arbitrary point, so don't waste your time trying to find out
|
at some arbitrary point, so don't waste your time trying to find out
|
||||||
how preprocessing tokens form type qualifier lists, cast expressions
|
how preprocessing tokens form type qualifier lists, cast expressions
|
||||||
or direct abstract declarators. Assuming the reader knows about
|
or direct abstract declarators. Assuming the reader knows about
|
||||||
@@ -109,9 +111,10 @@ these easy to remember language elements is justified in my opinion.
|
|||||||
|
|
||||||
|
|
||||||
### The moral:
|
### The moral:
|
||||||
\
|
|
||||||
Try to be as precise as can be and no one will comprehend what you mean.
|
Try to be as precise as can be and no one will comprehend what you mean.
|
||||||
|
|
||||||
|
|
||||||
#### The formula:
|
#### The formula:
|
||||||
|
|
||||||
|
|
||||||
@@ -119,6 +122,7 @@ Try to be as precise as can be and no one will comprehend what you mean.
|
|||||||
comprehension = 1/(2**precision)
|
comprehension = 1/(2**precision)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
#### The interpretation:
|
#### The interpretation:
|
||||||
|
|
||||||
"Say nothing and everybody will understand."
|
"Say nothing and everybody will understand."
|
||||||
@@ -130,7 +134,8 @@ This leads to an error due to the redefinition of main. The `-I` option makes
|
|||||||
sure the working /usr/include/errno.h is found first, which shouldn't cause any
|
sure the working /usr/include/errno.h is found first, which shouldn't cause any
|
||||||
problems on other systems.
|
problems on other systems.
|
||||||
|
|
||||||
### Usage
|
|
||||||
|
### Usage:
|
||||||
|
|
||||||
The program is run without arguments. It prints all dates in order.
|
The program is run without arguments. It prints all dates in order.
|
||||||
|
|
||||||
|
|||||||
@@ -1986,6 +1986,17 @@ the function in the pointer assignment.
|
|||||||
NOTE: if there is no X server running this program will still crash.
|
NOTE: if there is no X server running this program will still crash.
|
||||||
|
|
||||||
|
|
||||||
|
## [1996/schweikh1](1996/schweikh1/schweikh1.c) ([README.md](1996/schweikh1/README.md]))
|
||||||
|
|
||||||
|
The author stated that `-I/usr/include` is needed by gcc in Solaris because
|
||||||
|
`errno.h` has two identical extern declarations of `errno`. That leads to an
|
||||||
|
error due to the redefinition of `main` but the `-I` option makes sure the
|
||||||
|
working `/usr/include/rrno.h` is found first, which shouldn't cause any problems
|
||||||
|
on other systems (the other file is
|
||||||
|
`gcc-lib/sparc-sun-solaris2.5/2.7.2/include/errno.h`). Thus Cody added this to
|
||||||
|
the Makefile despite the fact that very few probably use Solaris nowadays.
|
||||||
|
|
||||||
|
|
||||||
## [1996/westley](1996/westley/westley.c) ([README.md](1996/westley/README.md]))
|
## [1996/westley](1996/westley/westley.c) ([README.md](1996/westley/README.md]))
|
||||||
|
|
||||||
Cody fixed a segfault in this entry as well as it displaying environmental
|
Cody fixed a segfault in this entry as well as it displaying environmental
|
||||||
|
|||||||
Reference in new issue
Block a user