From 3e4b58cec0ab3829308cefe5d02a98275f2ae932 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 27 Oct 2023 09:49:59 -0700 Subject: [PATCH 1/2] Add what changed in 1986/wall to thanks file Just in case you want to go crazy :-) (I might as well have already been there so there was no risk involved for me :-) ) --- thanks-for-fixes.md | 74 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 70 insertions(+), 4 deletions(-) diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 72a80e2e4..fa80fd5c9 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -287,7 +287,7 @@ replaced for actual code so that instead of having the while loop condition as: loop as calling it will result in incorrect output, once you even get it to compile. See above where the loop has a body but the modification only has it commented out. - + ## [1986/hague](1986/hague/hague.c) ([README.md](1986/hague/README.md])) @@ -341,9 +341,10 @@ Cody noticed and fixed a funny mistake in the Makefile where a ## [1986/wall](1986/wall/wall.c) ([README.md](1986/wall/README.md])) Cody fixed this so that it does not require `-traditional-cpp`. This took a fair -bit of tinkering as this entry *is* strange; fixing `-traditional-cpp` is, as +bit of tinkering as this entry *very twisted*; fixing `-traditional-cpp` is, as noted earlier, very complicated, but we encourage you to look at [original -code](1986/wall/wall.orig.c) to see how different C was in 1986. +code](1986/wall/wall.orig.c) to see how different C was in 1986, as well as +below. Yusuke originally patched this to use `strdup()` on two strings and this let it work with gcc but it still required `-traditional-cpp`. The [alternate @@ -358,6 +359,71 @@ If you'd like to see the difference between the version that requires cd 1986/wall ; make diff_alt_prog ``` +Some of the changes required: + +- Instead of using the `c_`, defined as `c_(cc)c cc=`, like: + + c_(+)o + + /* ... */ + + :c_(+)' '-1; + }}c_(&)'z'+5; + + use: + + :c +=o[c&__LINE__-007]; + + /* ... */ + + :c+=' '-1; + }}c&='z'+5; + + Observe however that this macro is still used in the code like: + + main(;c_(=(*cc);*cc++)c,for); + +- Instead of code like: + + main(0xb+(c>>5),C_(s)) + _'\v' + :__ _'\f': + main(c,C_(s)); + + use instead: + + main(;c_(=(*cc);*cc++)c,for); + #define _O(s)s + switch(0xb+(c>>5)){ + _'\v' + :__ _'\f': + switch(c){; + +- The macro: + + #define C_(sand)_O(sand)witch + + could not be used like: + + C_(s));_ + + to create: + + switch);_ + + and neither could the macro: + + #define O_(O)_O(O)stem(ccc( + + be used like: + + :O_(sy)";kkt -oa, dijszdijs QQ"))_C + + to create: + + :system(ccc(";kkt -oa, dijszdijs QQ"));return + + ## [1987/heckbert](1987/heckbert/heckbert.c) ([README.md](1987/heckbert/README.md)) Cody made this look more like the original entry by restoring the `#define` of @@ -2442,7 +2508,7 @@ Cody fixed the script [run_clock.sh](2020/endoh3/run_clock.sh) which gave a funny error when running it: ```sh -$ ./run_clock.sh +$ ./run_clock.sh -bash: ./run_clock.sh: cannot execute: required file not found ``` From 86489389c6f2597b3a9588956fbc95cdcc7c9c51 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 27 Oct 2023 09:53:02 -0700 Subject: [PATCH 2/2] Try fixing formatting of 1986/wall in thanks --- thanks-for-fixes.md | 50 ++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index fa80fd5c9..1f44d08b4 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -363,65 +363,65 @@ Some of the changes required: - Instead of using the `c_`, defined as `c_(cc)c cc=`, like: - c_(+)o + c_(+)o - /* ... */ + /* ... */ - :c_(+)' '-1; - }}c_(&)'z'+5; + :c_(+)' '-1; + }}c_(&)'z'+5; use: - :c +=o[c&__LINE__-007]; + :c +=o[c&__LINE__-007]; - /* ... */ + /* ... */ - :c+=' '-1; - }}c&='z'+5; + :c+=' '-1; + }}c&='z'+5; Observe however that this macro is still used in the code like: - main(;c_(=(*cc);*cc++)c,for); + main(;c_(=(*cc);*cc++)c,for); - Instead of code like: - main(0xb+(c>>5),C_(s)) - _'\v' - :__ _'\f': - main(c,C_(s)); + main(0xb+(c>>5),C_(s)) + _'\v' + :__ _'\f': + main(c,C_(s)); use instead: - main(;c_(=(*cc);*cc++)c,for); - #define _O(s)s - switch(0xb+(c>>5)){ - _'\v' - :__ _'\f': - switch(c){; + main(;c_(=(*cc);*cc++)c,for); + #define _O(s)s + switch(0xb+(c>>5)){ + _'\v' + :__ _'\f': + switch(c){; - The macro: - #define C_(sand)_O(sand)witch + #define C_(sand)_O(sand)witch could not be used like: - C_(s));_ + C_(s));_ to create: - switch);_ + switch);_ and neither could the macro: - #define O_(O)_O(O)stem(ccc( + #define O_(O)_O(O)stem(ccc( be used like: - :O_(sy)";kkt -oa, dijszdijs QQ"))_C + :O_(sy)";kkt -oa, dijszdijs QQ"))_C to create: - :system(ccc(";kkt -oa, dijszdijs QQ"));return + :system(ccc(";kkt -oa, dijszdijs QQ"));return ## [1987/heckbert](1987/heckbert/heckbert.c) ([README.md](1987/heckbert/README.md))