From 5d75caef9b52ed0982ef8e180eb3b9fa8395d807 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 29 Dec 2023 08:24:16 -0800 Subject: [PATCH] Remove 1986/wall alt code The alt code was just a patched (by Yusuke Endoh) version (two strings were strdup()d) that still required -traditional-cpp. He is still credited in the thanks file but one can do make diff_orig_prog to see what was changed to make it not require -traditional-cpp and Yusuke's fix is there too. The thanks file details what I had to do to make it work without -traditional-cpp and his change is still there as well. It seemed to serve no purpose to have an alt version that requires one to use -traditional-cpp when one can just look at the original code if they want to see what it was like back in 1986. --- 1986/wall/.gitignore | 1 - 1986/wall/Makefile | 7 ++-- 1986/wall/README.md | 24 -------------- 1986/wall/wall.alt.c | 78 -------------------------------------------- thanks-for-help.md | 10 +++--- 5 files changed, 7 insertions(+), 113 deletions(-) delete mode 100644 1986/wall/wall.alt.c diff --git a/1986/wall/.gitignore b/1986/wall/.gitignore index 9cb3a05e2..0c9449b2a 100644 --- a/1986/wall/.gitignore +++ b/1986/wall/.gitignore @@ -6,5 +6,4 @@ indent.c indent.o prog.orig wall -wall.alt wall.orig diff --git a/1986/wall/Makefile b/1986/wall/Makefile index 917e87929..dc9978805 100644 --- a/1986/wall/Makefile +++ b/1986/wall/Makefile @@ -117,8 +117,8 @@ OBJ= ${PROG}.o DATA= TARGET= ${PROG} # -ALT_OBJ= ${PROG}.alt.o -ALT_TARGET= ${PROG}.alt +ALT_OBJ= +ALT_TARGET= ################# # build the entry @@ -140,9 +140,6 @@ ${PROG}: ${PROG}.c alt: ${ALT_TARGET} @${TRUE} -${PROG}.alt: ${PROG}.alt.c - ${CC} ${CFLAGS} $< -o $@ ${LDFLAGS} - # data files # data: ${DATA} diff --git a/1986/wall/README.md b/1986/wall/README.md index a71aa4fde..05e8853c6 100644 --- a/1986/wall/README.md +++ b/1986/wall/README.md @@ -12,30 +12,6 @@ make all ``` -## Alternate code: - -If you have an old compiler or a compiler that supports `-traditional-cpp` you -might enjoy looking at the original source in [wall.alt.c](wall.alt.c). - - -### Alternate build: - -```sh -# if you have an old enough compiler: -make alt - -# or if you have gcc: -make CC=gcc alt - -# or if you have a compiler that supports -traditional-cpp that's not gcc: -make CFLAGS+="-traditional-cpp" alt -``` - -NOTE: gcc in macOS is actually clang even the binary `/usr/bin/gcc`. - -Use `./wall.alt` as you would `./wall`. - - ## Judges' remarks: The original version did not have a ';' character in the first line. diff --git a/1986/wall/wall.alt.c b/1986/wall/wall.alt.c deleted file mode 100644 index 1c938d49a..000000000 --- a/1986/wall/wall.alt.c +++ /dev/null @@ -1,78 +0,0 @@ -#define _c(C)_ (C)&('|'+3):c_()(C)>>('\n'-3) __; /**/ -#define C char* -#define keyboard ",,B3-u;.(&*5., /(b*(1\036!a%\031m,,,,,\r\n" -#define main(o,oo)oo(o){ -#define _ ;case -C -#define c_(cc)c cc= -#define C_(sand)_O(sand)witch -o=keyboard; -#define __ ;break; -C -ccc( -cc) -C -cc; -{ cc=strdup(cc); -C -cccc= -cc;int -#ifndef lint -#define keyboard "dijs QH.soav Vdtnsaoh DmfpaksoQz;kkt oa, -dijs" -#endif -c; -main(;c_(=(*cc);*cc++)c,for); -#define _O(s)s -main(0xb+(c>>5),C_(s)) -_'\v' -:__ _'\f': -main(c,C_(s)); -_c(8098)_c(6055)_c(14779)_c(10682) -#define O_(O)_O(O)stem(ccc( -_c(15276)_c(11196)_c(15150) -#define _C ;return -_c(11070)_c(15663)_c(11583) -} -__ -default -:c_(+)o[c&__LINE__-007]; -main(c_(-)'-'-1,C_(s))_ -0214 -:_ -0216 -:c_(+)025 _ -0207 -:c_(-)4 _ -0233 -:c_(+)' '-1; -}}c_(&)'z'+5; -}_C cccc; -}main(,cc) -C -#define O write(1, -c=strdup("O"); -O_(sy) keyboard)); -main(;;,for); -read(0, -c,1);* -c_(&)'~'+1 -;O ccc( -c), -'\0'); -main(*c, -C_(s));_ -4 -:O_(sy)";kkt -oa, dijszdijs QQ"))_C -_ -13 -:O o+' ', -3 -) -#undef main -__ _ 127:O"\b \b",3)__ -default -:O -c,1) -__}}}main(){ -cc(); -} diff --git a/thanks-for-help.md b/thanks-for-help.md index cc9789391..33d580a31 100644 --- a/thanks-for-help.md +++ b/thanks-for-help.md @@ -419,16 +419,13 @@ code](/1986/wall/wall.orig.c) to see how different C was in 1986, as well as below. [Yusuke](#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 -code](/1986/wall/wall.alt.c) is the version patched by Yusuke should you wish to -try it with a compiler that has the `-traditional-cpp`. See the README.md file -for details. +work with gcc but it still required `-traditional-cpp`. If you'd like to see the difference between the version that requires `-traditional-cpp` and the fixed version, try: ```sh -cd 1986/wall ; make diff_alt_prog +cd 1986/wall ; make diff_orig_prog ``` Some of the changes required: @@ -495,6 +492,9 @@ Some of the changes required: :system(ccc(";kkt -oa, dijszdijs QQ"));return +- And of course as noted two strings had to be `strdup()`d. + +There might have been other changes as well. # 1987