diff --git a/2006/sloane/Makefile b/2006/sloane/Makefile index 458cc5d87..574c72680 100644 --- a/2006/sloane/Makefile +++ b/2006/sloane/Makefile @@ -59,7 +59,7 @@ ARCH= # Defines that are needed to compile # -CDEFINE= -DZ=65000 +CDEFINE= -DS=65000 # Include files that are needed to compile # diff --git a/2006/sloane/README.md b/2006/sloane/README.md index f2d2880d7..68185667d 100644 --- a/2006/sloane/README.md +++ b/2006/sloane/README.md @@ -25,11 +25,11 @@ see the [original code](#original-code) section. This alternate version, which we recommend that you use in order to see what is happening with modern systems, and to not flash too quickly, which can be problematic for some people, can be configured to different speeds by way of the -value used in `usleep()`. The default is `-DZ=65000` but you can easily change +value used in `usleep()`. The default is `-DS=65000` but you can easily change it. To do so try: ```sh -make CDEFINE="-DZ=70000" clobber alt +make CDEFINE="-DS=70000" clobber alt ./sloane.alt ``` @@ -37,7 +37,7 @@ If you wish to make it like the original, as if the below [Original code](#original-code) was being used, you can do: ```sh -make CDEFINE="-DZ=0" clobber alt +make CDEFINE="-DS=0" clobber alt ./sloane.alt ``` diff --git a/2006/sloane/sloane.alt.c b/2006/sloane/sloane.alt.c index 3a0c6362f..07968a165 100644 --- a/2006/sloane/sloane.alt.c +++ b/2006/sloane/sloane.alt.c @@ -13,7 +13,7 @@ KXw{Y" "RsFwsFwsFw{zaqyaz|FmMpyaoyI\\]cuUw{J" "~|_."[c(6,"b" "cd\\a[g","^`" "_e" "]fh")+8], p( "#$%" "&'()*+,-.1"[ c(11 ,"_ac[]\\YZi" "jkm", "`bd^efghXWlV" )+13 - ]-34,a);}main (k ){ float z[1920] ,A=0 + ]-34,a);}main (k,Z )char**Z;{float z[1920] ,A=0 ,B=0 ,i,j; puts("" "\x1b" "[2J");for(;; ) { float e=sin(A ), n= sin(B),g=cos( A),m =cos(B);for(k =0;k< 1840;k++)y=-k @@ -27,6 +27,6 @@ A),m =cos(B);for(k =0;k< 1840;k++)y=-k g)*m-c* d*e-f*g-l*d*n);if(D>z[o] )z[o] =D,b[o] =" ..,,-++=#$@"[ N>0?N:0 ] ; } printf( - "\x1b[" "H" );usleep(Z);for(k =1;1841 + "\x1b[" "H" );usleep(S);for(k =1;1841 >k;k++) putchar (k%80?b [k]:10) ; A += 0.053;B +=0.037 ; } } diff --git a/2006/sloane/sloane.c b/2006/sloane/sloane.c index cb8dae6c2..b1b292dac 100644 --- a/2006/sloane/sloane.c +++ b/2006/sloane/sloane.c @@ -13,7 +13,7 @@ KXw{Y" "RsFwsFwsFw{zaqyaz|FmMpyaoyI\\]cuUw{J" "~|_."[c(6,"b" "cd\\a[g","^`" "_e" "]fh")+8], p( "#$%" "&'()*+,-.1"[ c(11 ,"_ac[]\\YZi" "jkm", "`bd^efghXWlV" )+13 - ]-34,a);}main (k ){ float z[1920] ,A=0 + ]-34,a);}main (k,Z )char**Z;{float z[1920] ,A=0 ,B=0 ,i,j; puts("" "\x1b" "[2J");for(;; ) { float e=sin(A ), n= sin(B),g=cos( A),m =cos(B);for(k =0;k< 1840;k++)y=-k diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 558ecaf4c..1f987f2cd 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -1859,19 +1859,27 @@ Cody fixed this entry to work with clang which has a defect with the args to `main()`: it requires specific types: `int` and `char **` for the first and latter args. -Curiously, although clang requires the types of args to be strictly -correct it allows for only one arg which Cody made it as the second arg was not -used and this allows for a closer match to the original format of the entry. - -He also made sure that the Makefile links in `libm` as not all systems do this by default. - -Since the author suggested that the lack of certain `#include`s might break the -program in some systems he added `-include ...` to the Makefile as well. - The [alternate version](2006/sloane/sloane.alt.c), which allows one to see what is going on in modern systems, and which we recommend one use _first_, was provided by Cody. +Curiously, although clang requires the types of args to be strictly correct, +some versions do allow only one arg. This was done at first because it's not +used but Cody discovered that later versions of clang have an additional defect +where it does not allow only one arg so the second arg to `main()` was added +back. This was an unfortunate problem for the alt code as he has been using Z +for alt code `usleep()` (for sleep) but +in this case unfortunately the original entry used `Z` in `main()` (though +unused) so to make it more like the original Cody renamed the macro `Z` for +`usleep()` to `S` instead which can stand for sleep and also it is kind of like +a backwards `Z`. That way `Z` could be in `main()`. + +Cody also made sure that the Makefile links in `libm` as not all systems do this +by default. + +Since the author suggested that the lack of certain `#include`s might break the +program in some systems he added `-include ...` to the Makefile as well. + ## [2006/toledo2](2006/toledo2/toledo2.c) ([README.md](2006/toledo2/README.md]))