diff --git a/2012/deckmyn/README.md b/2012/deckmyn/README.md index 44ec2b4f5..17afb38d3 100644 --- a/2012/deckmyn/README.md +++ b/2012/deckmyn/README.md @@ -45,8 +45,7 @@ command line is an abuse of [C Shell](https://en.wikipedia.org/wiki/C_shell). Please use [Bourne-family shells](https://en.wikipedia.org/wiki/Bourne_shell) to run this entry. -... but in 2023 we changed the backticks to be the bash `$(..)` construct. This -is not done in the author's remarks, however. +... but in 2023 we changed the backticks to be the bash `$(..)` construct. ## Author's remarks: @@ -58,7 +57,7 @@ manual input as below) ready and a program capable of showing [.pbm bitmap format](https://en.wikipedia.org/wiki/Netpbm) images. ``` - ./deckmyn "`cat deckmyn.c`" "`cat example_greensleeves`" > greensleeves.pbm + ./deckmyn "$(cat deckmyn.c)" "$(cat example_greensleeves)" > greensleeves.pbm ``` If you have macOS you can open the image like: @@ -72,7 +71,7 @@ normally open an image. ``` - ./deckmyn "`cat deckmyn.c`" "KF m44c4 c4 g4 g4 : a4 a4 g2 :; " > short_bass.pbm + ./deckmyn "$(cat deckmyn.c)" "KF m44c4 c4 g4 g4 : a4 a4 g2 :; " > short_bass.pbm ``` If you have macOS you can open the image like: @@ -101,7 +100,7 @@ The program expects *two command line arguments*. The first is a (very long) string that contains the complete music font. Note that it should *not* be given as a file name! The default music font is encoded in the (whitespace of the) source code [deckmyn.c](%%REPO_URL%%/2012/deckmyn/deckmyn.c) itself. Therefore, the first argument should -be `"`` ` ``cat deckmyn.c`` ` ``"`. +be `"$(cat deckmyn.c)"`. The second command line argument is the music itself. This is, again, a string, not a file name. All music signs are entered as tokens of exactly 3 characters. diff --git a/2012/deckmyn/index.html b/2012/deckmyn/index.html index b60638197..ed0e5cda2 100644 --- a/2012/deckmyn/index.html +++ b/2012/deckmyn/index.html @@ -431,19 +431,18 @@ chip (a sound processor?).
command line is an abuse of C Shell. Please use Bourne-family shells to run this entry. -… but in 2023 we changed the backticks to be the bash $(..) construct. This
-is not done in the author’s remarks, however.
… but in 2023 we changed the backticks to be the bash $(..) construct.
You need the source code and example input (either one of the example files, or manual input as below) ready and a program capable of showing .pbm bitmap format images.
- ./deckmyn "`cat deckmyn.c`" "`cat example_greensleeves`" > greensleeves.pbm
+ ./deckmyn "$(cat deckmyn.c)" "$(cat example_greensleeves)" > greensleeves.pbm
If you have macOS you can open the image like:
open greensleeves.pbm
… otherwise, you’ll have to open it in your viewer of choice how you would normally open an image.
- ./deckmyn "`cat deckmyn.c`" "KF m44c4 c4 g4 g4 : a4 a4 g2 :; " > short_bass.pbm
+ ./deckmyn "$(cat deckmyn.c)" "KF m44c4 c4 g4 g4 : a4 a4 g2 :; " > short_bass.pbm
If you have macOS you can open the image like:
open short_bass.pbm
… otherwise, you’ll have to open it in your viewer of choice how you would @@ -461,7 +460,7 @@ etc.
string that contains the complete music font. Note that it should not be given as a file name! The default music font is encoded in the (whitespace of the) source code deckmyn.c itself. Therefore, the first argument should -be"`` cat deckmyn.c ``".
+be "$(cat deckmyn.c)".
The second command line argument is the music itself. This is, again, a string, not a file name. All music signs are entered as tokens of exactly 3 characters. The code is very sensitive to bad spacing! So for instance, if you use a file to diff --git a/2012/endoh1/README.md b/2012/endoh1/README.md index b105ce7ec..087303f91 100644 --- a/2012/endoh1/README.md +++ b/2012/endoh1/README.md @@ -16,7 +16,7 @@ section below for more details. ./endoh1 < file ``` -WARNING: if you're sensitive to/don't like flashing colours/text or just want to +**WARNING**: if you're sensitive to/don't like flashing colours/text or just want to see what this looks like not going so fast then you might wish to try the [Alternate code](#alternate-code) instead. diff --git a/2012/endoh1/index.html b/2012/endoh1/index.html index d588aa90b..aeaeb3a70 100644 --- a/2012/endoh1/index.html +++ b/2012/endoh1/index.html @@ -418,7 +418,7 @@ judges at the time of the contest). Another version is the deobfuscated version provided by the author as well. See the Alternate code section below for more details.
./endoh1 < file
-WARNING: if you’re sensitive to/don’t like flashing colours/text or just want to +
WARNING: if you’re sensitive to/don’t like flashing colours/text or just want to see what this looks like not going so fast then you might wish to try the Alternate code instead.
The author stated:
- If there is a division by zero, square-root of a negative number, or similar
- operation, then the results are undefined.
++If there is a division by zero, square-root of a negative number, or similar +operation, then the results are undefined.
+
The author stated:
- The memory locations of `argv` are used for various purposes. Therefore, the
- program name (default `deckmyn`) must be *at least 4 characters long*, including
- possibly the path. This, along with the ending `'\0'`, gives a minimum 5 bytes of
- useful memory space. Otherwise, the program may attempt to write outside the
- string.
-
- The code is quite sensitive. Errors in the input can lead to strange results.
- The code does not read beyond the end of the music input, but that is about the
- only error checking available. Any input that is not according to the rules in
- the deckmyn.html, may cause errors.
-
- The program has no special hardware limitations or requirements, other than 8bit
- `char` (`signed` or `unsigned`) and two's complement negatives.
-
- The limitations of using `char` as counters for e.g. the number of music staves
- are minor. 127 staves to a page is rather a lot.
-
- The file layout must be exactly the same as deckmyn.c though, only the locations
- of space (`" "`) may differ.
-
- Every element in the music is given by a string of *exactly* 3 characters. Any
- violation of this will result in the rest of the music being interpreted in some
- randomly wrong way. Notice that in a file, the newline is also a character!
- Therefore, when preparing music in a file, care should be taken that the last
- musical element of a line is only 2 characters!
++The memory locations of
+argvare used for various purposes. Therefore, the +program name (defaultdeckmyn) must be at least 4 characters long, including +possibly the path. This, along with the ending'\0', gives a minimum 5 bytes +of useful memory space. Otherwise, the program may attempt to write outside the +string.The code is quite sensitive. Errors in the input can lead to strange +results. The code does not read beyond the end of the music input, but that is +about the only error checking available. Any input that is not according to the +rules in the deckmyn.html, may cause errors.
+The program has no special hardware limitations or requirements, other than +8bit
+char(signedorunsigned) and two’s complement negatives.The limitations of using
+charas counters for e.g. the number of music +staves are minor. 127 staves to a page is rather a lot.The file layout must be exactly the same as deckmyn.c though, only the +locations of space (
+" ") may differ.Every element in the music is given by a string of exactly 3 characters. +Any violation of this will result in the rest of the music being interpreted in +some randomly wrong way. Notice that in a file, the newline is also a character! +Therefore, when preparing music in a file, care should be taken that the last +musical element of a line is only 2 characters!
+
The manual referred to is here.
The author stated:
- If the input doesn't start with a valid program, that is,
- if the interpreter reaches end-of-file during program parsing,
- it will crash in some way. E.g. the following might dump core:
-
- echo -n "U" | ./tromp
-
- Furthermore, the interpreter requires the initial encoded lambda term to be closed,
- that is, variable n can only appear within at least 'n' enclosing lambdas.
- For instance, here the term '\ 5' is not closed, causing the interpreter to crash when
- looking into a null-pointer environment:
-
- echo ">Hello, world" | ./tromp
-
- will likely dump core.
++If the input doesn’t start with a valid program, that is, if the interpreter +reaches end-of-file during program parsing, it will crash in some way. E.g. the +following might dump core:
++
echo -n "U" | ./trompFurthermore, the interpreter requires the initial encoded lambda term to be +closed, that is, variable n can only appear within at least ‘n’ enclosing +lambdas. For instance, here the term
+'\ 5'is not closed, causing the +interpreter to crash when looking into a null-pointer environment:+
echo ">Hello, world" | ./trompwill likely dump core.
+