From 7389312120f1a3a0a8e2eda2c3b740c21309bfc2 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 15 Oct 2023 12:31:51 -0700 Subject: [PATCH] Format fix and add alt code of 2014/deak The README.md file has been format fixed. The alt code is what the author provided but fixed to compile (a value was left off the 'return' in the code). This was added as alt code for fun and to help one appreciate the obfuscation all the more. The Makefile does allow one to build it by running 'make alt' but it is not explained how to configure it like the original was (explained by the author). This is left as an exercise to the readers. --- 2014/deak/.gitignore | 1 + 2014/deak/Makefile | 4 +-- 2014/deak/README.md | 67 +++++++++++++++++++++++++++++--------------- 2014/deak/prog.alt.c | 21 ++++++++++++++ thanks-for-fixes.md | 13 +++++++++ 5 files changed, 81 insertions(+), 25 deletions(-) create mode 100644 2014/deak/prog.alt.c diff --git a/2014/deak/.gitignore b/2014/deak/.gitignore index a1e7bc695..160504d00 100644 --- a/2014/deak/.gitignore +++ b/2014/deak/.gitignore @@ -1,2 +1,3 @@ prog +prog.alt prog.orig diff --git a/2014/deak/Makefile b/2014/deak/Makefile index 4d7912b24..77a6fc0d2 100644 --- a/2014/deak/Makefile +++ b/2014/deak/Makefile @@ -113,8 +113,8 @@ OBJ= ${PROG}.o DATA= TARGET= ${PROG} # -ALT_OBJ= -ALT_TARGET= +ALT_OBJ= ${PROG}.alt.o +ALT_TARGET= ${PROG}.alt ################# diff --git a/2014/deak/README.md b/2014/deak/README.md index 36d7553ea..2e6f2993d 100644 --- a/2014/deak/README.md +++ b/2014/deak/README.md @@ -1,7 +1,7 @@ # Most underscored argument - Ferenc Deak - +Ferenc Deak
+ ## To build: @@ -9,6 +9,9 @@ make ``` +There is an alternate version that the author provided but fixed in 2023 to +compile. See [alternate code](#alternate-code) below. + ## To run: ```sh @@ -21,9 +24,25 @@ make ./prog ``` -Changing bounding box coordinates in the source to explore +Try changing bounding box coordinates in the source to explore various regions of the fractal. +### Alternate code: + +The alternate code is included as [prog.alt.c](prog.alt.c) so you can more +easily see the difference in what it might look like if the C was more +recognisable. To use, try: + +```sh +make alt +``` + +Use `prog.alt` as you would `prog`. + +Bonus: the author explains how to configure the program but can you figure out +how to do it in the alternate code? + + ## Judges' remarks: We consider this entry a tribute to all "Abuse of the C preprocessor" @@ -52,25 +71,27 @@ The usage of recognizable elements from the C programming language in the application source code is intentionally kept to a bare minimum. If this phrase would not be true, the application would be the following: - double _[]={-2 - ,1,-1.3 ,1.3, 0, 0,0,0 - ,0 ,0,50, 80, 0,0,0 ,255 - , 8,0}; int main ( - int j) {if (j== 1 ){ if( - _[12] >_[10] )_[17]=1 ;} if - (_[13] >_[11 ] ||_[17]==1) return - ;_[6] = _ [13] / _[11]*(_[1]-_[ 0]) - +_[ 0]; _ [7]=_[12]/_[10]*(_[3]-_[2] )+_ - [2];_[8]=_[9]=_[14]=0;l2:_[4]=_[8] * _ [8] - ;_[ 5]= _ [9]*_[9];_[9]=2*_[8]*_[9]+ _[7 - ];_[8 ] = _ [ 4 ]-_[5]+_[6];_[14 ]++ - ;if((_ [14]< _ [15])&&(_[4]+ _[ 5] - <_[16 ])) goto l2; putchar( - " #@*+ "[( int) _[14]% - 5 ]);_ [13 ] ++ ; main ( - 0) ;_[12]++; _[13] =0 - ;if(_ [17] !=1) putchar - (0xa); main(1);} +```c +double _[]={-2 +,1,-1.3 ,1.3, 0, 0,0,0 +,0 ,0,50, 80, 0,0,0 ,255 +, 8,0}; int main ( + int j) {if (j== 1 ){ if( + _[12] >_[10] )_[17]=1 ;} if + (_[13] >_[11 ] ||_[17]==1) return 1 + ;_[6] = _ [13] / _[11]*(_[1]-_[ 0]) ++_[ 0]; _ [7]=_[12]/_[10]*(_[3]-_[2] )+_ +[2];_[8]=_[9]=_[14]=0;l2:_[4]=_[8] * _ [8] +;_[ 5]= _ [9]*_[9];_[9]=2*_[8]*_[9]+ _[7 + ];_[8 ] = _ [ 4 ]-_[5]+_[6];_[14 ]++ + ;if((_ [14]< _ [15])&&(_[4]+ _[ 5] + <_[16 ])) goto l2; putchar( + " #@*+ "[( int) _[14]% +5 ]);_ [13 ] ++ ; main ( +0) ;_[12]++; _[13] =0 +;if(_ [17] !=1) putchar +(0xa); main(1);} +``` The application expects no parameters, the only way you can change the behaviour is to modify the source code at the indicated location: the line @@ -81,7 +102,7 @@ fractal to be drawn on the screen. ### Compiler warnings Yes, unfortunately there are compiler warnings of the kind "initialization makes -integer from pointer without a cast" the provided Makefile automatically +integer from pointer without a cast" but the provided Makefile automatically disables them. ## Copyright and CC BY-SA 4.0 License: diff --git a/2014/deak/prog.alt.c b/2014/deak/prog.alt.c new file mode 100644 index 000000000..2e7692977 --- /dev/null +++ b/2014/deak/prog.alt.c @@ -0,0 +1,21 @@ +#include +double _[]={-2 +,1,-1.3 ,1.3, 0, 0,0,0 +,0 ,0,50, 80, 0,0,0 ,255 +, 8,0}; int main ( + int j) {if (j== 1 ){ if( + _[12] >_[10] )_[17]=1 ;} if + (_[13] >_[11 ] ||_[17]==1) return 1 + ;_[6] = _ [13] / _[11]*(_[1]-_[ 0]) ++_[ 0]; _ [7]=_[12]/_[10]*(_[3]-_[2] )+_ +[2];_[8]=_[9]=_[14]=0;l2:_[4]=_[8] * _ [8] +;_[ 5]= _ [9]*_[9];_[9]=2*_[8]*_[9]+ _[7 + ];_[8 ] = _ [ 4 ]-_[5]+_[6];_[14 ]++ + ;if((_ [14]< _ [15])&&(_[4]+ _[ 5] + <_[16 ])) goto l2; putchar( + " #@*+ "[( int) _[14]% +5 ]);_ [13 ] ++ ; main ( +0) ;_[12]++; _[13] =0 +;if(_ [17] !=1) putchar +(0xa); main(1);} + diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index d2eb0202b..277be5a0e 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -1791,6 +1791,19 @@ second between commands. Cody added explicit linking of libm (`-lm`) as not all systems do this implicitly (linux doesn't seem to but macOS does). +## [2014/deak](2014/deak/prog.c) ([README.md](2014/deak/README.md)) + +Cody fixed the code that the author provided which would be what the program +would look like if, as the author put it: + +> The usage of recognizable elements from the C programming language in the +application source code is intentionally kept to a bare minimum. If this phrase +would not be true, the application would be the following: + +It did not compile because a value was left off the `return` statement. + +Cody added this as alternate code just for fun and so one can more easily see +the difference to really appreciate the obfuscation. ## [2014/maffiodo1](2014/maffiodo1/maffiodo1.c) ([README.md](2014/maffiodo1/README.md]))