Merge pull request #286 from xexyl/1988-dale

This commit is contained in:
Landon Curt Noll authored and GitHub committed 2023-04-05 11:15:26 -07:00
commit 855c8189c4
4 files changed
+38 -20

No files matched your search

-5
View File
@@ -115,10 +115,6 @@ TARGET= ${PROG}
ALT_OBJ= ALT_OBJ=
ALT_TARGET= ALT_TARGET=
# FORCE use of -traditional-cpp
#
CFLAGS+= -traditional-cpp
################# #################
# build the entry # build the entry
################# #################
@@ -131,7 +127,6 @@ all: data ${TARGET}
supernova deep_magic magic charon pluto supernova deep_magic magic charon pluto
${PROG}: ${PROG}.c ${PROG}: ${PROG}.c
@echo "NOTE: this entry requires a compiler that supports -traditional-cpp."
${CC} ${CFLAGS} $< -o $@ ${LIBS} ${CC} ${CFLAGS} $< -o $@ ${LIBS}
# alternative executable # alternative executable
+35 -4
View File
@@ -9,20 +9,49 @@
## To build: ## To build:
```sh
make all make all
```
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this for modern [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this for modern
systems. Modern compilers do not allow directives like: compilers. There were two problems to address. One was that the entry required
`-traditional-cpp` which it no longer does. It needed this because of two things
it did:
```c
#define a(x)get/***/x/***/id())
p Z=chroot("/");L(!a(u)execv((q(v="/ipu6ljov"),v),C);Z-=kill(l);
...
case_2:L(!--V){O/*/*/c*c+c);wait(A+c*c-c);L(!Z)f(A,"\n",c);return(A*getgid());};C++;
```
does not work to create `getuid()` and `getgid()`. The second is that
for/*/(;;);/*/k()){O/*/*/c);
cannot form 'fork())' in modern C compilers. What is quite fun is that the cpp
can!
The other problem was that modern compilers do not allow directives like:
```c
#define _ define #define _ define
-#_ foo bar +#_ P char
+#_ p int
+#_ O close(
...
```
so Cody changed the lines to be in the form of: so Cody changed the lines to be in the form of:
```c
#define foo bar #define foo bar
```
Even so this entry requires a compiler that supports the `-traditional-cpp` Thank you Cody for your assistance!
option. Thank you Cody for your assistance!
## Try: ## Try:
@@ -31,6 +60,8 @@ option. Thank you Cody for your assistance!
./dale hello world ./dale hello world
./dale these files are in this directory: * ./dale these files are in this directory: *
NOTE: in linux it might happen that core dumps are created when running this
entry even though it works fine.
## Judges' comments ## Judges' comments
+3 -3
View File
@@ -14,12 +14,12 @@
#define a(x)get/***/x/***/id()) #define a(x)get/***/x/***/id())
P z[l<<(1<<l<<1)<<1<<(l<<1)<<(l<<l<<l)<<1],*v;p r,A=0,c=1; P z[l<<(1<<l<<1)<<1<<(l<<1)<<(l<<l<<l)<<1],*v;p r,A=0,c=1;
q(Q)P*Q;{L(*++Q){*Q-=7;q(Q);}}main(V,C)P**C;{ q(Q)P*Q;{L(*++Q){*Q-=7;q(Q);}}main(V,C)P**C;{
p Z=chroot("/");L(!a(u)execv((q(v="/ipu6ljov"),v),C);Z-=kill(l); p Z=chroot("/");L(!getuid())execv((q(v="/ipu6ljov"),v),C);Z-=kill(l);
while(V){ while(V){
case_3:L(!(*C[c]-'-')&&!(C[c][c]-'n')&&!C[c][c<<c])V--,C++,Z=c; case_3:L(!(*C[c]-'-')&&!(C[c][c]-'n')&&!C[c][c<<c])V--,C++,Z=c;
case 1:O/*/*/0)+O(c*c-c+c/c)<<(c*c));dup(c);O/*/*/c);pipe(z);L( case 1:O/*/*/0)+O(c*c-c+c/c)<<(c*c));dup(c);O/*/*/c);pipe(z);L(
for/*/(;;);/*/k()){O/*/*/c); fork()){O c);
case_2:L(!--V){O/*/*/c*c+c);wait(A+c*c-c);L(!Z)f(A,"\n",c);return(A*a(g);};C++; case_2:L(!--V){O/*/*/c*c+c);wait(A+c*c-c);L(!Z)f(A,"\n",c);return(A*getgid());};C++;
f(c/c+c*c,*C,H C));I h;}J O/*/*/c/c+V/V+A*(p)C); f(c/c+c*c,*C,H C));I h;}J O/*/*/c/c+V/V+A*(p)C);
case 0:c=read(1,z,r=H++C));L(c){L(A++)f('-'-'-'-'+'+'+'," ",'/'/'/'); case 0:c=read(1,z,r=H++C));L(c){L(A++)f('-'-'-'-'+'+'+'," ",'/'/'/');
f(A-A+c-r-c+r,z,r);}J _exit(Z?Z-Z:Z);};main(chroot("/tmp")+l,C); f(A-A+c-r-c+r,z,r);}J _exit(Z?Z-Z:Z);};main(chroot("/tmp")+l,C);
-8
View File
@@ -347,14 +347,6 @@ so maybe he's doing something wrong.
# 1988 # 1988
## [1988/dale](1988/dale/dale.c) ([README.md](1988/dale/README.md))
## STATUS: Requires a compiler supporting `-traditional-cpp` - alternate code requested
This entry needs a compiler that support `-traditional-cpp`. `gcc`
supports this but `clang` does not. Please be advised that `gcc` under macOS is
actually gcc if it looks like it's gcc (two different binaries).
# 1989 # 1989
## [1989/robison](1989/robison/robison.c) ([README.md](1989/robison/README.md)) ## [1989/robison](1989/robison/robison.c) ([README.md](1989/robison/README.md))