diff --git a/2000/natori/Makefile b/2000/natori/Makefile index b6dced880..b69fda891 100644 --- a/2000/natori/Makefile +++ b/2000/natori/Makefile @@ -62,7 +62,7 @@ CDEFINE= -Wno-error -Wno-implicit-function-declaration -Wno-implicit-int \ # Include files that are needed to compile # -CINCLUDE= -include stdlib.h -include math.h +CINCLUDE= # Optimization # diff --git a/2000/natori/README.md b/2000/natori/README.md index 863536b40..3f926a685 100644 --- a/2000/natori/README.md +++ b/2000/natori/README.md @@ -23,9 +23,8 @@ Alternate code section below for more details. ## Try: -```sh -echo "Do or do not. There is no try." -``` +Try modifying the code so that it will show another Moon phase based on input +or else just by the code itself. Bonus points if you can make it show all! ### Alternate code: @@ -45,7 +44,8 @@ What happens if you run it in the northern hemisphere? Are there any differences? Can you identify any Moon phases that result in the same output of both -versions? +versions? Or are there any? + ## Judges' remarks: diff --git a/2000/natori/natori.alt.c b/2000/natori/natori.alt.c index ce74329cd..3b11bd21f 100644 --- a/2000/natori/natori.alt.c +++ b/2000/natori/natori.alt.c @@ -1,4 +1,3 @@ -double l; -int moon(int _, int o, int O){ -return putchar((_--+22&&_+44&&main(_,-43,_),_&&(int)o)?(main(-43,(int)++o,(int)O),((l=((int)o+21)/sqrt(3-(int)O*22-(int)O*(int)O),l*l<4&&(fabs(((time(0)-607728)%2551443)/405859.-4.7+acos(-l/2))<1.57))[" #"])):10);} -main(int _,char**o,char**O){return moon(_, (int)o, (int)O); } +#include +#include +double l; int moon(int _, int o, int O){ return putchar((_--+22&&_+44&&main(_,-43,_),_&&(int)o)?(main(-43,(int)++o,(int)O),((l=((int)o+21)/sqrt(3-(int)O*22-(int)O*(int)O),l*l<4&&(fabs(((time(0)-607728)%2551443)/405859.-4.7+acos(-l/2))<1.57))[" #"])):10);} main(int _,char**o,char**O){return moon(_, (int)o, (int)O); } diff --git a/2000/natori/natori.c b/2000/natori/natori.c index 8f0c7ac16..227aafb85 100644 --- a/2000/natori/natori.c +++ b/2000/natori/natori.c @@ -1,4 +1,3 @@ -double l; -int moon(int _, int o, int O){ -return putchar((_--+22&&_+44&&main(_,-43,_),_&&(int)o)?(main(-43,(int)++o,(int)O),((l=((int)o+21)/sqrt(3-(int)O*22-(int)O*(int)O),l*l<4&&(fabs(((time(0)-607728)%2551443)/405859.-4.7+acos(l/2))<1.57))[" #"])):10);} -main(int _,char**o,char**O){return moon(_, (int)o, (int)O); } +#include +#include +double l;int moon(int _, int o, int O){return putchar((_--+22&&_+44&&main(_,-43,_),_&&(int)o)?(main(-43,(int)++o,(int)O),((l=((int)o+21)/sqrt(3-(int)O*22-(int)O*(int)O),l*l<4&&(fabs(((time(0)-607728)%2551443)/405859.-4.7+acos(l/2))<1.57))[" #"])):10);}main(int _,char**o,char**O){return moon(_, (int)o, (int)O); } diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index bf46a67f7..c32199d36 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -1030,6 +1030,12 @@ segfault when run or not compile at all (gcc and clang respectively). Cody also provided alternate code that supports the southern hemisphere. +Later on Cody restored the `#include`s in the source code which had been changed +by us to make it a one-liner again but this was an error as it was not a +one-liner but rather a small program. At the same point Cody made the code +itself a one-line like the code is in the original entry. Now it looks much more +like the original entry but with the two fixes. + ## [2000/thadgavin](2000/thadgavin/thadgavin.c) ([README.md](2000/thadgavin/README.md]))