Merge pull request #179 from xexyl/1988-spinellis

This commit is contained in:
Landon Curt Noll authored and GitHub committed 2023-03-27 11:18:32 -07:00
commit c050380361
4 files changed
+36 -15

No files matched your search

+1
View File
@@ -1,2 +1,3 @@
prog.c
spinellis
spinellis.alt
+6 -2
View File
@@ -111,8 +111,8 @@ OBJ= ${PROG}.o
DATA= spinellis.data
TARGET= ${PROG}
#
ALT_OBJ=
ALT_TARGET=
ALT_OBJ= ${PROG}.alt.o
ALT_TARGET= ${PROG}.alt
#################
@@ -135,6 +135,10 @@ ${PROG}: ${PROG}.c
alt: data ${ALT_TARGET}
@${TRUE}
${PROG}.alt: ${PROG}.alt.c
${CC} ${CFLAGS} -Wno-implicit-function-declaration $< -o $@ ${LIBS}
@while read -r r; do echo $$r ; done | ./${PROG}.alt
# data files
#
data: ${DATA}
+28 -13
View File
@@ -10,11 +10,11 @@
make all
and then type a C program into followed by EOF two times (`^D^D`).
NOTE: this entry will not compile with clang. Also be advised that gcc in macOS
is actually clang so this will not work even with the default compiler in macOS.
and then type a C program into followed by EOF (usually `^D`, ctrl-d).
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) made a version (also
one-line) for clang. See the alternative code section below for how to use.
Thank you Cody for your assistance!
## Try:
@@ -24,7 +24,6 @@ is actually clang so this will not work even with the default compiler in macOS.
printf("Hello world\n");
}
^D
^D
./spinellis
make clobber all
@@ -35,23 +34,39 @@ is actually clang so this will not work even with the default compiler in macOS.
printf("%d\n", i);
}
^D
./spinellis
## Alternative code:
For clang try the alt code like:
make clobber alt
#include <stdio.h>
main()
{
puts("Hello world\n");
}
^D
./spinellis
## Judges' comments
## Judges' comments:
We enjoyed this entry this year, however in the future programs must be able to
be compiled from within a Makefile without the need of human intervention.
The author originally wrote:
Meanwhile Cody was twisted enough to point out (though to be fair he felt sick
doing this) that with a slight modification this entry can be C++ instead. We don't
thank him for this ghastly point! :-)
This program can be configured to do almost everything.
The configuration is done during compile time by typing
in, C code, that one would like the program to perform.
A trivial example is given in the `how to compile' section
but the possibilities are clearly limited only by your
imagination and programming skills.
## Author's comments:
This program can be configured to do almost everything. The configuration is
done during compile time by typing in, C code, that one would like the program
to perform. A trivial example is given in the `how to compile' section but the
possibilities are clearly limited only by your imagination and programming
skills.
## Copyright and CC BY-SA 4.0 License:
+1
View File
@@ -0,0 +1 @@
main(){system("gcc -x c - -o spinellis");}