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.
This commit is contained in:
Cody Boone Ferguson committed 2023-12-29 08:24:16 -08:00
1 parent 45e8c3e5df
commit 5d75caef9b
5 files changed
+7 -113

No files matched your search

-1
View File
@@ -6,5 +6,4 @@ indent.c
indent.o
prog.orig
wall
wall.alt
wall.orig
+2 -5
View File
@@ -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}
-24
View File
@@ -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.
-78
View File
@@ -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();
}
+5 -5
View File
@@ -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.
# <a name="1987"></a>1987