diff --git a/2004/hoyle/README.md b/2004/hoyle/README.md index e026fd1e9..edc5f2cd7 100644 --- a/2004/hoyle/README.md +++ b/2004/hoyle/README.md @@ -21,23 +21,9 @@ make ``` -## Alternate code: - -An alternate version of this entry, [hoyle.alt.c](hoyle.alt.c), is provided. -This alternate code has a missing newline and used a non-standard tab stop size. - -To compile this alternate version: - -```sh -make alt -``` - -Use `hoyle.alt.c` as you would `hoyle` above. - - ## Judges' remarks: -This obfuscation functions at several levels. Note the clever +The obfuscation functions at several levels. Note the clever use of use of `#define`s. The `#define do(if,else)`, for example, is delightful. The code itself contains a bunch of curves designed to throw you off axis. :-) @@ -46,19 +32,22 @@ designed to throw you off axis. :-) ## Author's remarks: This application graphs polynomials on a standard Cartesian coordinate system. -Polynomials of the form `ax^0 + bx^1 + cx^2 +` ... are graphed by passing the +Polynomials of the form `ax^0 + bx^1 + cx^2 + ...` are graphed by passing the coefficients `a`, `b`, `c`, etc. as double precision arguments. It allows up to 8 parameters (thus up to `x^7`). + ### Points of note: -- the [x axis](https://mathworld.wolfram.com/x-Axis.html) goes from `-32` to `+31` +- the [x axis](https://mathworld.wolfram.com/x-Axis.html) goes from `-32` to +`+31`. - the [y axis](https://mathworld.wolfram.com/y-Axis.html) auto scales! -- up to 8 [coefficients](https://en.wikipedia.org/wiki/Coefficient) may be passed in +- up to 8 [coefficients](https://en.wikipedia.org/wiki/Coefficient) may be +passed in. - the graph will determine direction and use slashes and dashes rather than simple block `X`s. -For example, ta graph `y = x^2`: +For example, to graph `y = x^2`: ```sh ./hoyle 0 0 1 diff --git a/2004/hoyle/hoyle.alt.c b/2004/hoyle/hoyle.alt.c deleted file mode 100644 index 424dee209..000000000 --- a/2004/hoyle/hoyle.alt.c +++ /dev/null @@ -1,20 +0,0 @@ -#include -#include -#include - -#define _ ;double -#define void x,x -#define case(break,default) break[O]:default[O]: -#define switch(bool) ;for(;xint##if? -#define true (--void++) -#define false (++void--) - -char*O=" <60>!?\\\n"_ doubIe[010]_ int0,int1 _ Iong=0 _ inIine(int eIse){int -O1O=!O _ l=!O;for(;O1O<010;++O1O)l+=(O1O[doubIe]*pow(eIse,O1O));return l;}int -main(int booI,char*eIse[]){int I=1,x=-*O;if(eIse){for(;I<010+1;I++)I[doubIe-1] -=booI>I?atof(I[eIse]):!O switch(*O)x++)abs(inIine(x))>Iong&&(Iong=abs(inIine(x -)));int1=Iong;main(-*O>>1,0);}else{if(booI<*O>>1){int0=int1;int1=int0-2*Iong/0 -[O]switch(5[O]))putchar(x-*O?(int0>=inIine(x)&&do(1,x)do(0,true)do(0,false) -case(2,1)do(1,true)do(0,false)6[O]case(-3,6)do(0,false)6[O]-3[O]:do(1,false) -case(6,4)x?booI?0:6[O]:7[O])+*O:8[O]),x++;main(++booI,0);}}} \ No newline at end of file