From 696fef731a26ecf986c3d9995428813bb01cf215 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 24 Nov 2023 10:01:20 -0800 Subject: [PATCH] Format/typo check 2006/sloane + change alt default The README.md file has been format/typo checked. The alt code default usleep(3) value has been increased from 65000 to 75000. This should complete 2006/sloane. --- 2006/sloane/Makefile | 2 +- 2006/sloane/README.md | 12 +++++++----- thanks-for-fixes.md | 8 ++++---- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/2006/sloane/Makefile b/2006/sloane/Makefile index 27dbb6129..3409f6b7c 100644 --- a/2006/sloane/Makefile +++ b/2006/sloane/Makefile @@ -59,7 +59,7 @@ ARCH= # Defines that are needed to compile # -CDEFINE= -DS=65000 +CDEFINE= -DS=75000 # Include files that are needed to compile # diff --git a/2006/sloane/README.md b/2006/sloane/README.md index 2cb3c0dfe..18d10b22e 100644 --- a/2006/sloane/README.md +++ b/2006/sloane/README.md @@ -20,7 +20,7 @@ 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 `-DS=65000` but you can easily change +value used in `usleep()`. The default is `-DS=75000` but you can easily change it. To do so try: ```sh @@ -73,13 +73,13 @@ at first blush, this looks like a self-reproducing program. ## Author's remarks: This program doesn't require any special build options, other than that it -uses `sin()` and `cos()` and hence requires the math library. +uses `sin(3)` and `cos(3)` and hence requires the math library. You will almost certainly get a compiler warning because I declared a bunch -of global ints without types. The code looks better this way, though, I +of global `int`s without types. The code looks better this way, though, I think. There are also no `#include`s, so there may be warnings for -undeclared references to `printf()`, etc. There's a chance that my failure to -include `math.h` or declare `sin()` or `cos()` will make the +undeclared references to `printf(3)`, etc. There's a chance that my failure to +include `math.h` or declare `sin(3)` or `cos(3)` will make the [donut](https://en.wikipedia.org/wiki/Doughnut) not render properly -- it's worked on every system I've tried so far though. @@ -98,6 +98,7 @@ escape codes for clearing the screen and moving the cursor back to the top-left. The donut isn't raytraced. It's much simpler than that. + ### How is it obfuscated? There are three main pieces to this program: the donut, the checkerboard, and @@ -109,6 +110,7 @@ into the smallest I could make it by any means necessary. The logo can actually be compressed much better (ironically, by doing something simpler), but I didn't discover this until well after submitting. + ### Puzzles In increasing order of difficulty: diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index d51fac310..cbfc000d3 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -2991,9 +2991,9 @@ 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. -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. +Cody also provided 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_. 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 @@ -3010,7 +3010,7 @@ 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. +program in some systems he also added `-include ...` to the Makefile as well. ## [2006/stewart](2006/stewart/stewart.c) ([README.md](2006/stewart/README.md]))