From ffc50a98a5c71b0df5c113976cfbd2e2d8e15a07 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Mon, 1 May 2023 10:31:29 -0700 Subject: [PATCH] Fix and format 2011/zucker/README.md There was a mistake in the try command where it would inject into the image the previous command specifically because of !! - must escape these even inside double quotes (there were three). Typo fixes here and there. Format fixes. Unlike the others I did not add any additional links as I am almost out of time for the day. I will look at this again another time as there were a number of things that I think would be improved with links. Fix author URL in README.md and winners.{csv,html}. --- 2011/zucker/README.md | 31 ++++++++++++++++++++----------- tmp/winners.csv | 2 +- winners.html | 2 +- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/2011/zucker/README.md b/2011/zucker/README.md index 75c43128c..a30775a41 100644 --- a/2011/zucker/README.md +++ b/2011/zucker/README.md @@ -1,8 +1,8 @@ # Most shiny - Matt Zucker - - +Matt Zucker + + ## To build: @@ -19,12 +19,21 @@ make ## Try: ```sh -./zucker "Hello!!!" > hello.ppm +./zucker "Hello\!\!\!" > hello.ppm ./zucker faster\! -preview > image2.ppm ``` Display the PPM image with your favorite image viewer. +The author gave options for macOS but we note that you can just do: + +```sh +open image.ppm +``` + +which will open `Preview.app` which will let you look at the image no problem. +No need to install additional software. + ## Judges' remarks: The rendered image is centered and is output as a 600 by 220 pixel PPM. @@ -36,7 +45,7 @@ This entry uses no local variables. None! At! All! ### An image generator -### What it does: +#### What it does: This program makes pretty pictures. To see the default output, try running @@ -62,7 +71,7 @@ program as follows: ./zucker "your text" > image.ppm ``` -To mitigate long runtimes, the program can be invoked in a "preview" +To mitigate long runtime, the program can be invoked in a "preview" mode by appending `-preview` to the command line arguments, like so: ```sh @@ -73,7 +82,7 @@ If your platform distinguishes between binary and text streams, you may need to insert some code to reopen standard output in binary mode at the start of `main`. An ASCII platform is assumed. -### Pedagogical value: +#### Pedagogical value: This program is quite suitable for the inexperienced programmer, due to a number of considerations: @@ -101,7 +110,7 @@ to a number of considerations: reflection ray at an object's surface, given the incoming direction and surface normal. -### Further details (contains spoilers): +#### Further details (contains spoilers): The program is not quite a traditional ray tracer, but a "sphere tracer" which uses distance fields to encode proximity to objects in @@ -135,14 +144,14 @@ it is impossible to modify either the image width or height without changing the source in at least three different places, including inside the large string literal. -Some of the functions are simple vector algebra operations such as +Some of the functions are simple vector algebraic operations such as vector construction, dot product, and normalization. However, it was found to be much more compact to define a single operation for multiply-and-add rather than to have separate functions for addition, subtraction, and scaling. Again, compactness led to obfuscation. This program heavily abuses `for` loops. The comma operator is used to -get as much milage as possible out of statements inside of loop +get as much mileage as possible out of statements inside of loop declarations. Between `for` loops, the comma operator, and the ternary operator, it was possible to avoid `if` and `while` altogether. @@ -155,7 +164,7 @@ performed just about everywhere. Fascinatingly, this doesn't seem to affect performance too badly. Sometimes when an explicit cast (i.e. from float to int) is needed, the program instead simply assigns to a free variable of the desired type instead. Both the `array[index]` -and `index[array]` notations are used interchangably throughout the +and `index[array]` notations are used interchangeably throughout the program. Two other programs were written to support development of this diff --git a/tmp/winners.csv b/tmp/winners.csv index a5da2e425..d8d21919d 100644 --- a/tmp/winners.csv +++ b/tmp/winners.csv @@ -122,7 +122,7 @@ Mark Isaak,Mark_Isaak,null,null,null,null,null,null Mark Plummer,Mark_Plummer,http://www.nrgnet.com/markus,null,markus@nrgnet.com,null,null,null Mark Schnitzius,Mark_Schnitzius,null,null,schnitzi@gmail.com,null,null,null Mary Ann Horton,Mary_Ann_Horton,https://maryannhorton.com,null,null,null,null -Matt Zucker,Matt_Zucker,http://www.swarthmore.edu/NatSci/mzucker1/,null,mzucker1@swarthmore.edu,null,null,null +Matt Zucker,Matt_Zucker,https://mzucker.github.io/swarthmore/,mzucker1@swarthmore.edu,null,null,null Maurizio Monge,Maurizio_Monge,null,null,maurizio.monge@gmail.com,IT,null,null Mauro Persano,Mauro_Persano,null,null,mauro_persano@yahoo.com,BR,null,null Michael Ash,Michael_Ash,null,null,mike@mikeash.com,US,null,null diff --git a/winners.html b/winners.html index 40d5ea90a..4457e8f28 100644 --- a/winners.html +++ b/winners.html @@ -1344,7 +1344,7 @@ Contest
  • Balanced use of obfuscation - Gold award (2012 zeitak)
    -
  • Matt Zucker -- http://www.swarthmore.edu/NatSci/mzucker1/ +
  • Matt Zucker -- https://mzucker.github.io/swarthmore/