Merge pull request #340 from xexyl/1992-lush
This commit is contained in:
3 files changed
+13
-187
No files matched your search
+2
-2
@@ -112,8 +112,8 @@ OBJ= ${PROG}.o
|
|||||||
DATA=
|
DATA=
|
||||||
TARGET= ${PROG}
|
TARGET= ${PROG}
|
||||||
#
|
#
|
||||||
ALT_OBJ= ${PROG}.alt.o
|
ALT_OBJ=
|
||||||
ALT_TARGET= ${PROG}.alt
|
ALT_TARGET=
|
||||||
|
|
||||||
|
|
||||||
#################
|
#################
|
||||||
|
|||||||
+11
-18
@@ -1,17 +1,21 @@
|
|||||||
# Worst Abuse of the C Preprocessor:
|
# Worst Abuse of the C Preprocessor:
|
||||||
|
|
||||||
Ed Luke
|
Ed Luke
|
||||||
Mississippi State University
|
Mississippi State University
|
||||||
P.O. Box 6176
|
P.O. Box 6176
|
||||||
Mississippi State, MS 39762, USA
|
Mississippi State, MS 39762, USA
|
||||||
|
|
||||||
## To build:
|
## To build:
|
||||||
|
|
||||||
make all
|
```sh
|
||||||
|
make all
|
||||||
|
```
|
||||||
|
|
||||||
## To run:
|
## To run:
|
||||||
|
|
||||||
./runme.sh
|
```sh
|
||||||
|
./runme.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
[Yusuke Endoh](/winners.html#Yusuke_Endoh) supplied a patch which makes this
|
[Yusuke Endoh](/winners.html#Yusuke_Endoh) supplied a patch which makes this
|
||||||
@@ -23,18 +27,7 @@ instead of `gets()` and also added the `runme.sh` script to demonstrate it
|
|||||||
(using make was problematic). Cody notes that unfortunately this does not work
|
(using make was problematic). Cody notes that unfortunately this does not work
|
||||||
with clang due to different compiler messages. Thank you Cody!
|
with clang due to different compiler messages. Thank you Cody!
|
||||||
|
|
||||||
For the original entry see [lush.alt.c](lush.alt.c) described in the `Alternate
|
For the original entry see the [archive tarball](/archive/archive-1992.tar.bz2).
|
||||||
code` section below.
|
|
||||||
|
|
||||||
### Alternate code:
|
|
||||||
|
|
||||||
For the original source (fixed to work with gcc) which uses gets() try:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
make alt
|
|
||||||
```
|
|
||||||
|
|
||||||
Use `lush.alt` as you would `lush`.
|
|
||||||
|
|
||||||
|
|
||||||
## Judges' comments:
|
## Judges' comments:
|
||||||
|
|||||||
@@ -1,167 +0,0 @@
|
|||||||
#define f 000:
|
|
||||||
char
|
|
||||||
*s,*
|
|
||||||
t,v;
|
|
||||||
char
|
|
||||||
_ [
|
|
||||||
999]
|
|
||||||
,x [
|
|
||||||
999]
|
|
||||||
,*p=
|
|
||||||
x ;
|
|
||||||
char
|
|
||||||
*av[
|
|
||||||
]= {
|
|
||||||
"W",
|
|
||||||
"H",
|
|
||||||
"o",
|
|
||||||
"l",
|
|
||||||
"N",
|
|
||||||
"e",
|
|
||||||
" ",
|
|
||||||
"r",
|
|
||||||
"d",
|
|
||||||
".",
|
|
||||||
"m",
|
|
||||||
"s",
|
|
||||||
"g",
|
|
||||||
"!",
|
|
||||||
"*",
|
|
||||||
"\n"
|
|
||||||
} ;
|
|
||||||
int
|
|
||||||
n= 0
|
|
||||||
;int
|
|
||||||
__ =
|
|
||||||
0,i=
|
|
||||||
000;
|
|
||||||
main
|
|
||||||
() {
|
|
||||||
#define f 001:
|
|
||||||
#define F 042:
|
|
||||||
#define f 100:
|
|
||||||
_[i--
|
|
||||||
#define f 126:
|
|
||||||
#define f 132:
|
|
||||||
#define f 103:
|
|
||||||
#define f 202:
|
|
||||||
#define f 666:
|
|
||||||
#define f 77::
|
|
||||||
#define f 101:
|
|
||||||
]=0
|
|
||||||
#define f 232:
|
|
||||||
#define f 151:
|
|
||||||
;if(
|
|
||||||
#define f 256:
|
|
||||||
!i){
|
|
||||||
puts
|
|
||||||
("I"
|
|
||||||
"BM"
|
|
||||||
" S"
|
|
||||||
"UX"
|
|
||||||
);;;
|
|
||||||
;;;}
|
|
||||||
;for
|
|
||||||
( ;
|
|
||||||
gets
|
|
||||||
(_);
|
|
||||||
) {
|
|
||||||
for(
|
|
||||||
#define f 301:
|
|
||||||
t=_,
|
|
||||||
#define f 700:
|
|
||||||
#define f 999:
|
|
||||||
s=t,
|
|
||||||
#define f 77 :
|
|
||||||
#define f 300:
|
|
||||||
s=t;
|
|
||||||
#define f s=t;
|
|
||||||
#define f 123:
|
|
||||||
#define f 127:
|
|
||||||
*t&&
|
|
||||||
!(!(
|
|
||||||
*t <
|
|
||||||
'0'
|
|
||||||
||*t
|
|
||||||
>'9'
|
|
||||||
)&&!
|
|
||||||
((t[
|
|
||||||
1] ^
|
|
||||||
':')
|
|
||||||
&&(t
|
|
||||||
[1]^
|
|
||||||
'.')
|
|
||||||
)) ;
|
|
||||||
t++)
|
|
||||||
#define f 137:
|
|
||||||
#define f 133:
|
|
||||||
;if(
|
|
||||||
#define f 111:
|
|
||||||
#define f 220:
|
|
||||||
v^*t
|
|
||||||
&&*t
|
|
||||||
){v=
|
|
||||||
*t;;
|
|
||||||
n=n*
|
|
||||||
2+(1
|
|
||||||
&*t)
|
|
||||||
;__=
|
|
||||||
(__+
|
|
||||||
1)&3
|
|
||||||
; __
|
|
||||||
||((
|
|
||||||
n<15
|
|
||||||
&&(*
|
|
||||||
p= *
|
|
||||||
av[n
|
|
||||||
] ),
|
|
||||||
#define f 2+2:
|
|
||||||
p++)
|
|
||||||
,n=0
|
|
||||||
);}}
|
|
||||||
#define f ==4:
|
|
||||||
;*p=
|
|
||||||
'\0'
|
|
||||||
;;;;
|
|
||||||
#define f puts
|
|
||||||
puts
|
|
||||||
(x);
|
|
||||||
s=t;
|
|
||||||
#define f s=5;
|
|
||||||
s=t;
|
|
||||||
#define f s=5:
|
|
||||||
s=t;
|
|
||||||
#define f 445:
|
|
||||||
#define f 113:
|
|
||||||
#define f 900:
|
|
||||||
s=t;
|
|
||||||
#define f n22:
|
|
||||||
#define f n40:
|
|
||||||
s=t;
|
|
||||||
#define f nn6:
|
|
||||||
s=t;
|
|
||||||
#define f nn1:
|
|
||||||
#define f 0:--
|
|
||||||
s=t;
|
|
||||||
#define f 19:-
|
|
||||||
#define f x2:x
|
|
||||||
s=t;
|
|
||||||
#define f x1:x
|
|
||||||
s=t;
|
|
||||||
#define f y2:x
|
|
||||||
#define f y7:y
|
|
||||||
s=t;
|
|
||||||
#define f 1:::
|
|
||||||
s=t;
|
|
||||||
#define f @3:@
|
|
||||||
#define f 10:0
|
|
||||||
#define f x+1:
|
|
||||||
s=t;
|
|
||||||
#define f 2:::
|
|
||||||
#define f 3:::
|
|
||||||
#define x 7:::
|
|
||||||
#define y 3:::
|
|
||||||
#define z 990:
|
|
||||||
#define Z 47::
|
|
||||||
;;;}
|
|
||||||
|
|
||||||
Reference in new issue
Block a user