Fix 2000/natori and add alt code

The author suggested alternate code for those in the southern hemisphere
which the natori.alt.c now has.
This commit is contained in:
Cody Boone Ferguson committed 2023-04-19 13:55:41 -07:00
1 parent a71e0f4c99
commit ce9bfca9c7
4 files changed
+23 -4

No files matched your search

+1
View File
@@ -1 +1,2 @@
natori
natori.alt
+2 -2
View File
@@ -113,8 +113,8 @@ OBJ= ${PROG}.o
DATA=
TARGET= ${PROG}
#
ALT_OBJ=
ALT_TARGET=
ALT_OBJ= ${PROG}.alt.o
ALT_TARGET= ${PROG}.alt
#################
+16 -2
View File
@@ -29,6 +29,20 @@ compile at all (gcc and clang respectively). Thank you Cody for your assistance!
echo "Do or do not. There is no try."
```
### Alternate code:
The author noted that those in the southern hemisphere might want to change
`acos(l/2)` into `acos(-l/2)`. Cody went ahead and made an alt version to do
this.
To run:
```sh
make alt
```
Use `natori.alt` as you would `natori`.
## Judges' remarks:
Here is a nice compact program that changes with the phase of the moon.
@@ -46,8 +60,8 @@ This program outputs a rough image of the moon in its current phase.
The main obfuscation of this entry is its complicated double recursion
(without any loop or conditional statement).
People living in the southern hemisphere may want to change acos(l/2)
into acos(-l/2).
People living in the southern hemisphere may want to change `acos(l/2)`
into `acos(-l/2)`.
## Copyright and CC BY-SA 4.0 License:
+4
View File
@@ -0,0 +1,4 @@
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); }