diff --git a/.gitignore b/.gitignore index 4264b3818..cb8267a07 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,4 @@ /archive/2018/ /archive/2019/ /archive/2020/ -alt.prog mkentry -prog diff --git a/1984/Makefile b/1984/Makefile index 500c7b7c4..b84eb77ba 100644 --- a/1984/Makefile +++ b/1984/Makefile @@ -50,7 +50,7 @@ # tool locations ################ # -SHELL= /bin/bash +SHELL= bash MAKE= make diff --git a/1984/anonymous/.gitignore b/1984/anonymous/.gitignore new file mode 100644 index 000000000..ed6d4bce0 --- /dev/null +++ b/1984/anonymous/.gitignore @@ -0,0 +1 @@ +anonymous diff --git a/1984/anonymous/Makefile b/1984/anonymous/Makefile index 9faa8dc46..a4c95f3f6 100644 --- a/1984/anonymous/Makefile +++ b/1984/anonymous/Makefile @@ -327,30 +327,26 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings -# -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra -CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -# Silence warnings that ${CWARN} would normally complain about +# Common C compiler warnings to silence # +#CSILENCE= CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-implicit-int \ -Wno-return-type -Wno-string-plus-int -Wno-unsequenced -#CSILENCE= -Wno-implicit-int -# compiler standard +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +CWARN= -Wall -Wextra ${CSILENCE} +#CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -362,12 +358,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -376,7 +372,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -389,7 +385,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -400,20 +396,32 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-poison-system-directories -Wno-shadow -Wno-missing-prototypes \ + -Wno-strict-prototypes -Wno-missing-variable-declarations -Wno-pedantic +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1984/decot/.gitignore b/1984/decot/.gitignore new file mode 100644 index 000000000..44d155e10 --- /dev/null +++ b/1984/decot/.gitignore @@ -0,0 +1 @@ +decot diff --git a/1984/decot/Makefile b/1984/decot/Makefile index cf3df28bd..74f036206 100644 --- a/1984/decot/Makefile +++ b/1984/decot/Makefile @@ -327,31 +327,27 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings -# -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra -CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -# Silence warnings that ${CWARN} would normally complain about +# Common C compiler warnings to silence # +#CSILENCE= CSILENCE= -Wno-array-bounds -Wno-error -Wno-implicit-function-declaration \ -Wno-keyword-macro -Wno-main-return-type -Wno-missing-field-initializers \ -Wno-unused-value -Wno-unused-variable -#CSILENCE= -Wno-implicit-int -# compiler standard +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +CWARN= -Wall -Wextra ${CSILENCE} +#CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # #CSTD= #CSTD= -ansi -CSTD= -std=gnu89 +CSTD= -std=gnu90 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -363,12 +359,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC=26 -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -377,7 +373,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -390,7 +386,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -401,20 +397,32 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-comma -Wno-format-nonliteral -Wno-missing-variable-declarations \ + -Wno-pedantic -Wno-poison-system-directories -Wno-strict-prototypes +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## @@ -444,7 +452,7 @@ all: ${DATA} ${TARGET} supernova deep_magic magic charon pluto ${PROG}: ${PROG}.c - @echo "NOTE: This entry uses non-standard args to main() that do not work with modern compilers." + @echo "NOTE: This entry may not compile when using modern compilers." ${CC} ${CFLAGS} $< -o $@ ${LIBS} # alternative executable diff --git a/1984/decot/README.md b/1984/decot/README.md index 332c92a71..4df2ea516 100644 --- a/1984/decot/README.md +++ b/1984/decot/README.md @@ -6,7 +6,7 @@ Dave Decot make all -NOTE: This entry uses non-standard args to main() that do not work with modern compilers. +NOTE: This entry may not compile when using modern compilers. ## Judges' comments: diff --git a/1984/laman/.gitignore b/1984/laman/.gitignore new file mode 100644 index 000000000..0723ff8d6 --- /dev/null +++ b/1984/laman/.gitignore @@ -0,0 +1 @@ +laman diff --git a/1984/laman/Makefile b/1984/laman/Makefile index c4f929316..9a04a3bbc 100644 --- a/1984/laman/Makefile +++ b/1984/laman/Makefile @@ -327,29 +327,25 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings +# Common C compiler warnings to silence # -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra +#CSILENCE= +CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-implicit-int + +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} CWARN= -Wall -Wextra ${CSILENCE} #CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} -# Silence warnings that ${CWARN} would normally complain about -# -CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-implicit-int -#CSILENCE= -Wno-implicit-int - -# compiler standard +# Compiler standard # #CSTD= #CSTD= -ansi -CSTD= -std=gnu11 +CSTD= -std=c11 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,12 +357,12 @@ CSTD= -std=gnu11 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -375,7 +371,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -388,7 +384,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -399,20 +395,32 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-comma -Wno-missing-variable-declarations -Wno-pedantic \ + -Wno-poison-system-directories +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1984/mullender/.gitignore b/1984/mullender/.gitignore new file mode 100644 index 000000000..995d74a91 --- /dev/null +++ b/1984/mullender/.gitignore @@ -0,0 +1 @@ +mullender diff --git a/1984/mullender/Makefile b/1984/mullender/Makefile index 1f891ebe2..022d61539 100644 --- a/1984/mullender/Makefile +++ b/1984/mullender/Makefile @@ -327,29 +327,25 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings -# -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -# Silence warnings that ${CWARN} would normally complain about +# Common C compiler warnings to silence # +#CSILENCE= CSILENCE= -Wno-main -#CSILENCE= -Wno-implicit-int -# compiler standard +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +CWARN= -Wall -Wextra ${CSILENCE} +#CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,12 +357,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -375,7 +371,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -388,7 +384,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -399,20 +395,31 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-missing-variable-declarations -Wno-poison-system-directories +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1985/Makefile b/1985/Makefile index 59e870e5f..f1b83b9d8 100644 --- a/1985/Makefile +++ b/1985/Makefile @@ -50,7 +50,7 @@ # tool locations ################ # -SHELL= /bin/bash +SHELL= bash MAKE= make diff --git a/1985/applin/.gitignore b/1985/applin/.gitignore new file mode 100644 index 000000000..65b2a0f49 --- /dev/null +++ b/1985/applin/.gitignore @@ -0,0 +1 @@ +applin diff --git a/1985/applin/Makefile b/1985/applin/Makefile index cdab9e107..f691e3815 100644 --- a/1985/applin/Makefile +++ b/1985/applin/Makefile @@ -327,29 +327,25 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings +# Common C compiler warnings to silence # -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra +#CSILENCE= +CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-logical-op-parentheses + +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} CWARN= -Wall -Wextra ${CSILENCE} #CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} -# Silence warnings that ${CWARN} would normally complain about -# -CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-logical-op-parentheses -#CSILENCE= -Wno-implicit-int - -# compiler standard +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,12 +357,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -375,7 +371,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -388,7 +384,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -399,20 +395,31 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-pedantic -Wno-poison-system-directories +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1985/august/.gitignore b/1985/august/.gitignore new file mode 100644 index 000000000..36c24223d --- /dev/null +++ b/1985/august/.gitignore @@ -0,0 +1 @@ +august diff --git a/1985/august/Makefile b/1985/august/Makefile index 1edb88e45..369fd653e 100644 --- a/1985/august/Makefile +++ b/1985/august/Makefile @@ -327,30 +327,26 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings -# -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra -CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -# Silence warnings that ${CWARN} would normally complain about +# Common C compiler warnings to silence # +#CSILENCE= CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-main \ -Wno-unused-parameter -Wno-unused-variable -#CSILENCE= -Wno-implicit-int -# compiler standard +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +CWARN= -Wall -Wextra ${CSILENCE} +#CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -362,12 +358,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -376,7 +372,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -389,7 +385,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -400,20 +396,32 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-comma -Wno-missing-prototypes -Wno-padded -Wno-pedantic \ + -Wno-poison-system-directories -Wno-strict-prototypes +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1985/lycklama/Makefile b/1985/lycklama/Makefile index 682750269..8ab367ef8 100644 --- a/1985/lycklama/Makefile +++ b/1985/lycklama/Makefile @@ -327,29 +327,26 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings +# Common C compiler warnings to silence # -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} +#CSILENCE= +CSILENCE= -Wno-implicit-int -Wno-unused-value -Wno-parentheses -Wno-error \ + -Wno-implicit-function-declaration -# Silence warnings that ${CWARN} would normally complain about +# Common C compiler warning flags # -CSILENCE= -Wno-implicit-int -Wno-unused-value -Wno-parentheses -#CSILENCE= -Wno-implicit-int +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +CWARN= -Wall -Wextra ${CSILENCE} +#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -# compiler standard +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,21 +358,21 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # -CINCLUDE=-include unistd.h +CINCLUDE= #CINCLUDE= -include stdlib.h #CINCLUDE= -include stdio.h #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -388,7 +385,7 @@ CINCLUDE=-include unistd.h #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -399,20 +396,32 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-implicit-int-conversion -Wno-poison-system-directories \ + -Wno-unused-macros +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1985/shapiro/.gitignore b/1985/shapiro/.gitignore new file mode 100644 index 000000000..9912ed2e4 --- /dev/null +++ b/1985/shapiro/.gitignore @@ -0,0 +1 @@ +shapiro diff --git a/1985/shapiro/Makefile b/1985/shapiro/Makefile index bcdf2321b..9c03f133a 100644 --- a/1985/shapiro/Makefile +++ b/1985/shapiro/Makefile @@ -327,30 +327,26 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings -# -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -# Silence warnings that ${CWARN} would normally complain about +# Common C compiler warnings to silence # +#CSILENCE= CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-implicit-int \ -Wno-parentheses -Wno-string-plus-int -#CSILENCE= -Wno-implicit-int -# compiler standard +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +#CWARN= -Wall -Wextra ${CSILENCE} +CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -362,12 +358,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -376,7 +372,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -389,7 +385,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -400,20 +396,31 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-comma -Wno-missing-variable-declarations -Wno-poison-system-directories +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1985/sicherman/.gitignore b/1985/sicherman/.gitignore new file mode 100644 index 000000000..82b0ebb1e --- /dev/null +++ b/1985/sicherman/.gitignore @@ -0,0 +1 @@ +sicherman diff --git a/1985/sicherman/Makefile b/1985/sicherman/Makefile index 901344f00..2551086b7 100644 --- a/1985/sicherman/Makefile +++ b/1985/sicherman/Makefile @@ -327,29 +327,25 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings +# Common C compiler warnings to silence # -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra +#CSILENCE= +CSILENCE= -Wno-comment + +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} #CWARN= -Wall -Wextra ${CSILENCE} CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} -# Silence warnings that ${CWARN} would normally complain about -# -CSILENCE= -Wno-comment -#CSILENCE= -Wno-implicit-int - -# compiler standard +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,12 +357,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -375,7 +371,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -388,7 +384,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -399,20 +395,31 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-poison-system-directories +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1986/Makefile b/1986/Makefile index ed2146601..004d0db49 100644 --- a/1986/Makefile +++ b/1986/Makefile @@ -50,7 +50,7 @@ # tool locations ################ # -SHELL= /bin/bash +SHELL= bash MAKE= make diff --git a/1986/applin/.gitignore b/1986/applin/.gitignore new file mode 100644 index 000000000..65b2a0f49 --- /dev/null +++ b/1986/applin/.gitignore @@ -0,0 +1 @@ +applin diff --git a/1986/applin/Makefile b/1986/applin/Makefile index 707b3d7e5..f4d1856ee 100644 --- a/1986/applin/Makefile +++ b/1986/applin/Makefile @@ -327,29 +327,26 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings +# Common C compiler warnings to silence # -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra +#CSILENCE= +CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-error \ + -Wno-implicit-function-declaration -Wno-implicit-int + +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} #CWARN= -Wall -Wextra ${CSILENCE} CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} -# Silence warnings that ${CWARN} would normally complain about -# -CSILENCE= -Wno-error -Wno-implicit-function-declaration -#CSILENCE= -Wno-implicit-int - -# compiler standard +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,12 +358,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -375,7 +372,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -388,7 +385,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -399,20 +396,32 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-poison-system-directories -Wno-unknown-warning-option \ + -Wno-missing-variable-declarations +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1986/august/.gitignore b/1986/august/.gitignore new file mode 100644 index 000000000..36c24223d --- /dev/null +++ b/1986/august/.gitignore @@ -0,0 +1 @@ +august diff --git a/1986/august/Makefile b/1986/august/Makefile index e73492e25..26ebe51fd 100644 --- a/1986/august/Makefile +++ b/1986/august/Makefile @@ -327,29 +327,25 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings +# Common C compiler warnings to silence # -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra +#CSILENCE= +CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-implicit-int -Wno-return-type + +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} #CWARN= -Wall -Wextra ${CSILENCE} CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} -# Silence warnings that ${CWARN} would normally complain about -# -CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-implicit-int -Wno-return-type -#CSILENCE= -Wno-implicit-int - -# compiler standard +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,12 +357,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -375,7 +371,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -388,7 +384,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -399,20 +395,33 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-cast-align -Wno-comma -Wno-missing-prototypes \ + -Wno-missing-variable-declarations -Wno-padded \ + -Wno-poison-system-directories -Wno-sign-conversion -Wno-strict-prototypes +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1986/bright/Makefile b/1986/bright/Makefile index 22104440c..05d7cf72f 100644 --- a/1986/bright/Makefile +++ b/1986/bright/Makefile @@ -327,31 +327,27 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings -# -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra -CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -# Silence warnings that ${CWARN} would normally complain about +# Common C compiler warnings to silence # +#CSILENCE= CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-format-security \ -Wno-implicit-int -Wno-unknown-escape-sequence -Wno-unused-value \ -Wno-sign-compare -#CSILENCE= -Wno-implicit-int -# compiler standard +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +CWARN= -Wall -Wextra ${CSILENCE} +#CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -363,12 +359,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -377,7 +373,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -390,7 +386,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -401,20 +397,34 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-comma -Wno-format-nonliteral -Wno-missing-prototypes \ + -Wno-missing-variable-declarations -Wno-pedantic \ + -Wno-poison-system-directories -Wno-shorten-64-to-32 -Wno-sign-conversion \ + -Wno-strict-prototypes -Wno-unreachable-code-return +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1986/hague/.gitignore b/1986/hague/.gitignore new file mode 100644 index 000000000..6d1bd4618 --- /dev/null +++ b/1986/hague/.gitignore @@ -0,0 +1 @@ +hague diff --git a/1986/hague/Makefile b/1986/hague/Makefile index 43c7e6d76..7fb57e657 100644 --- a/1986/hague/Makefile +++ b/1986/hague/Makefile @@ -344,13 +344,13 @@ CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-implicit-int \ -Wno-incompatible-library-redeclaration -Wno-return-type #CSILENCE= -Wno-implicit-int -# compiler standard +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -362,12 +362,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC=26 -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -376,7 +376,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -415,6 +415,114 @@ CC= cc #CC=clang MAY_NEED_GCC= gcc +# Set X11_LIBDIR to the directory where the X11 library resides +# +#X11_LIBDIR= /usr/X11R6/lib +#X11_LIBDIR= /usr/X11/lib +X11_LIBDIR= /opt/X11/lib + +# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# +#X11_INCDIR= /usr/X11R6/include +#X11_INCDIR= /usr/X11/include +X11_INCDIR= /opt/X11/include + +# Common C compiler warnings to silence +# +#CSILENCE= +CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-implicit-int \ + -Wno-incompatible-library-redeclaration -Wno-return-type + +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +CWARN= -Wall -Wextra ${CSILENCE} +#CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard +# +#CSTD= +#CSTD= -ansi +CSTD= -std=gnu89 + +# Compiler bit architecture +# +# Some entries require 32-bitness: +# ARCH= -m32 +# +# Some entries require 64-bitness: +# ARCH= -m64 +# +# By default we assume nothing: +# +ARCH= + +# Defines that are needed to compile +# +CDEFINE= +#CDEFINE= -DIOCCC + +# Include files that are needed to compile +# +CINCLUDE= +#CINCLUDE= -include stdlib.h +#CINCLUDE= -include stdio.h +#CINCLUDE= -include stdlib.h -include stdio.h +#CINCLUDE= -I ${X11_INCDIR} +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 + +# Optimization +# +# Most compiles will safely use -O2. Some can use only -O1 or -O. +# A few compilers have broken optimizers or this entry make break +# under those buggy optimizers and thus you may not want anything. +# Reasonable compilers will allow for -O3. +# +#OPT= +#OPT= -O +#OPT= -O1 +#OPT= -O2 +OPT= -O3 + +# Default flags for ANSI C compilation +# +CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} + +# Libraries needed to build +# +LIBS= +#LIBS= -lm +#LIBS= -L ${X11_LIBDIR} -lX11 +#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL + +# C compiler to use +# +CC= cc +#CC=clang +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-comma -Wno-missing-prototypes -Wno-missing-variable-declarations \ + -Wno-pedantic -Wno-poison-system-directories -Wno-strict-prototypes +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif + ############################## # Special flags for this entry diff --git a/1986/holloway/.gitignore b/1986/holloway/.gitignore new file mode 100644 index 000000000..47d139d24 --- /dev/null +++ b/1986/holloway/.gitignore @@ -0,0 +1 @@ +holloway diff --git a/1986/holloway/Makefile b/1986/holloway/Makefile index 9a569965c..5cede9fc7 100644 --- a/1986/holloway/Makefile +++ b/1986/holloway/Makefile @@ -327,30 +327,26 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings -# -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra -CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -# Silence warnings that ${CWARN} would normally complain about +# Common C compiler warnings to silence # +#CSILENCE= CSILENCE= -Wno-format-security -Wno-implicit-int -Wno-int-to-pointer-cast \ -Wno-pointer-to-int-cast -#CSILENCE= -Wno-implicit-int -# compiler standard +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +CWARN= -Wall -Wextra ${CSILENCE} +#CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -362,12 +358,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -376,7 +372,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -389,7 +385,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -400,20 +396,32 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-missing-variable-declarations -Wno-pedantic \ + -Wno-poison-system-directories -Wno-shadow +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1986/marshall/.gitignore b/1986/marshall/.gitignore new file mode 100644 index 000000000..461019cfd --- /dev/null +++ b/1986/marshall/.gitignore @@ -0,0 +1 @@ +marshall diff --git a/1986/marshall/Makefile b/1986/marshall/Makefile index 698a39908..4e9f55cd8 100644 --- a/1986/marshall/Makefile +++ b/1986/marshall/Makefile @@ -327,31 +327,27 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings -# -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -# Silence warnings that ${CWARN} would normally complain about +# Common C compiler warnings to silence # +#CSILENCE= CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-implicit-int \ -Wno-int-conversion -Wno-parentheses -Wno-shift-negative-value \ -Wno-string-compare -Wno-unsequenced -Wno-unused-value -#CSILENCE= -Wno-implicit-int -# compiler standard +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +#CWARN= -Wall -Wextra ${CSILENCE} +CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -363,12 +359,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -377,7 +373,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -390,7 +386,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -401,20 +397,32 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-missing-prototypes -Wno-missing-variable-declarations \ + -Wno-poison-system-directories -Wno-strict-prototypes +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1986/pawka/Makefile b/1986/pawka/Makefile index 1dee1a22f..044fe55a4 100644 --- a/1986/pawka/Makefile +++ b/1986/pawka/Makefile @@ -327,29 +327,25 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings +# Common C compiler warnings to silence # -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra +#CSILENCE= +CSILENCE= -Wno-non-literal-null-conversion -Wno-unused-value + +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} #CWARN= -Wall -Wextra ${CSILENCE} CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} -# Silence warnings that ${CWARN} would normally complain about -# -CSILENCE= -Wno-non-literal-null-conversion -Wno-unused-value -#CSILENCE= -Wno-implicit-int - -# compiler standard +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,12 +357,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -375,7 +371,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -388,7 +384,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -399,20 +395,31 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-missing-variable-declarations -Wno-poison-system-directories +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1986/stein/.gitignore b/1986/stein/.gitignore new file mode 100644 index 000000000..941454984 --- /dev/null +++ b/1986/stein/.gitignore @@ -0,0 +1,2 @@ +a.out +stein diff --git a/1986/stein/Makefile b/1986/stein/Makefile index f75c2e4fe..c6505ec15 100644 --- a/1986/stein/Makefile +++ b/1986/stein/Makefile @@ -327,29 +327,25 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings +# Common C compiler warnings to silence # -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra +#CSILENCE= +CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-implicit-int -Wno-int-conversion + +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} CWARN= -Wall -Wextra ${CSILENCE} #CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} -# Silence warnings that ${CWARN} would normally complain about -# -CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-implicit-int -Wno-int-conversion -#CSILENCE= -Wno-implicit-int - -# compiler standard +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,12 +357,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -375,7 +371,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -388,7 +384,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -399,20 +395,32 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-comma -Wno-missing-variable-declarations -Wno-pedantic \ + -Wno-poison-system-directories +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1986/wall/.gitignore b/1986/wall/.gitignore new file mode 100644 index 000000000..8d40b1eda --- /dev/null +++ b/1986/wall/.gitignore @@ -0,0 +1 @@ +wall diff --git a/1986/wall/Makefile b/1986/wall/Makefile index 067d350b0..e5eafc68b 100644 --- a/1986/wall/Makefile +++ b/1986/wall/Makefile @@ -327,30 +327,26 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings -# -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -# Silence warnings that ${CWARN} would normally complain about +# Common C compiler warnings to silence # +#CSILENCE= CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-implicit-int \ -Wno-macro-redefined -Wno-parentheses -Wno-c99-extensions -#CSILENCE= -Wno-implicit-int -# compiler standard +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +#CWARN= -Wall -Wextra ${CSILENCE} +CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -362,12 +358,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -376,7 +372,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -389,7 +385,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -400,20 +396,33 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-implicit-int-conversion -Wno-missing-prototypess \ + -Wno-missing-variable-declarations -Wno-poison-system-directories \ + -Wno-strict-prototypes +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1987/Makefile b/1987/Makefile index 5c8b77e94..1c5e1d577 100644 --- a/1987/Makefile +++ b/1987/Makefile @@ -50,7 +50,7 @@ # tool locations ################ # -SHELL= /bin/bash +SHELL= bash MAKE= make diff --git a/1987/biggar/Makefile b/1987/biggar/Makefile index 240b9533a..9b057eda9 100644 --- a/1987/biggar/Makefile +++ b/1987/biggar/Makefile @@ -327,29 +327,25 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings +# Common C compiler warnings to silence # -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra +#CSILENCE= +CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-extra-semi + +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} #CWARN= -Wall -Wextra ${CSILENCE} CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} -# Silence warnings that ${CWARN} would normally complain about -# -CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-extra-semi -#CSILENCE= -Wno-implicit-int - -# compiler standard +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,12 +357,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -375,7 +371,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -388,7 +384,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -399,20 +395,31 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-implicit-int-conversion -Wno-poison-system-directories +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1987/heckbert/.gitignore b/1987/heckbert/.gitignore new file mode 100644 index 000000000..9733e438c --- /dev/null +++ b/1987/heckbert/.gitignore @@ -0,0 +1 @@ +heckbert diff --git a/1987/heckbert/Makefile b/1987/heckbert/Makefile index 613c86c1f..880ce5d91 100644 --- a/1987/heckbert/Makefile +++ b/1987/heckbert/Makefile @@ -327,30 +327,26 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings -# -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra -CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -# Silence warnings that ${CWARN} would normally complain about +# Common C compiler warnings to silence # +#CSILENCE= CSILENCE= -Wno-empty-body -Wno-error -Wno-implicit-function-declaration -Wno-implicit-int \ -Wno-int-to-pointer-cast -Wno-logical-op-parentheses -#CSILENCE= -Wno-implicit-int -# compiler standard +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +CWARN= -Wall -Wextra ${CSILENCE} +#CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -362,12 +358,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -376,7 +372,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -389,7 +385,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -400,20 +396,32 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-comma -Wno-missing-prototypes -Wno-missing-variable-declarations \ + -Wno-pedantic -Wno-poison-system-directories -Wno-shadow -Wno-strict-prototypes +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1987/hines/.gitignore b/1987/hines/.gitignore new file mode 100644 index 000000000..d95f2717a --- /dev/null +++ b/1987/hines/.gitignore @@ -0,0 +1 @@ +hines diff --git a/1987/hines/Makefile b/1987/hines/Makefile index 4d499aeac..8f51cacdb 100644 --- a/1987/hines/Makefile +++ b/1987/hines/Makefile @@ -327,29 +327,25 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings +# Common C compiler warnings to silence # -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra +#CSILENCE= +CSILENCE= -Wno-error -Wno-implicit-function-declaration + +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} #CWARN= -Wall -Wextra ${CSILENCE} CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} -# Silence warnings that ${CWARN} would normally complain about -# -CSILENCE= -Wno-error -Wno-implicit-function-declaration -#CSILENCE= -Wno-implicit-int - -# compiler standard +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,12 +357,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -375,7 +371,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -388,7 +384,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -399,20 +395,31 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-poison-system-directories -Wno-shorten-64-to-32 +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1987/korn/.gitignore b/1987/korn/.gitignore new file mode 100644 index 000000000..e537c34cc --- /dev/null +++ b/1987/korn/.gitignore @@ -0,0 +1 @@ +korn diff --git a/1987/korn/Makefile b/1987/korn/Makefile index ab1698ae0..12a86f9d2 100644 --- a/1987/korn/Makefile +++ b/1987/korn/Makefile @@ -327,30 +327,26 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings -# -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -# Silence warnings that ${CWARN} would normally complain about +# Common C compiler warnings to silence # +#CSILENCE= CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-implicit-int -Dunix=1 \ -Wno-string-plus-int -#CSILENCE= -Wno-implicit-int -# compiler standard +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +#CWARN= -Wall -Wextra ${CSILENCE} +CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -362,12 +358,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -376,7 +372,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -389,7 +385,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -400,20 +396,32 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-array-bounds-pointer-arithmetic -Wno-format-nonliteral \ + -Wno-poison-system-directories +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1987/lievaart/.gitignore b/1987/lievaart/.gitignore new file mode 100644 index 000000000..dd7c87acf --- /dev/null +++ b/1987/lievaart/.gitignore @@ -0,0 +1,2 @@ +lievaart +lievaart2 diff --git a/1987/lievaart/Makefile b/1987/lievaart/Makefile index 6cfe7ac51..c4a938e03 100644 --- a/1987/lievaart/Makefile +++ b/1987/lievaart/Makefile @@ -327,29 +327,25 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings +# Common C compiler warnings to silence # -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra +#CSILENCE= +CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-implicit-int + +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} CWARN= -Wall -Wextra ${CSILENCE} #CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} -# Silence warnings that ${CWARN} would normally complain about -# -CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-implicit-int -#CSILENCE= -Wno-implicit-int - -# compiler standard +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,12 +357,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -375,7 +371,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -388,7 +384,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -399,20 +395,33 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-comma -Wno-conditional-uninitialized -Wno-missing-prototypes \ + -Wno-missing-variable-declarations -Wno-pedantic \ + -Wno-poison-system-directories -Wno-shadow -Wno-strict-prototypes +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1987/wall/.gitignore b/1987/wall/.gitignore new file mode 100644 index 000000000..8d40b1eda --- /dev/null +++ b/1987/wall/.gitignore @@ -0,0 +1 @@ +wall diff --git a/1987/wall/Makefile b/1987/wall/Makefile index 9ec9eeb87..4e4d79b49 100644 --- a/1987/wall/Makefile +++ b/1987/wall/Makefile @@ -327,31 +327,27 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings -# -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra -CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -# Silence warnings that ${CWARN} would normally complain about +# Common C compiler warnings to silence # +#CSILENCE= CSILENCE= -Wno-char-subscripts -Wno-error -Wno-implicit-function-declaration \ -Wno-incompatible-library-redeclaration -Wno-return-type -Wno-string-plus-int \ - -Wno-unknown-escape-sequence -#CSILENCE= -Wno-implicit-int + -Wno-unknown-escape-sequence -Wno-deprecated-declarations -# compiler standard +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +CWARN= -Wall -Wextra ${CSILENCE} +#CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -363,12 +359,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -377,7 +373,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -390,7 +386,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -401,20 +397,33 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-comma -Wno-format-nonliteral -Wno-implicit-int-conversion \ + -Wno-missing-prototypes -Wno-missing-variable-declarations -Wno-pedantic \ + -Wno-poison-system-directories -Wno-strict-prototypes +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1987/westley/.gitignore b/1987/westley/.gitignore new file mode 100644 index 000000000..2a0c890f9 --- /dev/null +++ b/1987/westley/.gitignore @@ -0,0 +1 @@ +westley diff --git a/1987/westley/Makefile b/1987/westley/Makefile index 3c3d11734..6490e1c9f 100644 --- a/1987/westley/Makefile +++ b/1987/westley/Makefile @@ -327,29 +327,25 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings +# Common C compiler warnings to silence # -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra +#CSILENCE= +CSILENCE= -Wno-for-loop-analysis -Wno-unused-value + +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} #CWARN= -Wall -Wextra ${CSILENCE} CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} -# Silence warnings that ${CWARN} would normally complain about -# -CSILENCE= -Wno-for-loop-analysis -Wno-unused-value -#CSILENCE= -Wno-implicit-int - -# compiler standard +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,12 +357,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -375,7 +371,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -388,7 +384,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -399,20 +395,32 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-comma -Wno-missing-variable-declarations \ + -Wno-poison-system-directories -Wno-strict-prototypes +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1988/Makefile b/1988/Makefile index 475d2ae8b..ce32ad66c 100644 --- a/1988/Makefile +++ b/1988/Makefile @@ -50,7 +50,7 @@ # tool locations ################ # -SHELL= /bin/bash +SHELL= bash MAKE= make diff --git a/1988/applin/.gitignore b/1988/applin/.gitignore new file mode 100644 index 000000000..a612d2239 --- /dev/null +++ b/1988/applin/.gitignore @@ -0,0 +1,3 @@ +applin +large.c +zsmall diff --git a/1988/applin/Makefile b/1988/applin/Makefile index 503d427aa..b9b1b1cd3 100644 --- a/1988/applin/Makefile +++ b/1988/applin/Makefile @@ -327,29 +327,25 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings +# Common C compiler warnings to silence # -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra +#CSILENCE= +CSILENCE= -Wno-expansion-to-defined -Wno-implicit-int + +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} #CWARN= -Wall -Wextra ${CSILENCE} CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} -# Silence warnings that ${CWARN} would normally complain about -# -CSILENCE= -Wno-expansion-to-defined -Wno-implicit-int -#CSILENCE= -Wno-implicit-int - -# compiler standard +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,12 +357,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -375,7 +371,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -388,7 +384,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -399,20 +395,31 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-poison-system-directories +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1988/dale/.gitignore b/1988/dale/.gitignore new file mode 100644 index 000000000..1328948de --- /dev/null +++ b/1988/dale/.gitignore @@ -0,0 +1 @@ +dale diff --git a/1988/dale/Makefile b/1988/dale/Makefile index dc16e6336..f71ffcfcc 100644 --- a/1988/dale/Makefile +++ b/1988/dale/Makefile @@ -327,30 +327,26 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings -# -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra -CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -# Silence warnings that ${CWARN} would normally complain about +# Common C compiler warnings to silence # +#CSILENCE= CSILENCE= -Wno-implicit-function-declaration -Wno-implicit-int -Wno-keyword-macro \ -Wno-pointer-to-int-cast -Wno-return-type -Wno-unused-value -#CSILENCE= -Wno-implicit-int -# compiler standard +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +CWARN= -Wall -Wextra ${CSILENCE} +#CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -362,12 +358,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -376,7 +372,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -389,7 +385,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -400,20 +396,31 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-poison-system-directories +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## @@ -427,8 +434,8 @@ OBJ= ${PROG}.o DATA= TARGET= ${PROG} # -ALT_OBJ= ${PROG}.orig.o -ALT_TARGET= ${PROG}.orig +ALT_OBJ= +ALT_TARGET= ################# diff --git a/1988/dale/dale.orig.c b/1988/dale/dale.c similarity index 100% rename from 1988/dale/dale.orig.c rename to 1988/dale/dale.c diff --git a/1988/isaak/.gitignore b/1988/isaak/.gitignore new file mode 100644 index 000000000..5514b6845 --- /dev/null +++ b/1988/isaak/.gitignore @@ -0,0 +1 @@ +isaak diff --git a/1988/isaak/Makefile b/1988/isaak/Makefile index 1f92b368f..f07fcba07 100644 --- a/1988/isaak/Makefile +++ b/1988/isaak/Makefile @@ -327,33 +327,29 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings -# -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra -CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -# Silence warnings that ${CWARN} would normally complain about +# Common C compiler warnings to silence # +#CSILENCE= CSILENCE= -Wno-comma -Wno-implicit-function-declaration -Wno-format-insufficient-args \ -Wno-implicit-int -Wno-incompatible-library-redeclaration -Wno-missing-prototypes \ -Wno-missing-variable-declarations -Wno-poison-system-directories -Wno-return-type \ -Wno-shadow -Wno-shift-op-parentheses -Wno-strict-prototypes -Wno-unreachable-code \ -Wno-unused-macros -#CSILENCE= -Wno-implicit-int -# compiler standard +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +CWARN= -Wall -Wextra ${CSILENCE} +#CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -365,13 +361,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # #CDEFINE= CDEFINE= -DI=B -DO=- -Dy -#CDEFINE= -DIOCCC=26 -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -380,7 +375,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -393,7 +388,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -404,20 +399,31 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-pedantic +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1988/litmaath/.gitignore b/1988/litmaath/.gitignore new file mode 100644 index 000000000..5722bebf5 --- /dev/null +++ b/1988/litmaath/.gitignore @@ -0,0 +1 @@ +litmaath diff --git a/1988/litmaath/Makefile b/1988/litmaath/Makefile index ffd626c03..bec77b06b 100644 --- a/1988/litmaath/Makefile +++ b/1988/litmaath/Makefile @@ -327,29 +327,25 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings +# Common C compiler warnings to silence # -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra +#CSILENCE= +CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-logical-op-parentheses + +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} #CWARN= -Wall -Wextra ${CSILENCE} CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} -# Silence warnings that ${CWARN} would normally complain about -# -CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-logical-op-parentheses -#CSILENCE= -Wno-implicit-int - -# compiler standard +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,12 +357,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -375,7 +371,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -388,7 +384,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -399,20 +395,31 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-poison-system-directories +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1988/phillipps/.gitignore b/1988/phillipps/.gitignore new file mode 100644 index 000000000..d9a2e652b --- /dev/null +++ b/1988/phillipps/.gitignore @@ -0,0 +1 @@ +phillipps diff --git a/1988/phillipps/Makefile b/1988/phillipps/Makefile index 674a48aad..d51d54134 100644 --- a/1988/phillipps/Makefile +++ b/1988/phillipps/Makefile @@ -327,30 +327,27 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings +# Common C compiler warnings to silence # -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra +#CSILENCE= +CSILENCE= -Wno-pedantic -Wno-logical-not-parentheses -Wno-implicit-function-declaration \ + -Wno-incompatible-pointer-types -Wno-int-conversion -Wno-pointer-to-int-cast \ + -Wno-pointer-integer-compare -Wno-compare-distinct-pointer-types + +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} #CWARN= -Wall -Wextra ${CSILENCE} CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} -# Silence warnings that ${CWARN} would normally complain about -# -CSILENCE= -Wno-pedantic -Wno-logical-not-parentheses -Wno-implicit-function-declaration \ - -Wno-incompatible-pointer-types -Wno-int-conversion -Wno-pointer-to-int-cast -#CSILENCE= -Wno-implicit-int - -# compiler standard +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -362,12 +359,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -376,7 +373,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -389,7 +386,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -400,20 +397,31 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-poison-system-directories -Wno-comma +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## @@ -427,8 +435,8 @@ OBJ= ${PROG}.o DATA= TARGET= ${PROG} # -ALT_OBJ= ${PROG}.orig.o -ALT_TARGET= ${PROG}.orig +ALT_OBJ= +ALT_TARGET= ################# @@ -450,10 +458,6 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} -${PROG}.orig: ${PROG}.orig.c - @echo "NOTE: The original source may not compile using modern compilers." - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - # data files # data: ${DATA} diff --git a/1988/phillipps/phillipps.orig.c b/1988/phillipps/phillipps.c similarity index 94% rename from 1988/phillipps/phillipps.orig.c rename to 1988/phillipps/phillipps.c index 7c48f19cb..d92718a86 100644 --- a/1988/phillipps/phillipps.orig.c +++ b/1988/phillipps/phillipps.c @@ -1,7 +1,4 @@ -main(t,_,a ) -char -* -a; +main(int t,char **_,char **a) { return! @@ -9,7 +6,7 @@ a; t<3? main(-79,-13,a+ -main(-87,1-_, +main(-87,1-(int)_, main(-86, 0, a+1 ) diff --git a/1988/reddy/.gitignore b/1988/reddy/.gitignore new file mode 100644 index 000000000..a7e8e8ce4 --- /dev/null +++ b/1988/reddy/.gitignore @@ -0,0 +1 @@ +reddy diff --git a/1988/reddy/Makefile b/1988/reddy/Makefile index 63f5ba8b0..a8c706e41 100644 --- a/1988/reddy/Makefile +++ b/1988/reddy/Makefile @@ -327,30 +327,26 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings +# Common C compiler warnings to silence # -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra +#CSILENCE= +CSILENCE= -Wno-pedantic -Wno-error -Wno-implicit-function-declaration -Wno-parentheses \ + -Wno-return-type -Wno-deprecated-declarations + +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} #CWARN= -Wall -Wextra ${CSILENCE} CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} -# Silence warnings that ${CWARN} would normally complain about -# -CSILENCE= -Wno-pedantic -Wno-error -Wno-implicit-function-declaration -Wno-parentheses \ - -Wno-return-type -#CSILENCE= -Wno-implicit-int - -# compiler standard +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -362,12 +358,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -376,7 +372,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -389,7 +385,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -400,20 +396,32 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-comma -Wno-missing-prototypes -Wno-missing-variable-declarations \ + -Wno-poison-system-directories -Wno-strict-prototypes +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1988/robison/.gitignore b/1988/robison/.gitignore new file mode 100644 index 000000000..c124d1dbc --- /dev/null +++ b/1988/robison/.gitignore @@ -0,0 +1 @@ +robison diff --git a/1988/robison/Makefile b/1988/robison/Makefile index 79642c1d1..c496d18dc 100644 --- a/1988/robison/Makefile +++ b/1988/robison/Makefile @@ -327,29 +327,25 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings +# Common C compiler warnings to silence # -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra +#CSILENCE= +CSILENCE= -Wno-error -Wno-implicit-function-declaration + +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} CWARN= -Wall -Wextra ${CSILENCE} #CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} -# Silence warnings that ${CWARN} would normally complain about -# -CSILENCE= -Wno-error -Wno-implicit-function-declaration -#CSILENCE= -Wno-implicit-int - -# compiler standard +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,12 +357,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -375,7 +371,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -388,7 +384,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -399,20 +395,32 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-comma -Wno-implicit-int-conversion -Wno-missing-variable-declarations \ + -Wno-pedantic -Wno-poison-system-directories +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1988/rules b/1988/rules.txt similarity index 100% rename from 1988/rules rename to 1988/rules.txt diff --git a/1988/spinellis/.gitignore b/1988/spinellis/.gitignore new file mode 100644 index 000000000..32df5de2c --- /dev/null +++ b/1988/spinellis/.gitignore @@ -0,0 +1,2 @@ +prog.c +spinellis diff --git a/1988/spinellis/Makefile b/1988/spinellis/Makefile index 7cd5c2cd3..66262ac15 100644 --- a/1988/spinellis/Makefile +++ b/1988/spinellis/Makefile @@ -327,29 +327,25 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings +# Common C compiler warnings to silence # -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra +#CSILENCE= +CSILENCE= -Wno-empty-translation-unit + +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} #CWARN= -Wall -Wextra ${CSILENCE} CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} -# Silence warnings that ${CWARN} would normally complain about -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# compiler standard +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,12 +357,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -375,7 +371,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -388,7 +384,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -399,20 +395,31 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-empty-translation-unit -Wno-poison-system-directories +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## @@ -443,15 +450,7 @@ all: data ${TARGET} ${PROG}: ${PROG}.c @echo "NOTE: This entry requires a non-standard K&R C compiler to compile." - ${RM} -f $@ - @echo 'On the command line, type in the following command and then' - @echo 'then type in a C program following by EOF (control D):' - @echo - @echo '${CPP} ${PROG}.c > prog.c' - @echo - @echo 'Then on the command line, type in the following command:' - @echo - @echo '${CC} prog.c -o ${PROG} ${LIBS}' + ${CC} ${CFLAGS} $< -o $@ ${LIBS} # alternative executable # diff --git a/1988/westley/.gitignore b/1988/westley/.gitignore new file mode 100644 index 000000000..2a0c890f9 --- /dev/null +++ b/1988/westley/.gitignore @@ -0,0 +1 @@ +westley diff --git a/1988/westley/Makefile b/1988/westley/Makefile index 669d3aefc..a1c30d7d6 100644 --- a/1988/westley/Makefile +++ b/1988/westley/Makefile @@ -327,29 +327,25 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings +# Common C compiler warnings to silence # -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra +#CSILENCE= +CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-return-type + +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} #CWARN= -Wall -Wextra ${CSILENCE} CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} -# Silence warnings that ${CWARN} would normally complain about -# -CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-return-type -#CSILENCE= -Wno-implicit-int - -# compiler standard +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,12 +357,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -375,7 +371,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -388,7 +384,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -399,20 +395,32 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-missing-prototypes -Wno-missing-variable-declarations \ + -Wno-poison-system-directories -Wno-strict-prototypes +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1989/Makefile b/1989/Makefile index 59740ffc3..953449a18 100644 --- a/1989/Makefile +++ b/1989/Makefile @@ -50,7 +50,7 @@ # tool locations ################ # -SHELL= /bin/bash +SHELL= bash MAKE= make diff --git a/1989/fubar/.gitignore b/1989/fubar/.gitignore new file mode 100644 index 000000000..f82486988 --- /dev/null +++ b/1989/fubar/.gitignore @@ -0,0 +1,3 @@ +fubar +ouroboros +ouroboros.c diff --git a/1989/fubar/Makefile b/1989/fubar/Makefile index 2295a232f..3ae32df95 100644 --- a/1989/fubar/Makefile +++ b/1989/fubar/Makefile @@ -327,29 +327,25 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings +# Common C compiler warnings to silence # -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra +#CSILENCE= +CSILENCE= -Wno-implicit-function-declaration -Wno-incompatible-library-redeclaration + +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} #CWARN= -Wall -Wextra ${CSILENCE} CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} -# Silence warnings that ${CWARN} would normally complain about -# -CSILENCE= -Wno-implicit-function-declaration -Wno-incompatible-library-redeclaration -#CSILENCE= -Wno-implicit-int - -# compiler standard +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,12 +357,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -375,7 +371,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -388,7 +384,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -399,20 +395,31 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +#CSILENCE+= +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## @@ -423,11 +430,11 @@ ENTRY= fubar PROG= ${ENTRY} # OBJ= ${PROG}.o -DATA= fubar.sh fubar.orig.sh +DATA= fubar.sh TARGET= ${PROG} # -ALT_OBJ= ${PROG}.orig.o -ALT_TARGET= ${PROG}.orig +ALT_OBJ= +ALT_TARGET= ################# diff --git a/1989/fubar/README.md b/1989/fubar/README.md index aec2ed9c6..041b24763 100644 --- a/1989/fubar/README.md +++ b/1989/fubar/README.md @@ -1,4 +1,4 @@ -Best self-modifying program: +# Best self-modifying program: Jay Vosburgh Sequent Computer Systems, Inc @@ -7,38 +7,22 @@ Best self-modifying program: 97006 USA -Judges notes: +## To build: + + make all + +### To run + + ./fubar 2 + +## Judges' comments Run this with a single digit argument (or wait a long time). - There are 2 versions of this program, the one that was entered, - and one that was changed by the judges to be more portable. The - makefile runs the latter version by default. - The blank line at the beginning of the source is mandatory. Do you know why? - The shell script run by the makefile joins lines that may be - cut up by mailers. The file "fubar.orig.c", for example, needs - the 6th and 7th lines joined together (with a space between - them) to recreate the original entry. If you fix the file, you - will need to change the last 8 linnes of "fubar.orig.sh" to read: - - cp fubar.orig.c ouroboros.c - chmod +x ouroboros.c - csh ouroboros.c $1 - rm -f ouroboros.c x1 x - - The more portable version, "fubar.c", can be fixed by joining the - 7th and 8th lines in the same way. As well, if you fix "fubar.c" - you will need to also change the last 8 lines to "fubar.sh" to read: - - cp fubar.c ouroboros.c - chmod +x ouroboros.c - csh ouroboros.c $1 - rm -f ouroboros.c x1 x - -Selected notes from the author: +## Author's comments In a nutshell, this is probably the slowest and most obnoxious factorial program ever written. Unfortunately, diff --git a/1989/fubar/fubar.orig.c b/1989/fubar/fubar.orig.c deleted file mode 100644 index d566c64ca..000000000 --- a/1989/fubar/fubar.orig.c +++ /dev/null @@ -1,18 +0,0 @@ -#include -#define QQ 1 -#define TT 1 -#define cc main(c,v) int c; char **v;{char tt[12],qq[7]; int q=0,o=1,l=1,m=1;struct {int c;} f; -#define incest qq[6]='\0';tt[11]='\0';if(QQ==atoi(v[1])+1){(void)fprintf(stderr,"%s factorial = %d\n",v[1], TT);exit(1);}o=c+f -#define x ;while(EOF!=(o=getchar())){if(l && q=='Q' && o=='Q'){l=0;(void)getchar();(void)fread(qq,6,1,stdin);(void)printf("Q %6d",atoi(qq)+1);}else -if(m && q=='T' && o=='T'){m=0;(void)fread(tt,11,1,stdin);(void)printf("T %9d\n",atoi(tt)*QQ);}else {q=o;(void)putchar(o);}}exit(0);} -cc incest.c -o x -#define zxc ;{/* -cat incest.c | x $1 >! x1 -if ($status != 0) then -exit -endif -mv x1 incest.c -chmod +x incest.c -exec incest.c $1 -exit -*/ diff --git a/1989/fubar/fubar.orig.sh b/1989/fubar/fubar.sh old mode 100644 new mode 100755 similarity index 87% rename from 1989/fubar/fubar.orig.sh rename to 1989/fubar/fubar.sh index 52e1136e3..248fd09aa --- a/1989/fubar/fubar.orig.sh +++ b/1989/fubar/fubar.sh @@ -1,4 +1,4 @@ -: +#!/usr/bin/env sh # to run fubar in the 'proper' way # parse args @@ -15,5 +15,5 @@ r fubar.c w ouroboros.c EOF chmod +x ouroboros.c -ouroboros.c $1 +./ouroboros.c $1 rm -f ouroboros.c x1 x diff --git a/1989/jar.1/.gitignore b/1989/jar.1/.gitignore new file mode 100644 index 000000000..c4791d11a --- /dev/null +++ b/1989/jar.1/.gitignore @@ -0,0 +1 @@ +jar.1 diff --git a/1989/jar.1/Makefile b/1989/jar.1/Makefile index 67d24cc15..8464ccd4c 100644 --- a/1989/jar.1/Makefile +++ b/1989/jar.1/Makefile @@ -327,29 +327,25 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings -# -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -# Silence warnings that ${CWARN} would normally complain about +# Common C compiler warnings to silence # CSILENCE= #CSILENCE= -Wno-implicit-int -# compiler standard +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +#CWARN= -Wall -Wextra ${CSILENCE} +CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,12 +357,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -375,7 +371,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -388,7 +384,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -399,20 +395,31 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +#CSILENCE+= +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1989/jar.2/.gitignore b/1989/jar.2/.gitignore new file mode 100644 index 000000000..f445be170 --- /dev/null +++ b/1989/jar.2/.gitignore @@ -0,0 +1 @@ +jar.2 diff --git a/1989/jar.2/Makefile b/1989/jar.2/Makefile index db2d8da90..154a11592 100644 --- a/1989/jar.2/Makefile +++ b/1989/jar.2/Makefile @@ -327,29 +327,25 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings -# -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra -CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -# Silence warnings that ${CWARN} would normally complain about +# Common C compiler warnings to silence # +#CSILENCE= CSILENCE= -Wno-implicit-function-declaration -Wno-missing-braces -Wno-parentheses -#CSILENCE= -Wno-implicit-int -# compiler standard +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +#CWARN= -Wall -Wextra ${CSILENCE} +CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,12 +357,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -375,7 +371,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -388,7 +384,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -399,20 +395,31 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +#CSILENCE+= +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1989/jar.2/README.md b/1989/jar.2/README.md index 7dea4eb46..297a10940 100644 --- a/1989/jar.2/README.md +++ b/1989/jar.2/README.md @@ -15,6 +15,9 @@ Judges notes: all this functionality in such a small, densely packed program, is impressive enough to win the Best of show award. + To have a chance to compile under a modern CPP, we had to + replace `#D` with `#define`. + Selected notes from the author: This program implements a Lisp interpreter in 1465 bytes of source. diff --git a/1989/jar.2/jar.2.orig.c b/1989/jar.2/jar.2.c similarity index 100% rename from 1989/jar.2/jar.2.orig.c rename to 1989/jar.2/jar.2.c diff --git a/1989/ovdluhe/.gitignore b/1989/ovdluhe/.gitignore new file mode 100644 index 000000000..14b8483be --- /dev/null +++ b/1989/ovdluhe/.gitignore @@ -0,0 +1 @@ +ovdluhe diff --git a/1989/ovdluhe/Makefile b/1989/ovdluhe/Makefile index 5345a25f7..aa28e69ab 100644 --- a/1989/ovdluhe/Makefile +++ b/1989/ovdluhe/Makefile @@ -327,30 +327,27 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings +# Common C compiler warnings to silence # -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra +#CSILENCE= +CSILENCE= -Wno-char-subscripts -Wno-constant-conversion -Wno-empty-body \ + -Wno-implicit-function-declaration -Wno-parentheses -Wno-unsequenced \ + -Wno-unused-variable + +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} #CWARN= -Wall -Wextra ${CSILENCE} CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} -# Silence warnings that ${CWARN} would normally complain about -# -CSILENCE= -Wno-char-subscripts -Wno-constant-conversion -Wno-empty-body \ - -Wno-implicit-function-declaration -Wno-parentheses -Wno-unsequenced -#CSILENCE= -Wno-implicit-int - -# compiler standard +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -362,12 +359,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -376,7 +373,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -389,7 +386,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -400,20 +397,33 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-comma -Wno-implicit-int-conversion -Wno-missing-prototypes \ + -Wno-missing-variable-declarations -Wno-poison-system-directories + -Wno-sign-conversion -Wno-strict-prototypes +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## @@ -427,8 +437,8 @@ OBJ= ${PROG}.o DATA= TARGET= ${PROG} # -ALT_OBJ= ${PROG}.orig.o -ALT_TARGET= ${PROG}.orig +ALT_OBJ= +ALT_TARGET= ################# @@ -451,10 +461,6 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} -${PROG}.orig: ${PROG}.orig.c - @echo "NOTE: The original source may not compile using modern compilers." - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - # data files # data: ${DATA} diff --git a/1989/ovdluhe/README.md b/1989/ovdluhe/README.md index 2e402d284..0d110e5ae 100644 --- a/1989/ovdluhe/README.md +++ b/1989/ovdluhe/README.md @@ -19,6 +19,9 @@ Judges notes: The program stops when it reaches the end of the template buffer by chance or is killed. + To have a chance to compile under a modern CPP, we had to + replace `#D` with `#define`. + Selected notes from the author: This program implements an "Eddington ape" - it generates diff --git a/1989/ovdluhe/ovdluhe.orig.c b/1989/ovdluhe/ovdluhe.c similarity index 70% rename from 1989/ovdluhe/ovdluhe.orig.c rename to 1989/ovdluhe/ovdluhe.c index a23ae84db..aaf0c3147 100644 --- a/1989/ovdluhe/ovdluhe.orig.c +++ b/1989/ovdluhe/ovdluhe.c @@ -1,15 +1,14 @@ #include typedef char ape -#define D define -#D EA register -#D EP unsigned -#D A 1 -#D AP (A<>A) -#D APE {EA EP ape ea=AE;while(ea--) e[ea]=E;} +#define EA register +#define EP unsigned +#define A 1 +#define AP (A<>A) +#define APE {EA EP ape,ea=AE;while(ea--) e[ea]=E;} ;ape a[PE+A],ap,*ae,p[P+A],e[AE]; main(){ape pe,*ep=a;srand((EP)time((long)E)); while(((*(ep++)=getchar())!=-A)&&((ep-a) USE=ansi compile with an ANSI compiler by default -#USE=ansi -# NOTE ==> USE=common compile with a common K&R compiler by default -#USE=common +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. +# +# Regarding individual entries: +# +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. +# +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. +# +# GitHub pull requests are welcome: +# +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judges to +# consider. +# +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: +# +# https://github.com/ioccc-src/winner +# +################################################################################ -WINNERS= ant brnstnd buzzard cdupont davidguy dds fine rince westley +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# +# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# +# See: http://creativecommons.org/licenses/by-sa/3.0/ -all: - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -k -f common.mk all; \ - ${MAKE} -k -f common.mk all; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -k -f ansi.mk all; \ - ${MAKE} -k -f ansi.mk all; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1; \ - fi -ansi: - ${MAKE} -f ansi.mk all +############################# +# shell used by this Makefile +############################# +# +SHELL= bash -common: - ${MAKE} -f common.mk all +####################### +# common tool locations +####################### +# +A2P= a2p +AR= ar +ASA= asa +AT= at +ATQ= atq +ATRM= atrm +AWK= awk +BANNER= banner +BASE64= base64 +BASENAME= basename +BATCH= batch +BC= bc +BINHEX= binhex +BISON= bison +BUNZIP2= bunzip2 +BZCAT= bzcat +BZCMP= bzcmp +BZDIFF= bzdiff +BZEGREP= bzegrep +BZFGREP= bzfgrep +BZGREP= bzgrep +BZIP2= bzip2 +BZLESS= bzless +BZMORE= bzmore +C2PH= c2ph +C89= c89 +C99= c99 +CAL= cal +CALC= calc +CAT= cat +CD= cd +CHFLAGS= chflags +CHGRP= chgrp +CHMOD= chmod +CKSUM= cksum +CLANG= clang +CLANG_PLUSPLUS= clang++ +CLEAR= clear +CMP= cmp +COL= col +COLLDEF= colldef +COLRM= colrm +COLUMN= column +COMPRESS= compress +CP= cp +CPIO= cpio +CPP= cpp +CRC32= crc32 +CSH= csh +CSPLIT= csplit +CURL= curl +CUT= cut +C_PLUSPLUS= c++ +C_PLUSPLUS_FILT= c++filt +DATE= date +DC= dc +DD= dd +DF= df +DIFF3= diff3 +DIFF= diff +DIG= dig +DIRNAME= dirname +ED= ed +EGREP= egrep +ENV= env +EQN= eqn +ETAGS= etags +EXPECT= expect +EXPR= expr +FALSE= false +FGREP= fgrep +FILE= file +FIND2PERL= find2perl +FIND= find +FLEX= flex +FLEX_PLUSPLUS= flex++ +FMT= fmt +FOLD= fold +FS_USAGE= fs_usage +FUNZIP= funzip +FUSER= fuser +GCC= gcc +GDIFFMK= gdiffmk +GENCAT= gencat +GENSTRINGS= genstrings +GETOPT= getopt +GETOPTS= getopts +GINDENT= gindent +GNUMAKE= gnumake +GREP= grep +GROFF= groff +GROFFER= groffer +GROG= grog +GROPS= grops +GROTTY= grotty +GUNZIP= gunzip +GVIM= gvim +GZCAT= gzcat +GZEXE= gzexe +GZIP_PROG= gzip +G_PLUSPLUS= g++ +H2PH= h2ph +H2XS= h2xs +HASH= hash +HEAD= head +HOSTNAME_PROG= hostname +ICONV= iconv +ID= id +INDENT= indent +INFO= info +JOT= jot +KILL= kill +KSH= ksh +LAST= last +LD= ld +LESSECHO= lessecho +LEX= len +LINK= link +LN= ln +LS= ls +M4= m4 +MAKE= make +MAN= man +MKDIR= mkdir +MKFIFO= mkfifo +MKTEMP= mktemp +MV= mv +NANO= nano +NASM= nasm +NEQN= neqn +NICE= nice +NL= nl +NM= nm +NOHUP= nohup +NROFF= nroff +NSLOOKUP= nslookup +OD= od +OPENSSL= openssl +PASTE= paste +PATCH= patch +PATHCHK= pathchk +PAX= pax +PERL= perl +PICO= pico +PR= pr +PRINTENV= printenv +PS= ps +PTAR= ptar +PTARDIFF= ptardiff +PTARGREP= ptargrep +PWD= pwd +PYDOC= pydoc +PYTHON= python +PYTHONW= pythonw +READLINK= readlink +RENICE= renice +RESET= reset +REV= rev +RI= ri +RM= rm +RMDIR= rmdir +RSYNC= rsync +RUBY= ruby +RVIM= rvim +SAY= say +SCP= scp +SCREEN= screen +SCRIPT= script +SDIFF= sdiff +SED= sed +SEQ= seq +SFTP= sftp +SH= sh +SHA1= sha1 +SHA= sha +SHAR= shar +SHASUM5_18= shasum5.18 +SHASUM= shasum +SIZE= size +SLEEP= sleep +SORT= sort +SSH= ssh +STAT= stat +STRIP= strip +STTY= stty +SUM= sum +SYNC= sync +TABS= tabs +TAIL= tail +TAR= tar +TEE= tee +TEST= test +TFTP= tftp +TIDY= tidy +TIME= time +TOP= top +TOUCH= touch +TPUT= tout +TPUT= tput +TR= tr +TROFF= troff +TRUE= true +TSET= tset +TSORT= tsort +UL= ul +UNAME= uname +UNCOMPRESS= uncompress +UNEXPAND= unexpand +UNIFDEF= unifdef +UNIFDEFALL= unifdefall +UNIQ= uniq +UNITS= units +UNLINK= unlink +UNZIP= unzip +UNZIPSFX= unzipsfx +UPTIME= uptime +UUDECODE= uudecode +UUENCODE= uuencode +UUIDGEN= uuidgen +VI= vi +VIEW= view +VIM= vim +VIMDIFF= vimdiff +W= w +WAIT4PATH= wait4path +WAIT= wait +WC= wc +WGET= wget +WHAT= what +WHATIS= whatis +WHICH= which +WHO= who +WHOAMI= whoami +WHOIS= whois +WRTIE= write +XAR= xar +XARGS= xargs +XATTR= xattr +XXD= xxd +YACC= yacc +YES= yes +ZCAT= zcat +ZCMP= zcmp +ZDIFF= zdiff +ZEGREP= zegrep +ZFGREP= zfgrep +ZFORCE= zforce +ZGREP= zgrep +ZIP= zip +ZIPCLOAK= zipcloak +ZIPGREp= zipgrep +ZIPINFo= zipinfo +ZIPNOTE= zipnote +ZIPSPLIT= zipsplit +ZLESS= zless +ZMORE= zmore +ZNEW= znew +ZPRINT= zprint +ZSH= zsh -${WINNERS} merlyn.c nextmove.c ttt_game.c: - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Set X11_LIBDIR to the directory where the X11 library resides +# +#X11_LIBDIR= /usr/X11R6/lib +#X11_LIBDIR= /usr/X11/lib +X11_LIBDIR= /opt/X11/lib -ttt: ttt.sh - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# +#X11_INCDIR= /usr/X11R6/include +#X11_INCDIR= /usr/X11/include +X11_INCDIR= /opt/X11/include -merlyn: merlyn.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@ \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Common C compiler warnings to silence +# +#CSILENCE= +CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-empty-body \ + -Wno-implicit-function-declaration -Wno-return-type -ttt_game: ttt_game.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +CWARN= -Wall -Wextra ${CSILENCE} +#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -nextmove: nextmove.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Compiler standard +# +#CSTD= +#CSTD= -ansi +CSTD= -std=gnu90 +# Compiler bit architecture +# +# Some entries require 32-bitness: +# ARCH= -m32 +# +# Some entries require 64-bitness: +# ARCH= -m64 +# +# By default we assume nothing: +# +ARCH= + +# Defines that are needed to compile +# +#CDEFINE= +CDEFINE= -DMODE=0600 -DBUF=32767 + +# Include files that are needed to compile +# +CINCLUDE= +#CINCLUDE= -include stdlib.h +#CINCLUDE= -include stdio.h +#CINCLUDE= -include stdlib.h -include stdio.h +#CINCLUDE= -I ${X11_INCDIR} +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 + +# Optimization +# +# Most compiles will safely use -O2. Some can use only -O1 or -O. +# A few compilers have broken optimizers or this entry make break +# under those buggy optimizers and thus you may not want anything. +# Reasonable compilers will allow for -O3. +# +#OPT= +#OPT= -O +#OPT= -O1 +#OPT= -O2 +OPT= -O3 + +# Default flags for ANSI C compilation +# +CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} + +# Libraries needed to build +# +#LIBS= +LIBS= -lcurses -ltermcap +#LIBS= -L ${X11_LIBDIR} -lX11 +#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL + +# C compiler to use +# +CC= cc +#CC=clang +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-comma -Wno-implicit-int-conversion -Wno-missing-prototypes \ + -Wno-missing-variable-declarations -Wno-pedantic \ + -Wno-poison-system-directories -Wno-shadow -Wno-shorten-64-to-32 \ + -Wno-strict-prototypes +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif + + +############################## +# Special flags for this entry +############################## +# +ENTRY= ant +PROG= ${ENTRY} +# +OBJ= ${PROG}.o +DATA= +TARGET= ${PROG} +# +ALT_OBJ= +ALT_TARGET= + + +################# +# build the entry +################# +# +all: data ${TARGET} + @${TRUE} + +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto + +${PROG}: ${PROG}.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + +# alternative executable +# +alt: data ${ALT_TARGET} + @${TRUE} + +# data files +# +data: ${DATA} + @${TRUE} + +# both all and alt +# +everything: all alt + + +############### +# utility rules +############### +# clean: - ${MAKE} -f ansi.mk clean - ${MAKE} -f common.mk clean -clobber: - ${MAKE} -f ansi.mk clobber - ${MAKE} -f common.mk clobber -nuke: clobber - ${MAKE} -f ansi.mk nuke - ${MAKE} -f common.mk nuke + ${RM} -f ${OBJ} ${ALT_OBJ} + @-if [ -f indent.c ]; then \ + echo ${RM} -f indent.c; \ + ${RM} -f indent.c; \ + fi + +clobber: clean + ${RM} -f ${TARGET} ${ALT_TARGET} + @-if [ -e sandwich ]; then \ + ${RM} -f sandwich; \ + echo 'ate sandwich'; \ + fi + install: - ${MAKE} -f ansi.mk install - ${MAKE} -f common.mk install + @echo "Dr. Spock says that is not logical!" + @${TRUE} + +# you may be able to misunderstand the source by reading indent.c +# +indent.c: ${PROG}.c + @if which "${GINDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${GINDENT} < $< > $@"; \ + ${GINDENT} < $< > $@; \ + elif which "${INDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${INDENT} < $< > $@"; \ + ${INDENT} < $< > $@; \ + else \ + echo "no intent tool found, ident $< yourself, sorry"; \ + echo "exit 1"; \ + exit 1; \ + fi + + +################## +# 133t hacker rulz +################## +# +love: + @echo 'not war?' + @${TRUE} + +haste: + $(MAKE) waste + @${TRUE} + +waste: + @echo 'haste' + @${TRUE} + +maker: + @echo 'Participate in a maker faire' + @${TRUE} + +easter_egg: + @echo "you expected to often misunderstand this $${RANDOM} magic" + @echo "chongo '' /\\oo/\\" + @echo "Eggy" + +sandwich: easter_egg + @if [ `id -u` -eq 0 ]; then \ + echo 'Okay.'; \ + echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ + else \ + echo 'What? Make it yourself.'; \ + exit 1; \ + fi + +# Understand the history of the Homebrew Computer Club +# as well as the West Coast Computer Faire and +# you might be confused different. :-) +# +supernova: sandwich + @-if [ -r .code_anal ]; then \ + ${RM} -f .code_anal_v6; \ + else \ + echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ + fi + @echo "A $@ helps ${MAKE} the elements that help form planets" + @${TRUE} + +deep_magic: supernova + @-if [ -r .code_anal ]; then \ + ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ + --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + fi + @${TRUE} + +magic: deep_magic + @-if [ -r .code_anal ]; then \ + ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "If you don't eat yer meat, you can't have any pudding!"; \ + echo "How can you have any pudding if you don't eat yer meat?!"; \ + fi + @${TRUE} + +# The IOCCC resident astronomer states +# +charon: magic + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore IAU, $@ is a planet" + +pluto: charon + ${MAKE} charon + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore, $@ is a planet" + @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" diff --git a/1991/ant/README.md b/1991/ant/README.md index 899eb5fa1..f01cd6f6b 100644 --- a/1991/ant/README.md +++ b/1991/ant/README.md @@ -6,27 +6,22 @@ Waterloo, On Waterloo, On Canada, N2J 2W9 Canada, N2L 6G9 - ## To build: make all - ### To run cp ant.hint hill ./ant hill - ## Judges' comments - The author was kind enough to supply a list of references below, in case you are still confused after read the source! :-) ## Author's comments - Ant's Editor vIOCCC91 Text files consists of lines of printable text or tab characters. diff --git a/1991/brnstnd/.gitignore b/1991/brnstnd/.gitignore new file mode 100644 index 000000000..30030af9d --- /dev/null +++ b/1991/brnstnd/.gitignore @@ -0,0 +1 @@ +brnstnd diff --git a/1991/brnstnd/Makefile b/1991/brnstnd/Makefile index 57c7302a6..7ccc552d7 100644 --- a/1991/brnstnd/Makefile +++ b/1991/brnstnd/Makefile @@ -1,129 +1,597 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1991 makefile +# IOCCC 1991 winning entry - brnstnd + +################################################################################ # -# Copyright (c) 1991, Landon Curt Noll & Larry Bassel. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll and Larry Bassel. - - -SHELL=/bin/sh -MAKE=make -MAKEFLAGS=e - -# uncomment the line to select the preferred type of compile +# An Historical Makefile NOTE: # -# You should also check the ansi.mk or common.mk for the -# proper compiler name and flags. +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. # -# NOTE ==> USE=ansi compile with an ANSI compiler by default -#USE=ansi -# NOTE ==> USE=common compile with a common K&R compiler by default -#USE=common +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. +# +# Regarding individual entries: +# +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. +# +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. +# +# GitHub pull requests are welcome: +# +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judges to +# consider. +# +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: +# +# https://github.com/ioccc-src/winner +# +################################################################################ -WINNERS= ant brnstnd buzzard cdupont davidguy dds fine rince westley +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# +# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# +# See: http://creativecommons.org/licenses/by-sa/3.0/ -all: - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -k -f common.mk all; \ - ${MAKE} -k -f common.mk all; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -k -f ansi.mk all; \ - ${MAKE} -k -f ansi.mk all; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1; \ - fi -ansi: - ${MAKE} -f ansi.mk all +############################# +# shell used by this Makefile +############################# +# +SHELL= bash -common: - ${MAKE} -f common.mk all +####################### +# common tool locations +####################### +# +A2P= a2p +AR= ar +ASA= asa +AT= at +ATQ= atq +ATRM= atrm +AWK= awk +BANNER= banner +BASE64= base64 +BASENAME= basename +BATCH= batch +BC= bc +BINHEX= binhex +BISON= bison +BUNZIP2= bunzip2 +BZCAT= bzcat +BZCMP= bzcmp +BZDIFF= bzdiff +BZEGREP= bzegrep +BZFGREP= bzfgrep +BZGREP= bzgrep +BZIP2= bzip2 +BZLESS= bzless +BZMORE= bzmore +C2PH= c2ph +C89= c89 +C99= c99 +CAL= cal +CALC= calc +CAT= cat +CD= cd +CHFLAGS= chflags +CHGRP= chgrp +CHMOD= chmod +CKSUM= cksum +CLANG= clang +CLANG_PLUSPLUS= clang++ +CLEAR= clear +CMP= cmp +COL= col +COLLDEF= colldef +COLRM= colrm +COLUMN= column +COMPRESS= compress +CP= cp +CPIO= cpio +CPP= cpp +CRC32= crc32 +CSH= csh +CSPLIT= csplit +CURL= curl +CUT= cut +C_PLUSPLUS= c++ +C_PLUSPLUS_FILT= c++filt +DATE= date +DC= dc +DD= dd +DF= df +DIFF3= diff3 +DIFF= diff +DIG= dig +DIRNAME= dirname +ED= ed +EGREP= egrep +ENV= env +EQN= eqn +ETAGS= etags +EXPECT= expect +EXPR= expr +FALSE= false +FGREP= fgrep +FILE= file +FIND2PERL= find2perl +FIND= find +FLEX= flex +FLEX_PLUSPLUS= flex++ +FMT= fmt +FOLD= fold +FS_USAGE= fs_usage +FUNZIP= funzip +FUSER= fuser +GCC= gcc +GDIFFMK= gdiffmk +GENCAT= gencat +GENSTRINGS= genstrings +GETOPT= getopt +GETOPTS= getopts +GINDENT= gindent +GNUMAKE= gnumake +GREP= grep +GROFF= groff +GROFFER= groffer +GROG= grog +GROPS= grops +GROTTY= grotty +GUNZIP= gunzip +GVIM= gvim +GZCAT= gzcat +GZEXE= gzexe +GZIP_PROG= gzip +G_PLUSPLUS= g++ +H2PH= h2ph +H2XS= h2xs +HASH= hash +HEAD= head +HOSTNAME_PROG= hostname +ICONV= iconv +ID= id +INDENT= indent +INFO= info +JOT= jot +KILL= kill +KSH= ksh +LAST= last +LD= ld +LESSECHO= lessecho +LEX= len +LINK= link +LN= ln +LS= ls +M4= m4 +MAKE= make +MAN= man +MKDIR= mkdir +MKFIFO= mkfifo +MKTEMP= mktemp +MV= mv +NANO= nano +NASM= nasm +NEQN= neqn +NICE= nice +NL= nl +NM= nm +NOHUP= nohup +NROFF= nroff +NSLOOKUP= nslookup +OD= od +OPENSSL= openssl +PASTE= paste +PATCH= patch +PATHCHK= pathchk +PAX= pax +PERL= perl +PICO= pico +PR= pr +PRINTENV= printenv +PS= ps +PTAR= ptar +PTARDIFF= ptardiff +PTARGREP= ptargrep +PWD= pwd +PYDOC= pydoc +PYTHON= python +PYTHONW= pythonw +READLINK= readlink +RENICE= renice +RESET= reset +REV= rev +RI= ri +RM= rm +RMDIR= rmdir +RSYNC= rsync +RUBY= ruby +RVIM= rvim +SAY= say +SCP= scp +SCREEN= screen +SCRIPT= script +SDIFF= sdiff +SED= sed +SEQ= seq +SFTP= sftp +SH= sh +SHA1= sha1 +SHA= sha +SHAR= shar +SHASUM5_18= shasum5.18 +SHASUM= shasum +SIZE= size +SLEEP= sleep +SORT= sort +SSH= ssh +STAT= stat +STRIP= strip +STTY= stty +SUM= sum +SYNC= sync +TABS= tabs +TAIL= tail +TAR= tar +TEE= tee +TEST= test +TFTP= tftp +TIDY= tidy +TIME= time +TOP= top +TOUCH= touch +TPUT= tout +TPUT= tput +TR= tr +TROFF= troff +TRUE= true +TSET= tset +TSORT= tsort +UL= ul +UNAME= uname +UNCOMPRESS= uncompress +UNEXPAND= unexpand +UNIFDEF= unifdef +UNIFDEFALL= unifdefall +UNIQ= uniq +UNITS= units +UNLINK= unlink +UNZIP= unzip +UNZIPSFX= unzipsfx +UPTIME= uptime +UUDECODE= uudecode +UUENCODE= uuencode +UUIDGEN= uuidgen +VI= vi +VIEW= view +VIM= vim +VIMDIFF= vimdiff +W= w +WAIT4PATH= wait4path +WAIT= wait +WC= wc +WGET= wget +WHAT= what +WHATIS= whatis +WHICH= which +WHO= who +WHOAMI= whoami +WHOIS= whois +WRTIE= write +XAR= xar +XARGS= xargs +XATTR= xattr +XXD= xxd +YACC= yacc +YES= yes +ZCAT= zcat +ZCMP= zcmp +ZDIFF= zdiff +ZEGREP= zegrep +ZFGREP= zfgrep +ZFORCE= zforce +ZGREP= zgrep +ZIP= zip +ZIPCLOAK= zipcloak +ZIPGREp= zipgrep +ZIPINFo= zipinfo +ZIPNOTE= zipnote +ZIPSPLIT= zipsplit +ZLESS= zless +ZMORE= zmore +ZNEW= znew +ZPRINT= zprint +ZSH= zsh -${WINNERS} merlyn.c nextmove.c ttt_game.c: - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Set X11_LIBDIR to the directory where the X11 library resides +# +#X11_LIBDIR= /usr/X11R6/lib +#X11_LIBDIR= /usr/X11/lib +X11_LIBDIR= /opt/X11/lib -ttt: ttt.sh - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# +#X11_INCDIR= /usr/X11R6/include +#X11_INCDIR= /usr/X11/include +X11_INCDIR= /opt/X11/include -merlyn: merlyn.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@ \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Common C compiler warnings to silence +# +#CSILENCE= +CSILENCE= -Wno-c99-extensions -Wno-error -Wno-implicit-function-declaration \ + -Wno-parentheses -Wno-return-type -ttt_game: ttt_game.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +#CWARN= -Wall -Wextra ${CSILENCE} +CWARN= -Wall -Wextra -pedantic ${CSILENCE} -nextmove: nextmove.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Compiler standard +# +#CSTD= +#CSTD= -ansi +CSTD= -std=gnu90 +# Compiler bit architecture +# +# Some entries require 32-bitness: +# ARCH= -m32 +# +# Some entries require 64-bitness: +# ARCH= -m64 +# +# By default we assume nothing: +# +ARCH= + +# Defines that are needed to compile +# +#CDEFINE= +CDEFINE= -DM=malloc -DX=free -Do=250 + +# Include files that are needed to compile +# +CINCLUDE= +#CINCLUDE= -include stdlib.h +#CINCLUDE= -include stdio.h +#CINCLUDE= -include stdlib.h -include stdio.h +#CINCLUDE= -I ${X11_INCDIR} +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 + +# Optimization +# +# Most compiles will safely use -O2. Some can use only -O1 or -O. +# A few compilers have broken optimizers or this entry make break +# under those buggy optimizers and thus you may not want anything. +# Reasonable compilers will allow for -O3. +# +#OPT= +#OPT= -O +#OPT= -O1 +#OPT= -O2 +OPT= -O3 + +# Default flags for ANSI C compilation +# +CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} + +# Libraries needed to build +# +LIBS= +#LIBS= -lm +#LIBS= -L ${X11_LIBDIR} -lX11 +#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL + +# C compiler to use +# +CC= cc +#CC=clang +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-implicit-int-conversion -Wno-missing-prototypes \ + -Wno-missing-variable-declarations -Wno-poison-system-directories \ + -Wno-shorten-64-to-32 -Wno-sign-conversion -Wno-strict-prototypes +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif + + +############################## +# Special flags for this entry +############################## +# +ENTRY= brnstnd +PROG= ${ENTRY} +# +OBJ= ${PROG}.o +DATA= +TARGET= ${PROG} +# +ALT_OBJ= +ALT_TARGET= + + +################# +# build the entry +################# +# +all: data ${TARGET} + @${TRUE} + +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto + +${PROG}: ${PROG}.c + @echo "NOTE: This entry may not compile when using modern compilers." + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + +# alternative executable +# +alt: data ${ALT_TARGET} + @${TRUE} + +# data files +# +data: ${DATA} + @${TRUE} + +# both all and alt +# +everything: all alt + + +############### +# utility rules +############### +# clean: - ${MAKE} -f ansi.mk clean - ${MAKE} -f common.mk clean -clobber: - ${MAKE} -f ansi.mk clobber - ${MAKE} -f common.mk clobber -nuke: clobber - ${MAKE} -f ansi.mk nuke - ${MAKE} -f common.mk nuke + ${RM} -f ${OBJ} ${ALT_OBJ} + @-if [ -f indent.c ]; then \ + echo ${RM} -f indent.c; \ + ${RM} -f indent.c; \ + fi + +clobber: clean + ${RM} -f ${TARGET} ${ALT_TARGET} + @-if [ -e sandwich ]; then \ + ${RM} -f sandwich; \ + echo 'ate sandwich'; \ + fi + install: - ${MAKE} -f ansi.mk install - ${MAKE} -f common.mk install + @echo "Dr. Spock says that is not logical!" + @${TRUE} + +# you may be able to misunderstand the source by reading indent.c +# +indent.c: ${PROG}.c + @if which "${GINDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${GINDENT} < $< > $@"; \ + ${GINDENT} < $< > $@; \ + elif which "${INDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${INDENT} < $< > $@"; \ + ${INDENT} < $< > $@; \ + else \ + echo "no intent tool found, ident $< yourself, sorry"; \ + echo "exit 1"; \ + exit 1; \ + fi + + +################## +# 133t hacker rulz +################## +# +love: + @echo 'not war?' + @${TRUE} + +haste: + $(MAKE) waste + @${TRUE} + +waste: + @echo 'haste' + @${TRUE} + +maker: + @echo 'Participate in a maker faire' + @${TRUE} + +easter_egg: + @echo "you expected to often misunderstand this $${RANDOM} magic" + @echo "chongo '' /\\oo/\\" + @echo "Eggy" + +sandwich: easter_egg + @if [ `id -u` -eq 0 ]; then \ + echo 'Okay.'; \ + echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ + else \ + echo 'What? Make it yourself.'; \ + exit 1; \ + fi + +# Understand the history of the Homebrew Computer Club +# as well as the West Coast Computer Faire and +# you might be confused different. :-) +# +supernova: sandwich + @-if [ -r .code_anal ]; then \ + ${RM} -f .code_anal_v6; \ + else \ + echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ + fi + @echo "A $@ helps ${MAKE} the elements that help form planets" + @${TRUE} + +deep_magic: supernova + @-if [ -r .code_anal ]; then \ + ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ + --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + fi + @${TRUE} + +magic: deep_magic + @-if [ -r .code_anal ]; then \ + ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "If you don't eat yer meat, you can't have any pudding!"; \ + echo "How can you have any pudding if you don't eat yer meat?!"; \ + fi + @${TRUE} + +# The IOCCC resident astronomer states +# +charon: magic + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore IAU, $@ is a planet" + +pluto: charon + ${MAKE} charon + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore, $@ is a planet" + @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" diff --git a/1991/brnstnd/README.md b/1991/brnstnd/README.md index b2169e7d9..952f5a23b 100644 --- a/1991/brnstnd/README.md +++ b/1991/brnstnd/README.md @@ -1,15 +1,19 @@ -Best Of Show: +# Best Of Show: Daniel J. Bernstein New York University +## To build: -Judges' comments: + make all - Make and run. Try: + NOTE: This entry may not compile when using modern compilers. - make brnstnd - brnstnd < sorta.i2+2 +### To run + + ./brnstnd < sorta.i2+2 + +## Judges' comments For info on more examples, read the sorta.README file. @@ -18,16 +22,14 @@ Judges' comments: by this blatant attempt to influence the contest and rejected this idea... so we gave it the Best of Show award instead!! - NOTE: Due to minor problems with some ANSI C compilers, we have - supplied a more portable ANSI version. See the top level - README file for details. - NOTE: One should remove the final trailing newline to obtain the original source file. This step is not needed to compile this entry. - -Selected notes from the author: + To have a chance to compile under a modern CPP, we had to + replace `#D` with `#define`. + +## Author's comments This is an interpreter for the programming language SORTA, a systems and numerical programming language with features sorta from C, sorta diff --git a/1991/brnstnd/brnstnd.c b/1991/brnstnd/brnstnd.c index 015f2cac2..712ea195d 100644 --- a/1991/brnstnd/brnstnd.c +++ b/1991/brnstnd/brnstnd.c @@ -1,35 +1,34 @@ #include -#define D define -#D H(x,y,z) f(p){--p;c=x-_+1];f(c>0){y+1]=z[c];z[c]=y];y]=y+1];}} -#D O(x,y) F(x,int U;int T=0;d=M(U=1);W{f(c==y)b g[T++]=c;f(T==U)g=realloc(g,U<<=1);}g[T]=0;) -#D W Y((c=k?K[--k]:getchar())-EOF) -#D S i[q -#D F(w,z) f(c==w){z h} -#D f if -#D P p>1&&(c=u, -#D _ s[p -#D C =G -#D g S] -#D J(x,y) F(I[x],y) -#D Q P e -#D Y while -#D b break; -#D u _--] -#D m p&& -#D R char* -#D l Z[c] -#D L strlen -#D d i[++q] -#D G c) -#D h ;continue; -#D N s[++p] -#D e _] -#D j x;{R r=M(L( -#D v return -#D w [256] -#D V f(k>o||p>o||q>o)v 2; +#define H(x,y,z) f(p){--p;c=x-_+1];f(c>0){y+1]=z[c];z[c]=y];y]=y+1];}} +#define O(x,y) F(x,int U;int T=0;d=M(U=1);W{f(c==y)b g[T++]=c;f(T==U)g=realloc(g,U<<=1);}g[T]=0;) +#define W Y((c=k?K[--k]:getchar())-EOF) +#define S i[q +#define F(w,z) f(c==w){z h} +#define f if +#define P p>1&&(c=u, +#define _ s[p +#define C =G +#define g S] +#define J(x,y) F(I[x],y) +#define Q P e +#define Y while +#define b break; +#define u _--] +#define m p&& +#define R char* +#define l Z[c] +#define L strlen +#define d i[++q] +#define G c) +#define h ;continue; +#define N s[++p] +#define e _] +#define j x;{R r=M(L( +#define v return +#define w [256] +#define V f(k>o||p>o||q>o)v 2; R I="I'd love ta win: the most useful !$>%`/#<&*|^ _OBFUSCATED_ utility. Pleez?";U(y,x)R y;R*j*x)+L(y)+1);sprintf(r,"%s%s",*x,y);*x=r;}R T(x)R j x)+1);strcpy(r,x);v -r;}R(i w);static R(Z w);K w;main(a,A)int a;R*A;{int s w,p=0,q=0,n=0,c,k=0;W{V +r;}R(i w);static R(Z w);int K w;main(a,A)int a;R*A;{int s w,p=0,q=0,n=0,c,k=0;W{V f(c>='0'&&c<='9'){f(!n)N=0;n=1;e=10*e+(c-'0')h}n=0;J(39,m sprintf(d=M(13),"%d",e)) J(37,q&&puts(g))J(34,q&&printf("%s",g))J(27,H(p,_,s))O('[',']')J(56,f(p){c=e;N=c;})J(2,m--p)J(10,N=a)J(4,f(q){N=L(g);X(S--]);})J(1,f(q){S+1]=T(g);++q;})J(53,m diff --git a/1991/brnstnd/brnstnd_ansi.c b/1991/brnstnd/brnstnd_ansi.c deleted file mode 100644 index 712ea195d..000000000 --- a/1991/brnstnd/brnstnd_ansi.c +++ /dev/null @@ -1,42 +0,0 @@ -#include -#define H(x,y,z) f(p){--p;c=x-_+1];f(c>0){y+1]=z[c];z[c]=y];y]=y+1];}} -#define O(x,y) F(x,int U;int T=0;d=M(U=1);W{f(c==y)b g[T++]=c;f(T==U)g=realloc(g,U<<=1);}g[T]=0;) -#define W Y((c=k?K[--k]:getchar())-EOF) -#define S i[q -#define F(w,z) f(c==w){z h} -#define f if -#define P p>1&&(c=u, -#define _ s[p -#define C =G -#define g S] -#define J(x,y) F(I[x],y) -#define Q P e -#define Y while -#define b break; -#define u _--] -#define m p&& -#define R char* -#define l Z[c] -#define L strlen -#define d i[++q] -#define G c) -#define h ;continue; -#define N s[++p] -#define e _] -#define j x;{R r=M(L( -#define v return -#define w [256] -#define V f(k>o||p>o||q>o)v 2; -R I="I'd love ta win: the most useful !$>%`/#<&*|^ _OBFUSCATED_ utility. Pleez?";U(y,x)R y;R*j*x)+L(y)+1);sprintf(r,"%s%s",*x,y);*x=r;}R T(x)R j x)+1);strcpy(r,x);v -r;}R(i w);static R(Z w);int K w;main(a,A)int a;R*A;{int s w,p=0,q=0,n=0,c,k=0;W{V -f(c>='0'&&c<='9'){f(!n)N=0;n=1;e=10*e+(c-'0')h}n=0;J(39,m -sprintf(d=M(13),"%d",e)) -J(37,q&&puts(g))J(34,q&&printf("%s",g))J(27,H(p,_,s))O('[',']')J(56,f(p){c=e;N=c;})J(2,m--p)J(10,N=a)J(4,f(q){N=L(g);X(S--]);})J(1,f(q){S+1]=T(g);++q;})J(53,m -e>=0&&e1&&(--q,U(S+1],i+q)))J(5,q&&p>1&&(_-1]=open(g,_-1],e),--p,X(S--])))J(47,m -close(u)) -J(26,m(e=dup(e)))O('"','"')J(51,H(q,S,i))J(49,N=fork())J(12,wait(&N)+1||(e=-1))J(68,{++p;pipe(s+p++)==-1&&(e=-1);})F('q',v -0) -F('=',W{R x;f(m u)f(x=l){k+=n=L(x);V;Y(*x)K[--k]=*x++;k+=n;n=0;}b})J(15,f(q)W{l&&X(l);l=T(g);b})J(33,f(c=q){*i=g;g=0;Y(--q&&**(i+q))g++;f(q){N=execvp(*i,i+q+1);q=c;}})J(38,P -c&&(e/C)) -J(35,Q=e>G)F('+',Q+C)J(42,Q*C)J(41,Q=~(e&G))J(57,m(e=-e))J(3,)F('\n',)putchar(c);puts(73+I);}} diff --git a/1991/buzzard/.gitignore b/1991/buzzard/.gitignore new file mode 100644 index 000000000..5caf57610 --- /dev/null +++ b/1991/buzzard/.gitignore @@ -0,0 +1 @@ +buzzard diff --git a/1991/buzzard/Makefile b/1991/buzzard/Makefile index 57c7302a6..f4b249389 100644 --- a/1991/buzzard/Makefile +++ b/1991/buzzard/Makefile @@ -1,129 +1,597 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1991 makefile +# IOCCC 1991 winning entry - buzzard + +################################################################################ # -# Copyright (c) 1991, Landon Curt Noll & Larry Bassel. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll and Larry Bassel. - - -SHELL=/bin/sh -MAKE=make -MAKEFLAGS=e - -# uncomment the line to select the preferred type of compile +# An Historical Makefile NOTE: # -# You should also check the ansi.mk or common.mk for the -# proper compiler name and flags. +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. # -# NOTE ==> USE=ansi compile with an ANSI compiler by default -#USE=ansi -# NOTE ==> USE=common compile with a common K&R compiler by default -#USE=common +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. +# +# Regarding individual entries: +# +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. +# +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. +# +# GitHub pull requests are welcome: +# +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judges to +# consider. +# +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: +# +# https://github.com/ioccc-src/winner +# +################################################################################ -WINNERS= ant brnstnd buzzard cdupont davidguy dds fine rince westley +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# +# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# +# See: http://creativecommons.org/licenses/by-sa/3.0/ -all: - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -k -f common.mk all; \ - ${MAKE} -k -f common.mk all; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -k -f ansi.mk all; \ - ${MAKE} -k -f ansi.mk all; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1; \ - fi -ansi: - ${MAKE} -f ansi.mk all +############################# +# shell used by this Makefile +############################# +# +SHELL= bash -common: - ${MAKE} -f common.mk all +####################### +# common tool locations +####################### +# +A2P= a2p +AR= ar +ASA= asa +AT= at +ATQ= atq +ATRM= atrm +AWK= awk +BANNER= banner +BASE64= base64 +BASENAME= basename +BATCH= batch +BC= bc +BINHEX= binhex +BISON= bison +BUNZIP2= bunzip2 +BZCAT= bzcat +BZCMP= bzcmp +BZDIFF= bzdiff +BZEGREP= bzegrep +BZFGREP= bzfgrep +BZGREP= bzgrep +BZIP2= bzip2 +BZLESS= bzless +BZMORE= bzmore +C2PH= c2ph +C89= c89 +C99= c99 +CAL= cal +CALC= calc +CAT= cat +CD= cd +CHFLAGS= chflags +CHGRP= chgrp +CHMOD= chmod +CKSUM= cksum +CLANG= clang +CLANG_PLUSPLUS= clang++ +CLEAR= clear +CMP= cmp +COL= col +COLLDEF= colldef +COLRM= colrm +COLUMN= column +COMPRESS= compress +CP= cp +CPIO= cpio +CPP= cpp +CRC32= crc32 +CSH= csh +CSPLIT= csplit +CURL= curl +CUT= cut +C_PLUSPLUS= c++ +C_PLUSPLUS_FILT= c++filt +DATE= date +DC= dc +DD= dd +DF= df +DIFF3= diff3 +DIFF= diff +DIG= dig +DIRNAME= dirname +ED= ed +EGREP= egrep +ENV= env +EQN= eqn +ETAGS= etags +EXPECT= expect +EXPR= expr +FALSE= false +FGREP= fgrep +FILE= file +FIND2PERL= find2perl +FIND= find +FLEX= flex +FLEX_PLUSPLUS= flex++ +FMT= fmt +FOLD= fold +FS_USAGE= fs_usage +FUNZIP= funzip +FUSER= fuser +GCC= gcc +GDIFFMK= gdiffmk +GENCAT= gencat +GENSTRINGS= genstrings +GETOPT= getopt +GETOPTS= getopts +GINDENT= gindent +GNUMAKE= gnumake +GREP= grep +GROFF= groff +GROFFER= groffer +GROG= grog +GROPS= grops +GROTTY= grotty +GUNZIP= gunzip +GVIM= gvim +GZCAT= gzcat +GZEXE= gzexe +GZIP_PROG= gzip +G_PLUSPLUS= g++ +H2PH= h2ph +H2XS= h2xs +HASH= hash +HEAD= head +HOSTNAME_PROG= hostname +ICONV= iconv +ID= id +INDENT= indent +INFO= info +JOT= jot +KILL= kill +KSH= ksh +LAST= last +LD= ld +LESSECHO= lessecho +LEX= len +LINK= link +LN= ln +LS= ls +M4= m4 +MAKE= make +MAN= man +MKDIR= mkdir +MKFIFO= mkfifo +MKTEMP= mktemp +MV= mv +NANO= nano +NASM= nasm +NEQN= neqn +NICE= nice +NL= nl +NM= nm +NOHUP= nohup +NROFF= nroff +NSLOOKUP= nslookup +OD= od +OPENSSL= openssl +PASTE= paste +PATCH= patch +PATHCHK= pathchk +PAX= pax +PERL= perl +PICO= pico +PR= pr +PRINTENV= printenv +PS= ps +PTAR= ptar +PTARDIFF= ptardiff +PTARGREP= ptargrep +PWD= pwd +PYDOC= pydoc +PYTHON= python +PYTHONW= pythonw +READLINK= readlink +RENICE= renice +RESET= reset +REV= rev +RI= ri +RM= rm +RMDIR= rmdir +RSYNC= rsync +RUBY= ruby +RVIM= rvim +SAY= say +SCP= scp +SCREEN= screen +SCRIPT= script +SDIFF= sdiff +SED= sed +SEQ= seq +SFTP= sftp +SH= sh +SHA1= sha1 +SHA= sha +SHAR= shar +SHASUM5_18= shasum5.18 +SHASUM= shasum +SIZE= size +SLEEP= sleep +SORT= sort +SSH= ssh +STAT= stat +STRIP= strip +STTY= stty +SUM= sum +SYNC= sync +TABS= tabs +TAIL= tail +TAR= tar +TEE= tee +TEST= test +TFTP= tftp +TIDY= tidy +TIME= time +TOP= top +TOUCH= touch +TPUT= tout +TPUT= tput +TR= tr +TROFF= troff +TRUE= true +TSET= tset +TSORT= tsort +UL= ul +UNAME= uname +UNCOMPRESS= uncompress +UNEXPAND= unexpand +UNIFDEF= unifdef +UNIFDEFALL= unifdefall +UNIQ= uniq +UNITS= units +UNLINK= unlink +UNZIP= unzip +UNZIPSFX= unzipsfx +UPTIME= uptime +UUDECODE= uudecode +UUENCODE= uuencode +UUIDGEN= uuidgen +VI= vi +VIEW= view +VIM= vim +VIMDIFF= vimdiff +W= w +WAIT4PATH= wait4path +WAIT= wait +WC= wc +WGET= wget +WHAT= what +WHATIS= whatis +WHICH= which +WHO= who +WHOAMI= whoami +WHOIS= whois +WRTIE= write +XAR= xar +XARGS= xargs +XATTR= xattr +XXD= xxd +YACC= yacc +YES= yes +ZCAT= zcat +ZCMP= zcmp +ZDIFF= zdiff +ZEGREP= zegrep +ZFGREP= zfgrep +ZFORCE= zforce +ZGREP= zgrep +ZIP= zip +ZIPCLOAK= zipcloak +ZIPGREp= zipgrep +ZIPINFo= zipinfo +ZIPNOTE= zipnote +ZIPSPLIT= zipsplit +ZLESS= zless +ZMORE= zmore +ZNEW= znew +ZPRINT= zprint +ZSH= zsh -${WINNERS} merlyn.c nextmove.c ttt_game.c: - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Set X11_LIBDIR to the directory where the X11 library resides +# +#X11_LIBDIR= /usr/X11R6/lib +#X11_LIBDIR= /usr/X11/lib +X11_LIBDIR= /opt/X11/lib -ttt: ttt.sh - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# +#X11_INCDIR= /usr/X11R6/include +#X11_INCDIR= /usr/X11/include +X11_INCDIR= /opt/X11/include -merlyn: merlyn.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@ \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Common C compiler warnings to silence +# +#CSILENCE= +CSILENCE= -Wno-char-subscripts -Wno-error -Wno-implicit-function-declaration \ + -Wno-int-conversion -Wno-logical-op-parentheses -Wno-pedantic \ + -Wno-return-type -Wno-unknown-escape-sequence -Wno-unused-value -ttt_game: ttt_game.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +#CWARN= -Wall -Wextra ${CSILENCE} +CWARN= -Wall -Wextra -pedantic ${CSILENCE} -nextmove: nextmove.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Compiler standard +# +#CSTD= +#CSTD= -ansi +CSTD= -std=gnu90 +# Compiler bit architecture +# +# Some entries require 32-bitness: +# ARCH= -m32 +# +# Some entries require 64-bitness: +# ARCH= -m64 +# +# By default we assume nothing: +# +ARCH= + +# Defines that are needed to compile +# +CDEFINE= +#CDEFINE= -DIOCCC + +# Include files that are needed to compile +# +CINCLUDE= +#CINCLUDE= -include stdlib.h +#CINCLUDE= -include stdio.h +#CINCLUDE= -include stdlib.h -include stdio.h +#CINCLUDE= -I ${X11_INCDIR} +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 + +# Optimization +# +# Most compiles will safely use -O2. Some can use only -O1 or -O. +# A few compilers have broken optimizers or this entry make break +# under those buggy optimizers and thus you may not want anything. +# Reasonable compilers will allow for -O3. +# +#OPT= +#OPT= -O +#OPT= -O1 +#OPT= -O2 +OPT= -O3 + +# Default flags for ANSI C compilation +# +CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} + +# Libraries needed to build +# +LIBS= +#LIBS= -lm +#LIBS= -L ${X11_LIBDIR} -lX11 +#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL + +# C compiler to use +# +CC= cc +#CC=clang +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-comma -Wno-implicit-int-conversion -Wno-missing-prototypes \ + -Wno-missing-variable-declarations -Wno-poison-system-directories \ + -Wno-shadow -Wno-strict-prototypes +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif + + +############################## +# Special flags for this entry +############################## +# +ENTRY= buzzard +PROG= ${ENTRY} +# +OBJ= ${PROG}.o +DATA= +TARGET= ${PROG} +# +ALT_OBJ= +ALT_TARGET= + + +################# +# build the entry +################# +# +all: data ${TARGET} + @${TRUE} + +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto + +${PROG}: ${PROG}.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + +# alternative executable +# +alt: data ${ALT_TARGET} + @${TRUE} + +# data files +# +data: ${DATA} + @${TRUE} + +# both all and alt +# +everything: all alt + + +############### +# utility rules +############### +# clean: - ${MAKE} -f ansi.mk clean - ${MAKE} -f common.mk clean -clobber: - ${MAKE} -f ansi.mk clobber - ${MAKE} -f common.mk clobber -nuke: clobber - ${MAKE} -f ansi.mk nuke - ${MAKE} -f common.mk nuke + ${RM} -f ${OBJ} ${ALT_OBJ} + @-if [ -f indent.c ]; then \ + echo ${RM} -f indent.c; \ + ${RM} -f indent.c; \ + fi + +clobber: clean + ${RM} -f ${TARGET} ${ALT_TARGET} + @-if [ -e sandwich ]; then \ + ${RM} -f sandwich; \ + echo 'ate sandwich'; \ + fi + install: - ${MAKE} -f ansi.mk install - ${MAKE} -f common.mk install + @echo "Dr. Spock says that is not logical!" + @${TRUE} + +# you may be able to misunderstand the source by reading indent.c +# +indent.c: ${PROG}.c + @if which "${GINDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${GINDENT} < $< > $@"; \ + ${GINDENT} < $< > $@; \ + elif which "${INDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${INDENT} < $< > $@"; \ + ${INDENT} < $< > $@; \ + else \ + echo "no intent tool found, ident $< yourself, sorry"; \ + echo "exit 1"; \ + exit 1; \ + fi + + +################## +# 133t hacker rulz +################## +# +love: + @echo 'not war?' + @${TRUE} + +haste: + $(MAKE) waste + @${TRUE} + +waste: + @echo 'haste' + @${TRUE} + +maker: + @echo 'Participate in a maker faire' + @${TRUE} + +easter_egg: + @echo "you expected to often misunderstand this $${RANDOM} magic" + @echo "chongo '' /\\oo/\\" + @echo "Eggy" + +sandwich: easter_egg + @if [ `id -u` -eq 0 ]; then \ + echo 'Okay.'; \ + echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ + else \ + echo 'What? Make it yourself.'; \ + exit 1; \ + fi + +# Understand the history of the Homebrew Computer Club +# as well as the West Coast Computer Faire and +# you might be confused different. :-) +# +supernova: sandwich + @-if [ -r .code_anal ]; then \ + ${RM} -f .code_anal_v6; \ + else \ + echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ + fi + @echo "A $@ helps ${MAKE} the elements that help form planets" + @${TRUE} + +deep_magic: supernova + @-if [ -r .code_anal ]; then \ + ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ + --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + fi + @${TRUE} + +magic: deep_magic + @-if [ -r .code_anal ]; then \ + ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "If you don't eat yer meat, you can't have any pudding!"; \ + echo "How can you have any pudding if you don't eat yer meat?!"; \ + fi + @${TRUE} + +# The IOCCC resident astronomer states +# +charon: magic + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore IAU, $@ is a planet" + +pluto: charon + ${MAKE} charon + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore, $@ is a planet" + @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" diff --git a/1991/buzzard/README.md b/1991/buzzard/README.md index fbeb55ac7..2edd28dd7 100644 --- a/1991/buzzard/README.md +++ b/1991/buzzard/README.md @@ -6,20 +6,21 @@ Best Output: Hyattsville MD 20782 USA +## To build: -Judges' comments: + make all - Make and run as follows: +### To run - make buzzard - buzzard + ./buzzard + +## Judges' comments You will be A-mazed. You are invited to try to cheat, ... if you can figure out how! :-) - -Selected notes from the author: +## Author's comments HOW TO PLAY: diff --git a/1991/cdupont/.gitignore b/1991/cdupont/.gitignore new file mode 100644 index 000000000..0c3243e3b --- /dev/null +++ b/1991/cdupont/.gitignore @@ -0,0 +1 @@ +cdupont diff --git a/1991/cdupont/Makefile b/1991/cdupont/Makefile index 57c7302a6..4d92bf6d2 100644 --- a/1991/cdupont/Makefile +++ b/1991/cdupont/Makefile @@ -1,129 +1,593 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1991 makefile +# IOCCC 1991 winning entry - cdupont + +################################################################################ # -# Copyright (c) 1991, Landon Curt Noll & Larry Bassel. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll and Larry Bassel. - - -SHELL=/bin/sh -MAKE=make -MAKEFLAGS=e - -# uncomment the line to select the preferred type of compile +# An Historical Makefile NOTE: # -# You should also check the ansi.mk or common.mk for the -# proper compiler name and flags. +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. # -# NOTE ==> USE=ansi compile with an ANSI compiler by default -#USE=ansi -# NOTE ==> USE=common compile with a common K&R compiler by default -#USE=common +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. +# +# Regarding individual entries: +# +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. +# +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. +# +# GitHub pull requests are welcome: +# +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judges to +# consider. +# +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: +# +# https://github.com/ioccc-src/winner +# +################################################################################ -WINNERS= ant brnstnd buzzard cdupont davidguy dds fine rince westley +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# +# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# +# See: http://creativecommons.org/licenses/by-sa/3.0/ -all: - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -k -f common.mk all; \ - ${MAKE} -k -f common.mk all; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -k -f ansi.mk all; \ - ${MAKE} -k -f ansi.mk all; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1; \ - fi -ansi: - ${MAKE} -f ansi.mk all +############################# +# shell used by this Makefile +############################# +# +SHELL= bash -common: - ${MAKE} -f common.mk all +####################### +# common tool locations +####################### +# +A2P= a2p +AR= ar +ASA= asa +AT= at +ATQ= atq +ATRM= atrm +AWK= awk +BANNER= banner +BASE64= base64 +BASENAME= basename +BATCH= batch +BC= bc +BINHEX= binhex +BISON= bison +BUNZIP2= bunzip2 +BZCAT= bzcat +BZCMP= bzcmp +BZDIFF= bzdiff +BZEGREP= bzegrep +BZFGREP= bzfgrep +BZGREP= bzgrep +BZIP2= bzip2 +BZLESS= bzless +BZMORE= bzmore +C2PH= c2ph +C89= c89 +C99= c99 +CAL= cal +CALC= calc +CAT= cat +CD= cd +CHFLAGS= chflags +CHGRP= chgrp +CHMOD= chmod +CKSUM= cksum +CLANG= clang +CLANG_PLUSPLUS= clang++ +CLEAR= clear +CMP= cmp +COL= col +COLLDEF= colldef +COLRM= colrm +COLUMN= column +COMPRESS= compress +CP= cp +CPIO= cpio +CPP= cpp +CRC32= crc32 +CSH= csh +CSPLIT= csplit +CURL= curl +CUT= cut +C_PLUSPLUS= c++ +C_PLUSPLUS_FILT= c++filt +DATE= date +DC= dc +DD= dd +DF= df +DIFF3= diff3 +DIFF= diff +DIG= dig +DIRNAME= dirname +ED= ed +EGREP= egrep +ENV= env +EQN= eqn +ETAGS= etags +EXPECT= expect +EXPR= expr +FALSE= false +FGREP= fgrep +FILE= file +FIND2PERL= find2perl +FIND= find +FLEX= flex +FLEX_PLUSPLUS= flex++ +FMT= fmt +FOLD= fold +FS_USAGE= fs_usage +FUNZIP= funzip +FUSER= fuser +GCC= gcc +GDIFFMK= gdiffmk +GENCAT= gencat +GENSTRINGS= genstrings +GETOPT= getopt +GETOPTS= getopts +GINDENT= gindent +GNUMAKE= gnumake +GREP= grep +GROFF= groff +GROFFER= groffer +GROG= grog +GROPS= grops +GROTTY= grotty +GUNZIP= gunzip +GVIM= gvim +GZCAT= gzcat +GZEXE= gzexe +GZIP_PROG= gzip +G_PLUSPLUS= g++ +H2PH= h2ph +H2XS= h2xs +HASH= hash +HEAD= head +HOSTNAME_PROG= hostname +ICONV= iconv +ID= id +INDENT= indent +INFO= info +JOT= jot +KILL= kill +KSH= ksh +LAST= last +LD= ld +LESSECHO= lessecho +LEX= len +LINK= link +LN= ln +LS= ls +M4= m4 +MAKE= make +MAN= man +MKDIR= mkdir +MKFIFO= mkfifo +MKTEMP= mktemp +MV= mv +NANO= nano +NASM= nasm +NEQN= neqn +NICE= nice +NL= nl +NM= nm +NOHUP= nohup +NROFF= nroff +NSLOOKUP= nslookup +OD= od +OPENSSL= openssl +PASTE= paste +PATCH= patch +PATHCHK= pathchk +PAX= pax +PERL= perl +PICO= pico +PR= pr +PRINTENV= printenv +PS= ps +PTAR= ptar +PTARDIFF= ptardiff +PTARGREP= ptargrep +PWD= pwd +PYDOC= pydoc +PYTHON= python +PYTHONW= pythonw +READLINK= readlink +RENICE= renice +RESET= reset +REV= rev +RI= ri +RM= rm +RMDIR= rmdir +RSYNC= rsync +RUBY= ruby +RVIM= rvim +SAY= say +SCP= scp +SCREEN= screen +SCRIPT= script +SDIFF= sdiff +SED= sed +SEQ= seq +SFTP= sftp +SH= sh +SHA1= sha1 +SHA= sha +SHAR= shar +SHASUM5_18= shasum5.18 +SHASUM= shasum +SIZE= size +SLEEP= sleep +SORT= sort +SSH= ssh +STAT= stat +STRIP= strip +STTY= stty +SUM= sum +SYNC= sync +TABS= tabs +TAIL= tail +TAR= tar +TEE= tee +TEST= test +TFTP= tftp +TIDY= tidy +TIME= time +TOP= top +TOUCH= touch +TPUT= tout +TPUT= tput +TR= tr +TROFF= troff +TRUE= true +TSET= tset +TSORT= tsort +UL= ul +UNAME= uname +UNCOMPRESS= uncompress +UNEXPAND= unexpand +UNIFDEF= unifdef +UNIFDEFALL= unifdefall +UNIQ= uniq +UNITS= units +UNLINK= unlink +UNZIP= unzip +UNZIPSFX= unzipsfx +UPTIME= uptime +UUDECODE= uudecode +UUENCODE= uuencode +UUIDGEN= uuidgen +VI= vi +VIEW= view +VIM= vim +VIMDIFF= vimdiff +W= w +WAIT4PATH= wait4path +WAIT= wait +WC= wc +WGET= wget +WHAT= what +WHATIS= whatis +WHICH= which +WHO= who +WHOAMI= whoami +WHOIS= whois +WRTIE= write +XAR= xar +XARGS= xargs +XATTR= xattr +XXD= xxd +YACC= yacc +YES= yes +ZCAT= zcat +ZCMP= zcmp +ZDIFF= zdiff +ZEGREP= zegrep +ZFGREP= zfgrep +ZFORCE= zforce +ZGREP= zgrep +ZIP= zip +ZIPCLOAK= zipcloak +ZIPGREp= zipgrep +ZIPINFo= zipinfo +ZIPNOTE= zipnote +ZIPSPLIT= zipsplit +ZLESS= zless +ZMORE= zmore +ZNEW= znew +ZPRINT= zprint +ZSH= zsh -${WINNERS} merlyn.c nextmove.c ttt_game.c: - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Set X11_LIBDIR to the directory where the X11 library resides +# +#X11_LIBDIR= /usr/X11R6/lib +#X11_LIBDIR= /usr/X11/lib +X11_LIBDIR= /opt/X11/lib -ttt: ttt.sh - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# +#X11_INCDIR= /usr/X11R6/include +#X11_INCDIR= /usr/X11/include +X11_INCDIR= /opt/X11/include -merlyn: merlyn.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@ \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Common C compiler warnings to silence +# +#CSILENCE= +CSILENCE= -Wno-unused-label -ttt_game: ttt_game.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +#CWARN= -Wall -Wextra ${CSILENCE} +CWARN= -Wall -Wextra -pedantic ${CSILENCE} -nextmove: nextmove.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Compiler standard +# +#CSTD= +#CSTD= -ansi +CSTD= -std=gnu90 +# Compiler bit architecture +# +# Some entries require 32-bitness: +# ARCH= -m32 +# +# Some entries require 64-bitness: +# ARCH= -m64 +# +# By default we assume nothing: +# +ARCH= + +# Defines that are needed to compile +# +#CDEFINE= +CDEFINE= -Ds=\"cdupont.c\" -Dt=\"r\" + +# Include files that are needed to compile +# +CINCLUDE= +#CINCLUDE= -include stdlib.h +#CINCLUDE= -include stdio.h +#CINCLUDE= -include stdlib.h -include stdio.h +#CINCLUDE= -I ${X11_INCDIR} +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 + +# Optimization +# +# Most compiles will safely use -O2. Some can use only -O1 or -O. +# A few compilers have broken optimizers or this entry make break +# under those buggy optimizers and thus you may not want anything. +# Reasonable compilers will allow for -O3. +# +#OPT= +#OPT= -O +#OPT= -O1 +#OPT= -O2 +OPT= -O3 + +# Default flags for ANSI C compilation +# +CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} + +# Libraries needed to build +# +LIBS= +#LIBS= -lm +#LIBS= -L ${X11_LIBDIR} -lX11 +#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL + +# C compiler to use +# +CC= cc +#CC=clang +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-poison-system-directories +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif + + +############################## +# Special flags for this entry +############################## +# +ENTRY= cdupont +PROG= ${ENTRY} +# +OBJ= ${PROG}.o +DATA= +TARGET= ${PROG} +# +ALT_OBJ= +ALT_TARGET= + + +################# +# build the entry +################# +# +all: data ${TARGET} + @${TRUE} + +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto + +${PROG}: ${PROG}.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + +# alternative executable +# +alt: data ${ALT_TARGET} + @${TRUE} + +# data files +# +data: ${DATA} + @${TRUE} + +# both all and alt +# +everything: all alt + + +############### +# utility rules +############### +# clean: - ${MAKE} -f ansi.mk clean - ${MAKE} -f common.mk clean -clobber: - ${MAKE} -f ansi.mk clobber - ${MAKE} -f common.mk clobber -nuke: clobber - ${MAKE} -f ansi.mk nuke - ${MAKE} -f common.mk nuke + ${RM} -f ${OBJ} ${ALT_OBJ} + @-if [ -f indent.c ]; then \ + echo ${RM} -f indent.c; \ + ${RM} -f indent.c; \ + fi + +clobber: clean + ${RM} -f ${TARGET} ${ALT_TARGET} + @-if [ -e sandwich ]; then \ + ${RM} -f sandwich; \ + echo 'ate sandwich'; \ + fi + install: - ${MAKE} -f ansi.mk install - ${MAKE} -f common.mk install + @echo "Dr. Spock says that is not logical!" + @${TRUE} + +# you may be able to misunderstand the source by reading indent.c +# +indent.c: ${PROG}.c + @if which "${GINDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${GINDENT} < $< > $@"; \ + ${GINDENT} < $< > $@; \ + elif which "${INDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${INDENT} < $< > $@"; \ + ${INDENT} < $< > $@; \ + else \ + echo "no intent tool found, ident $< yourself, sorry"; \ + echo "exit 1"; \ + exit 1; \ + fi + + +################## +# 133t hacker rulz +################## +# +love: + @echo 'not war?' + @${TRUE} + +haste: + $(MAKE) waste + @${TRUE} + +waste: + @echo 'haste' + @${TRUE} + +maker: + @echo 'Participate in a maker faire' + @${TRUE} + +easter_egg: + @echo "you expected to often misunderstand this $${RANDOM} magic" + @echo "chongo '' /\\oo/\\" + @echo "Eggy" + +sandwich: easter_egg + @if [ `id -u` -eq 0 ]; then \ + echo 'Okay.'; \ + echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ + else \ + echo 'What? Make it yourself.'; \ + exit 1; \ + fi + +# Understand the history of the Homebrew Computer Club +# as well as the West Coast Computer Faire and +# you might be confused different. :-) +# +supernova: sandwich + @-if [ -r .code_anal ]; then \ + ${RM} -f .code_anal_v6; \ + else \ + echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ + fi + @echo "A $@ helps ${MAKE} the elements that help form planets" + @${TRUE} + +deep_magic: supernova + @-if [ -r .code_anal ]; then \ + ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ + --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + fi + @${TRUE} + +magic: deep_magic + @-if [ -r .code_anal ]; then \ + ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "If you don't eat yer meat, you can't have any pudding!"; \ + echo "How can you have any pudding if you don't eat yer meat?!"; \ + fi + @${TRUE} + +# The IOCCC resident astronomer states +# +charon: magic + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore IAU, $@ is a planet" + +pluto: charon + ${MAKE} charon + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore, $@ is a planet" + @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" diff --git a/1991/cdupont/README.md b/1991/cdupont/README.md index ea1f178a5..d5666ac10 100644 --- a/1991/cdupont/README.md +++ b/1991/cdupont/README.md @@ -1,4 +1,4 @@ -Most Useful Label: +# Most Useful Label: Christian Dupont Ecole Normale Superieure de Lyon, @@ -7,13 +7,15 @@ Most Useful Label: 69009 Lyon France +## To build: -Judges' comments: + make all - Make and run as follows: +### To run - make cdupont - cdupont + ./cdupont + +## Judges' comments Why is the following label necessary? @@ -22,16 +24,11 @@ Judges' comments: Notice that if you C beautify (cb) or pre-process this program, it will no longer work correctly, or at all. (go ahead, try it... :-)) - NOTE: Due to minor problems with some ANSI C compilers, we have - supplied a more portable ANSI version. See the top level - README file for details. - NOTE: One should remove the final trailing newline to obtain the original source file. This step is not needed to compile this entry. - -Selected notes from the author: +## Author's comments Spoiler, rot13 to read: diff --git a/1991/cdupont/cdupont.c b/1991/cdupont/cdupont.c index 3a63eabfe..fdae94064 100644 --- a/1991/cdupont/cdupont.c +++ b/1991/cdupont/cdupont.c @@ -7,8 +7,8 @@ main(){int x ,gi=4,i,f,ri=1,httxkbl=1,m=012;long cd=0x5765248d,n; x= u [gi][m]; sorryfor_this_unused_but_very_needed_label: if( m==gi){x=0x70;f=0x68;}else goto cOg0 ; b:putchar(x); if( !(n-httxkbl++)) -#define yank putchar(' - {httxkbl=1; yank ');goto +#define yank(x) putchar(x) + {httxkbl=1; yank(' ');goto hxi;}goto bl; /* hardlyundrstandable, but likely to be missed if removed */ @@ -18,7 +18,7 @@ likely to be missed if removed */ c0g0 : n=cd&0x40000000L>>0x1e; goto cOgO; g6w: if(x!=0x2e){i++;goto c0gO;}else /* -injail*/yank\n');goto vhjsgfdyl1lgjhd; +injail*/yank('\n');goto vhjsgfdyl1lgjhd; cOg0 : f=u[m][gi];goto b;bl:m=(i+1)*(4* x+3*f)%032;gi=(i+1)*(x+2*f)%0x1a; goto g6w; diff --git a/1991/cdupont/cdupont_ansi.c b/1991/cdupont/cdupont_ansi.c deleted file mode 100644 index fdae94064..000000000 --- a/1991/cdupont/cdupont_ansi.c +++ /dev/null @@ -1,26 +0,0 @@ - /* common sense to nohonest programmer */ -#include -main(){int x ,gi=4,i,f,ri=1,httxkbl=1,m=012;long cd=0x5765248d,n; - char u[0x50][032];FILE *ind; - ind=fopen(s,t); for(i=0; i<0x1a; i++){goto daswjhkls;vhjsgfdy1l1gjhd:;} -/*borntorun.*/goto c0g0;cOgO:i=0;fclose(ind);c0gO: -x= u [gi][m]; sorryfor_this_unused_but_very_needed_label: - if( m==gi){x=0x70;f=0x68;}else goto cOg0 ; b:putchar(x); if( -!(n-httxkbl++)) -#define yank(x) putchar(x) - {httxkbl=1; yank(' ');goto - hxi;}goto bl; - /* hardlyundrstandable, but -likely to be missed if removed */ - daswjhkls: fgets(u[i], 0120, ind); - /*obfuscated, eh? */goto - vhjsgfdy1l1gjhd; - c0g0 : n=cd&0x40000000L>>0x1e; - goto cOgO; g6w: - if(x!=0x2e){i++;goto c0gO;}else /* -injail*/yank('\n');goto vhjsgfdyl1lgjhd; -cOg0 : -f=u[m][gi];goto b;bl:m=(i+1)*(4* -x+3*f)%032;gi=(i+1)*(x+2*f)%0x1a; goto g6w; - hxi:cd^= n= cd&(7<<3*(014-++ri)); -n >>=3*(12-ri); goto bl;vhjsgfdyl1lgjhd:;} diff --git a/1991/davidguy/.gitignore b/1991/davidguy/.gitignore new file mode 100644 index 000000000..77ebabb35 --- /dev/null +++ b/1991/davidguy/.gitignore @@ -0,0 +1 @@ +davidguy diff --git a/1991/davidguy/Makefile b/1991/davidguy/Makefile index 57c7302a6..1de80b14f 100644 --- a/1991/davidguy/Makefile +++ b/1991/davidguy/Makefile @@ -1,129 +1,598 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1991 makefile +# IOCCC 1991 winning entry - davidguy + +################################################################################ # -# Copyright (c) 1991, Landon Curt Noll & Larry Bassel. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll and Larry Bassel. - - -SHELL=/bin/sh -MAKE=make -MAKEFLAGS=e - -# uncomment the line to select the preferred type of compile +# An Historical Makefile NOTE: # -# You should also check the ansi.mk or common.mk for the -# proper compiler name and flags. +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. # -# NOTE ==> USE=ansi compile with an ANSI compiler by default -#USE=ansi -# NOTE ==> USE=common compile with a common K&R compiler by default -#USE=common +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. +# +# Regarding individual entries: +# +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. +# +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. +# +# GitHub pull requests are welcome: +# +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judges to +# consider. +# +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: +# +# https://github.com/ioccc-src/winner +# +################################################################################ -WINNERS= ant brnstnd buzzard cdupont davidguy dds fine rince westley +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# +# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# +# See: http://creativecommons.org/licenses/by-sa/3.0/ -all: - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -k -f common.mk all; \ - ${MAKE} -k -f common.mk all; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -k -f ansi.mk all; \ - ${MAKE} -k -f ansi.mk all; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1; \ - fi -ansi: - ${MAKE} -f ansi.mk all +############################# +# shell used by this Makefile +############################# +# +SHELL= bash -common: - ${MAKE} -f common.mk all +####################### +# common tool locations +####################### +# +A2P= a2p +AR= ar +ASA= asa +AT= at +ATQ= atq +ATRM= atrm +AWK= awk +BANNER= banner +BASE64= base64 +BASENAME= basename +BATCH= batch +BC= bc +BINHEX= binhex +BISON= bison +BUNZIP2= bunzip2 +BZCAT= bzcat +BZCMP= bzcmp +BZDIFF= bzdiff +BZEGREP= bzegrep +BZFGREP= bzfgrep +BZGREP= bzgrep +BZIP2= bzip2 +BZLESS= bzless +BZMORE= bzmore +C2PH= c2ph +C89= c89 +C99= c99 +CAL= cal +CALC= calc +CAT= cat +CD= cd +CHFLAGS= chflags +CHGRP= chgrp +CHMOD= chmod +CKSUM= cksum +CLANG= clang +CLANG_PLUSPLUS= clang++ +CLEAR= clear +CMP= cmp +COL= col +COLLDEF= colldef +COLRM= colrm +COLUMN= column +COMPRESS= compress +CP= cp +CPIO= cpio +CPP= cpp +CRC32= crc32 +CSH= csh +CSPLIT= csplit +CURL= curl +CUT= cut +C_PLUSPLUS= c++ +C_PLUSPLUS_FILT= c++filt +DATE= date +DC= dc +DD= dd +DF= df +DIFF3= diff3 +DIFF= diff +DIG= dig +DIRNAME= dirname +ED= ed +EGREP= egrep +ENV= env +EQN= eqn +ETAGS= etags +EXPECT= expect +EXPR= expr +FALSE= false +FGREP= fgrep +FILE= file +FIND2PERL= find2perl +FIND= find +FLEX= flex +FLEX_PLUSPLUS= flex++ +FMT= fmt +FOLD= fold +FS_USAGE= fs_usage +FUNZIP= funzip +FUSER= fuser +GCC= gcc +GDIFFMK= gdiffmk +GENCAT= gencat +GENSTRINGS= genstrings +GETOPT= getopt +GETOPTS= getopts +GINDENT= gindent +GNUMAKE= gnumake +GREP= grep +GROFF= groff +GROFFER= groffer +GROG= grog +GROPS= grops +GROTTY= grotty +GUNZIP= gunzip +GVIM= gvim +GZCAT= gzcat +GZEXE= gzexe +GZIP_PROG= gzip +G_PLUSPLUS= g++ +H2PH= h2ph +H2XS= h2xs +HASH= hash +HEAD= head +HOSTNAME_PROG= hostname +ICONV= iconv +ID= id +INDENT= indent +INFO= info +JOT= jot +KILL= kill +KSH= ksh +LAST= last +LD= ld +LESSECHO= lessecho +LEX= len +LINK= link +LN= ln +LS= ls +M4= m4 +MAKE= make +MAN= man +MKDIR= mkdir +MKFIFO= mkfifo +MKTEMP= mktemp +MV= mv +NANO= nano +NASM= nasm +NEQN= neqn +NICE= nice +NL= nl +NM= nm +NOHUP= nohup +NROFF= nroff +NSLOOKUP= nslookup +OD= od +OPENSSL= openssl +PASTE= paste +PATCH= patch +PATHCHK= pathchk +PAX= pax +PERL= perl +PICO= pico +PR= pr +PRINTENV= printenv +PS= ps +PTAR= ptar +PTARDIFF= ptardiff +PTARGREP= ptargrep +PWD= pwd +PYDOC= pydoc +PYTHON= python +PYTHONW= pythonw +READLINK= readlink +RENICE= renice +RESET= reset +REV= rev +RI= ri +RM= rm +RMDIR= rmdir +RSYNC= rsync +RUBY= ruby +RVIM= rvim +SAY= say +SCP= scp +SCREEN= screen +SCRIPT= script +SDIFF= sdiff +SED= sed +SEQ= seq +SFTP= sftp +SH= sh +SHA1= sha1 +SHA= sha +SHAR= shar +SHASUM5_18= shasum5.18 +SHASUM= shasum +SIZE= size +SLEEP= sleep +SORT= sort +SSH= ssh +STAT= stat +STRIP= strip +STTY= stty +SUM= sum +SYNC= sync +TABS= tabs +TAIL= tail +TAR= tar +TEE= tee +TEST= test +TFTP= tftp +TIDY= tidy +TIME= time +TOP= top +TOUCH= touch +TPUT= tout +TPUT= tput +TR= tr +TROFF= troff +TRUE= true +TSET= tset +TSORT= tsort +UL= ul +UNAME= uname +UNCOMPRESS= uncompress +UNEXPAND= unexpand +UNIFDEF= unifdef +UNIFDEFALL= unifdefall +UNIQ= uniq +UNITS= units +UNLINK= unlink +UNZIP= unzip +UNZIPSFX= unzipsfx +UPTIME= uptime +UUDECODE= uudecode +UUENCODE= uuencode +UUIDGEN= uuidgen +VI= vi +VIEW= view +VIM= vim +VIMDIFF= vimdiff +W= w +WAIT4PATH= wait4path +WAIT= wait +WC= wc +WGET= wget +WHAT= what +WHATIS= whatis +WHICH= which +WHO= who +WHOAMI= whoami +WHOIS= whois +WRTIE= write +XAR= xar +XARGS= xargs +XATTR= xattr +XXD= xxd +YACC= yacc +YES= yes +ZCAT= zcat +ZCMP= zcmp +ZDIFF= zdiff +ZEGREP= zegrep +ZFGREP= zfgrep +ZFORCE= zforce +ZGREP= zgrep +ZIP= zip +ZIPCLOAK= zipcloak +ZIPGREp= zipgrep +ZIPINFo= zipinfo +ZIPNOTE= zipnote +ZIPSPLIT= zipsplit +ZLESS= zless +ZMORE= zmore +ZNEW= znew +ZPRINT= zprint +ZSH= zsh -${WINNERS} merlyn.c nextmove.c ttt_game.c: - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Set X11_LIBDIR to the directory where the X11 library resides +# +#X11_LIBDIR= /usr/X11R6/lib +#X11_LIBDIR= /usr/X11/lib +X11_LIBDIR= /opt/X11/lib -ttt: ttt.sh - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# +#X11_INCDIR= /usr/X11R6/include +#X11_INCDIR= /usr/X11/include +X11_INCDIR= /opt/X11/include -merlyn: merlyn.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@ \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Common C compiler warnings to silence +# +#CSILENCE= +CSILENCE= -Wno-bitwise-op-parentheses -Wno-error -Wno-implicit-function-declaration \ + -Wno-int-to-pointer-cast -Wno-return-type -Wno-sign-compare -ttt_game: ttt_game.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +CWARN= -Wall -Wextra ${CSILENCE} +#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -nextmove: nextmove.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Compiler standard +# +#CSTD= +#CSTD= -ansi +CSTD= -std=gnu90 +# Compiler bit architecture +# +# Some entries require 32-bitness: +# ARCH= -m32 +# +# Some entries require 64-bitness: +# ARCH= -m64 +# +# By default we assume nothing: +# +ARCH= + +# Defines that are needed to compile +# +CDEFINE= +#CDEFINE= -DIOCCC + +# Include files that are needed to compile +# +CINCLUDE= +#CINCLUDE= -include stdlib.h +#CINCLUDE= -include stdio.h +#CINCLUDE= -include stdlib.h -include stdio.h +#CINCLUDE= -I ${X11_INCDIR} +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 + +# Optimization +# +# Most compiles will safely use -O2. Some can use only -O1 or -O. +# A few compilers have broken optimizers or this entry make break +# under those buggy optimizers and thus you may not want anything. +# Reasonable compilers will allow for -O3. +# +#OPT= +#OPT= -O +#OPT= -O1 +#OPT= -O2 +OPT= -O3 + +# Default flags for ANSI C compilation +# +CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} + +# Libraries needed to build +# +LIBS= +#LIBS= -lm +#LIBS= -L ${X11_LIBDIR} -lX11 +#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL + +# C compiler to use +# +CC= cc +#CC=clang +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-bad-function-cast -Wno-conditional-uninitialized \ + -Wno-implicit-int-conversion -Wno-missing-prototypes \ + -Wno-missing-variable-declarations -Wno-pedantic \ + -Wno-poison-system-directories -Wno-shadow -Wno-shift-sign-overflow \ + -Wno-sign-conversion -Wno-strict-prototypes +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif + + +############################## +# Special flags for this entry +############################## +# +ENTRY= davidguy +PROG= ${ENTRY} +# +OBJ= ${PROG}.o +DATA= +TARGET= ${PROG} +# +ALT_OBJ= +ALT_TARGET= + + +################# +# build the entry +################# +# +all: data ${TARGET} + @${TRUE} + +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto + +${PROG}: ${PROG}.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + +# alternative executable +# +alt: data ${ALT_TARGET} + @${TRUE} + +# data files +# +data: ${DATA} + @${TRUE} + +# both all and alt +# +everything: all alt + + +############### +# utility rules +############### +# clean: - ${MAKE} -f ansi.mk clean - ${MAKE} -f common.mk clean -clobber: - ${MAKE} -f ansi.mk clobber - ${MAKE} -f common.mk clobber -nuke: clobber - ${MAKE} -f ansi.mk nuke - ${MAKE} -f common.mk nuke + ${RM} -f ${OBJ} ${ALT_OBJ} + @-if [ -f indent.c ]; then \ + echo ${RM} -f indent.c; \ + ${RM} -f indent.c; \ + fi + +clobber: clean + ${RM} -f ${TARGET} ${ALT_TARGET} + @-if [ -e sandwich ]; then \ + ${RM} -f sandwich; \ + echo 'ate sandwich'; \ + fi + install: - ${MAKE} -f ansi.mk install - ${MAKE} -f common.mk install + @echo "Dr. Spock says that is not logical!" + @${TRUE} + +# you may be able to misunderstand the source by reading indent.c +# +indent.c: ${PROG}.c + @if which "${GINDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${GINDENT} < $< > $@"; \ + ${GINDENT} < $< > $@; \ + elif which "${INDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${INDENT} < $< > $@"; \ + ${INDENT} < $< > $@; \ + else \ + echo "no intent tool found, ident $< yourself, sorry"; \ + echo "exit 1"; \ + exit 1; \ + fi + + +################## +# 133t hacker rulz +################## +# +love: + @echo 'not war?' + @${TRUE} + +haste: + $(MAKE) waste + @${TRUE} + +waste: + @echo 'haste' + @${TRUE} + +maker: + @echo 'Participate in a maker faire' + @${TRUE} + +easter_egg: + @echo "you expected to often misunderstand this $${RANDOM} magic" + @echo "chongo '' /\\oo/\\" + @echo "Eggy" + +sandwich: easter_egg + @if [ `id -u` -eq 0 ]; then \ + echo 'Okay.'; \ + echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ + else \ + echo 'What? Make it yourself.'; \ + exit 1; \ + fi + +# Understand the history of the Homebrew Computer Club +# as well as the West Coast Computer Faire and +# you might be confused different. :-) +# +supernova: sandwich + @-if [ -r .code_anal ]; then \ + ${RM} -f .code_anal_v6; \ + else \ + echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ + fi + @echo "A $@ helps ${MAKE} the elements that help form planets" + @${TRUE} + +deep_magic: supernova + @-if [ -r .code_anal ]; then \ + ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ + --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + fi + @${TRUE} + +magic: deep_magic + @-if [ -r .code_anal ]; then \ + ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "If you don't eat yer meat, you can't have any pudding!"; \ + echo "How can you have any pudding if you don't eat yer meat?!"; \ + fi + @${TRUE} + +# The IOCCC resident astronomer states +# +charon: magic + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore IAU, $@ is a planet" + +pluto: charon + ${MAKE} charon + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore, $@ is a planet" + @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" diff --git a/1991/davidguy/README.md b/1991/davidguy/README.md index 972f25d44..7b9a0105e 100644 --- a/1991/davidguy/README.md +++ b/1991/davidguy/README.md @@ -6,24 +6,26 @@ Best X11 Graphics: Pittsburgh PA 15213 Murray Hill NJ 07974 USA USA +## To build: -Judges' comments: + make all - Make and run as follows: +### To run - make davidguy - davidguy ip_address:server.screen + ./davidguy ip_address:server.screen - where 'ip_address' in an IP address of an X server. For example, try: + where 'ip_address' in an IP address of an X server. For example, try: - davidguy 127.0.0.1:0.0 + davidguy 127.0.0.1:0.0 - Of course, may need to supply a more reasonable address. :-) + Of course, may need to supply a more reasonable address. :-) - Also try: + Also try: - cp davidguy guydavid - guydavid 127.0.0.1:0.0 + cp -f davidguy guydavid + ./guydavid 127.0.0.1:0.0 + +## Judges' comments Can you determine why this makes a difference. @@ -39,12 +41,7 @@ Judges' comments: We are pleased that this entry has helped bring new 'life' into the contest. - NOTE: The orignal program that won may be found in davidguy.orig.c. - The author supplied a second version of the program, which - we have placed in the default location davidguy.c. - - -Selected notes from the authors: +## Author's comments The program is a fully-functional X client. It talks directly to the X server through a socket without using Xlib, Xt or any other diff --git a/1991/davidguy/davidguy.c b/1991/davidguy/davidguy.c index 8d7a75726..21ea9da20 100644 --- a/1991/davidguy/davidguy.c +++ b/1991/davidguy/davidguy.c @@ -8,26 +8,27 @@ #define R(b)write(A,T=h,4*b); #define S (u*)sbrk(Q*4+U*8)+U #define E(a,b,c)a=c&1<<31|b/2;c=c*2|b&1; -#define V q=h^*L;L+=F;E(d,q,x)E(f,d,s)g=f&q;f^=q +#define V q= *L;L+=F;E(d,q,x)E(f,d,s)g=f&q;f^=q #define W while( #define Z q=I&f;M|=q&c;c^=q;I^=f;M|=g&c;c^=g -#define Y W(F= *s++-'0')<=9)*T=10**T+F;K +#define Y W(F= *s++)&16)*T=10**T+F-'0';T++ #define D(q,s)c);W q>s)G= *--q,*q= *s,*s++=G; #define P if(i^z){x=Q+(n=D(x,n) #define C if(i){q=Q*4+(s=(w)D(q,s) -u A,U,Q,J,X[9999],B;main(a,b)w*b;{r*c,*d,y=0,f,g,F,I,M,N,z,*x,*n,i,G;w q,*h=(w -)X,*T,*s=".slo.-W00,tmhw.W/";T=h;if(a>1){e;s=b[1];Y;Y;Y;Y;T=h;H;K=23;Y+=112;T= -h;Y;y= *--T;H=2;}else{H=1;W*s)K=1+*s++;}connect(A=socket(a,1,0),T=h,24-a*4);H= -17004;H=11;e=0;e=0;i=66==*h;R(3)read(A,h,8);e;H;read(A,h,4*H);T=h;e;F=e;e;e;I= -11+H;f=H-6;K;U=K;i^=K;z=!K;T+=I/4*4+8*U;W y--){T+=39;I=K;W I--)H,T+=4+24*H;}I= -e;e;B=(!e^**b&1)-1;e;e;U=H/32;J=H/30*30;T+=14;M=K;f/=U;T=h;K=55;K;H=4;e=F;e=I; -e=0;R(4)N=F+8192;K=53;K=M;H=4;e=N;e=I;H=U*32;H=J;R(4)K=2;K;H=4;e=I;e=1;e=N;R(4 -)Q=J*U;c=S;d=S;L(c);W 1){P}C}y=0;W yf?g=f:g);e=N;e -=F;H=U*32;H=g;H=0;H=y;K=0;K=1;R(6)write(A,c+y*U,g*U*4);y+=g;}K=61;K=0;H=4;e=I; -e=0;e=0;R(4)C}P}v(c,d);}}L(A)r*A;{r*T=A+Q,X=getpid();W A>31;G=z+F;L=y+F;W G>z){M= *--G;*--L=(M*2)+f;f=M>>31;}z+=F;y+ -=F;}} +u A,U,Q,J,X[9999];main(a,b)w*b;{r*c,*d,y,f,g,F,G,I,M,N,z,*x,*n,i,B,O;w q,*h=(w +)X,*T,*s;T=h;if(a>1){H=2;K=23;K=112;s=b[1];Y;Y;Y;Y;}else{s=".slo.-W00,tmhw.W/" +;H=1;W*s)K=1+*s++;K=0;}s=T;H=17004;H=11;e=0;e=0;i=66==*s;W connect(A=socket(a, +3-Q++,0),h,24-a*4)||write(A,s,12)!=12||read(A,T,8)!=8);e;H;read(A,h,4*H);T=h;e +;F=e;e;e;I=11+H;f=H-6;K;U=K;i^=K;z=!K;T+=I/4*4+8*U;I=e;e;O=e;B=e;e;U=H/32;J=H/ +30*30;T+=14;M=K;f/=U;T=h;K=55;K;H=6;e=F;e=I;e=12;e=B;e=O;R(6)B=F+8192;K=53;K=1 +;H=4;e=B;e=I;H=U*32;H=J;R(4)O=B+8192;K=55;K;H=4;e=O;e=B;e=0;R(4)N=O+8192;K=53; +K=M;H=4;e=N;e=I;H=U*32;H=J;R(4)K=2;K;H=4;e=I;e=1;e=N;R(4)Q=J*U;c=S;d=S;L(c);W +1){P}C}y=0;W yf?g=f:g);e=B;e=O;H=U*32;H=g;H=0;H=y; +K=0;K=1;R(6)write(A,c+y*U,g*U*4);y+=g;}K=63;K;H=8;e=B;e=N;e=F;e=0;e=0;H=U*32;H +=J;e=1;R(8)K=61;K=0;H=4;e=I;e=0;e=0;R(4)C}P}v(c,d);}}L(A)r*A;{r*T=A+Q,X=getpid +();W A>31;G=z+F;L=y+F;W G>z){M= *--G;*--L=(M*2)+ +f;f=M>>31;}z+=F;y+=F;}} diff --git a/1991/davidguy/davidguy.fix.c b/1991/davidguy/davidguy.fix.c deleted file mode 100644 index 21ea9da20..000000000 --- a/1991/davidguy/davidguy.fix.c +++ /dev/null @@ -1,34 +0,0 @@ -#define u unsigned -#define w char* -#define j(x)(*(*(x*)&T)++) -#define H j(short*) -#define K j(w) -#define e j(u*) -#define r register u -#define R(b)write(A,T=h,4*b); -#define S (u*)sbrk(Q*4+U*8)+U -#define E(a,b,c)a=c&1<<31|b/2;c=c*2|b&1; -#define V q= *L;L+=F;E(d,q,x)E(f,d,s)g=f&q;f^=q -#define W while( -#define Z q=I&f;M|=q&c;c^=q;I^=f;M|=g&c;c^=g -#define Y W(F= *s++)&16)*T=10**T+F-'0';T++ -#define D(q,s)c);W q>s)G= *--q,*q= *s,*s++=G; -#define P if(i^z){x=Q+(n=D(x,n) -#define C if(i){q=Q*4+(s=(w)D(q,s) -u A,U,Q,J,X[9999];main(a,b)w*b;{r*c,*d,y,f,g,F,G,I,M,N,z,*x,*n,i,B,O;w q,*h=(w -)X,*T,*s;T=h;if(a>1){H=2;K=23;K=112;s=b[1];Y;Y;Y;Y;}else{s=".slo.-W00,tmhw.W/" -;H=1;W*s)K=1+*s++;K=0;}s=T;H=17004;H=11;e=0;e=0;i=66==*s;W connect(A=socket(a, -3-Q++,0),h,24-a*4)||write(A,s,12)!=12||read(A,T,8)!=8);e;H;read(A,h,4*H);T=h;e -;F=e;e;e;I=11+H;f=H-6;K;U=K;i^=K;z=!K;T+=I/4*4+8*U;I=e;e;O=e;B=e;e;U=H/32;J=H/ -30*30;T+=14;M=K;f/=U;T=h;K=55;K;H=6;e=F;e=I;e=12;e=B;e=O;R(6)B=F+8192;K=53;K=1 -;H=4;e=B;e=I;H=U*32;H=J;R(4)O=B+8192;K=55;K;H=4;e=O;e=B;e=0;R(4)N=O+8192;K=53; -K=M;H=4;e=N;e=I;H=U*32;H=J;R(4)K=2;K;H=4;e=I;e=1;e=N;R(4)Q=J*U;c=S;d=S;L(c);W -1){P}C}y=0;W yf?g=f:g);e=B;e=O;H=U*32;H=g;H=0;H=y; -K=0;K=1;R(6)write(A,c+y*U,g*U*4);y+=g;}K=63;K;H=8;e=B;e=N;e=F;e=0;e=0;H=U*32;H -=J;e=1;R(8)K=61;K=0;H=4;e=I;e=0;e=0;R(4)C}P}v(c,d);}}L(A)r*A;{r*T=A+Q,X=getpid -();W A>31;G=z+F;L=y+F;W G>z){M= *--G;*--L=(M*2)+ -f;f=M>>31;}z+=F;y+=F;}} diff --git a/1991/davidguy/davidguy.orig.c b/1991/davidguy/davidguy.orig.c deleted file mode 100644 index 421c014d3..000000000 --- a/1991/davidguy/davidguy.orig.c +++ /dev/null @@ -1,32 +0,0 @@ -#define _ define -#_ u unsigned -#_ w char* -#_ j(x)(*(*(x*)&T)++) -#_ H j(short*) -#_ K j(w) -#_ e j(u*) -#_ r register u -#_ R(b)write(A,T=h,4*b); -#_ S (u*)sbrk(Q*4+U*8)+U -#_ E(a,b,c)a=c&1<<31|b/2;c=c*2|b&1; -#_ V q= *L;L+=F;E(d,q,x)E(f,d,s)g=f&q;f^=q -#_ W while( -#_ Z q=I&f;M|=q&c;c^=q;I^=f;M|=g&c;c^=g -#_ Y W(F= *s++)&16)*T=10**T+F-'0';T++ -#_ D(q,s)c);W q>s)G= *--q,*q= *s,*s++=G; -#_ P if(i^z){x=Q+(n=D(x,n) -#_ C if(i){q=Q*4+(s=(w)D(q,s) -u A,U,Q,J,X[9999];main(a,b)w*b;{r*c,*d,y,f,g,F,G,I,M,N,z,*x,*n,i;w q,*h=(w)X,* -T,*s=".slo.-W00,tmhw.W/";T=h;if(a>1){H=2;K=23;K=112;s=b[1];Y;Y;Y;Y;}else{H=1;W -*s)K=1+*s++;}connect(A=socket(a,1,0),T=h,24-a*4);H=17004;H=11;e=0;e=0;i=66==*h -;R(3)read(A,h,8);e;H;read(A,h,4*H);T=h;e;F=e;e;e;I=11+H;f=H-6;K;U=K;i^=K;z=!K; -T+=I/4*4+8*U;I=e;T+=16;U=H/32;J=H/30*30;T+=14;M=K;f/=U;T=h;K=55;K;H=4;e=F;e=I; -e=0;R(4)N=F+8192;K=53;K=M;H=4;e=N;e=I;H=U*32;H=J;R(4)K=2;K;H=4;e=I;e=1;e=N;R(4 -)Q=J*U;c=S;d=S;L(c);W 1){P}C}y=0;W yf?g=f:g);e=N;e -=F;H=U*32;H=g;H=0;H=y;K=0;K=1;R(6)write(A,c+y*U,g*U*4);y+=g;}K=61;K=0;H=4;e=I; -e=0;e=0;R(4)C}P}v(c,d);}}L(A)r*A;{r*T=A+Q,X=getpid();W A>31;G=z+F;L=y+F;W G>z){M= *--G;*--L=(M*2)+f;f=M>>31;}z+=F;y+=F;}} diff --git a/1991/dds/.gitignore b/1991/dds/.gitignore new file mode 100644 index 000000000..d7985d043 --- /dev/null +++ b/1991/dds/.gitignore @@ -0,0 +1 @@ +dds diff --git a/1991/dds/Makefile b/1991/dds/Makefile index 57c7302a6..06dae359f 100644 --- a/1991/dds/Makefile +++ b/1991/dds/Makefile @@ -1,129 +1,596 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1991 makefile +# IOCCC 1991 winning entry - dds + +################################################################################ # -# Copyright (c) 1991, Landon Curt Noll & Larry Bassel. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll and Larry Bassel. - - -SHELL=/bin/sh -MAKE=make -MAKEFLAGS=e - -# uncomment the line to select the preferred type of compile +# An Historical Makefile NOTE: # -# You should also check the ansi.mk or common.mk for the -# proper compiler name and flags. +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. # -# NOTE ==> USE=ansi compile with an ANSI compiler by default -#USE=ansi -# NOTE ==> USE=common compile with a common K&R compiler by default -#USE=common +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. +# +# Regarding individual entries: +# +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. +# +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. +# +# GitHub pull requests are welcome: +# +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judges to +# consider. +# +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: +# +# https://github.com/ioccc-src/winner +# +################################################################################ -WINNERS= ant brnstnd buzzard cdupont davidguy dds fine rince westley +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# +# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# +# See: http://creativecommons.org/licenses/by-sa/3.0/ -all: - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -k -f common.mk all; \ - ${MAKE} -k -f common.mk all; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -k -f ansi.mk all; \ - ${MAKE} -k -f ansi.mk all; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1; \ - fi -ansi: - ${MAKE} -f ansi.mk all +############################# +# shell used by this Makefile +############################# +# +SHELL= bash -common: - ${MAKE} -f common.mk all +####################### +# common tool locations +####################### +# +A2P= a2p +AR= ar +ASA= asa +AT= at +ATQ= atq +ATRM= atrm +AWK= awk +BANNER= banner +BASE64= base64 +BASENAME= basename +BATCH= batch +BC= bc +BINHEX= binhex +BISON= bison +BUNZIP2= bunzip2 +BZCAT= bzcat +BZCMP= bzcmp +BZDIFF= bzdiff +BZEGREP= bzegrep +BZFGREP= bzfgrep +BZGREP= bzgrep +BZIP2= bzip2 +BZLESS= bzless +BZMORE= bzmore +C2PH= c2ph +C89= c89 +C99= c99 +CAL= cal +CALC= calc +CAT= cat +CD= cd +CHFLAGS= chflags +CHGRP= chgrp +CHMOD= chmod +CKSUM= cksum +CLANG= clang +CLANG_PLUSPLUS= clang++ +CLEAR= clear +CMP= cmp +COL= col +COLLDEF= colldef +COLRM= colrm +COLUMN= column +COMPRESS= compress +CP= cp +CPIO= cpio +CPP= cpp +CRC32= crc32 +CSH= csh +CSPLIT= csplit +CURL= curl +CUT= cut +C_PLUSPLUS= c++ +C_PLUSPLUS_FILT= c++filt +DATE= date +DC= dc +DD= dd +DF= df +DIFF3= diff3 +DIFF= diff +DIG= dig +DIRNAME= dirname +ED= ed +EGREP= egrep +ENV= env +EQN= eqn +ETAGS= etags +EXPECT= expect +EXPR= expr +FALSE= false +FGREP= fgrep +FILE= file +FIND2PERL= find2perl +FIND= find +FLEX= flex +FLEX_PLUSPLUS= flex++ +FMT= fmt +FOLD= fold +FS_USAGE= fs_usage +FUNZIP= funzip +FUSER= fuser +GCC= gcc +GDIFFMK= gdiffmk +GENCAT= gencat +GENSTRINGS= genstrings +GETOPT= getopt +GETOPTS= getopts +GINDENT= gindent +GNUMAKE= gnumake +GREP= grep +GROFF= groff +GROFFER= groffer +GROG= grog +GROPS= grops +GROTTY= grotty +GUNZIP= gunzip +GVIM= gvim +GZCAT= gzcat +GZEXE= gzexe +GZIP_PROG= gzip +G_PLUSPLUS= g++ +H2PH= h2ph +H2XS= h2xs +HASH= hash +HEAD= head +HOSTNAME_PROG= hostname +ICONV= iconv +ID= id +INDENT= indent +INFO= info +JOT= jot +KILL= kill +KSH= ksh +LAST= last +LD= ld +LESSECHO= lessecho +LEX= len +LINK= link +LN= ln +LS= ls +M4= m4 +MAKE= make +MAN= man +MKDIR= mkdir +MKFIFO= mkfifo +MKTEMP= mktemp +MV= mv +NANO= nano +NASM= nasm +NEQN= neqn +NICE= nice +NL= nl +NM= nm +NOHUP= nohup +NROFF= nroff +NSLOOKUP= nslookup +OD= od +OPENSSL= openssl +PASTE= paste +PATCH= patch +PATHCHK= pathchk +PAX= pax +PERL= perl +PICO= pico +PR= pr +PRINTENV= printenv +PS= ps +PTAR= ptar +PTARDIFF= ptardiff +PTARGREP= ptargrep +PWD= pwd +PYDOC= pydoc +PYTHON= python +PYTHONW= pythonw +READLINK= readlink +RENICE= renice +RESET= reset +REV= rev +RI= ri +RM= rm +RMDIR= rmdir +RSYNC= rsync +RUBY= ruby +RVIM= rvim +SAY= say +SCP= scp +SCREEN= screen +SCRIPT= script +SDIFF= sdiff +SED= sed +SEQ= seq +SFTP= sftp +SH= sh +SHA1= sha1 +SHA= sha +SHAR= shar +SHASUM5_18= shasum5.18 +SHASUM= shasum +SIZE= size +SLEEP= sleep +SORT= sort +SSH= ssh +STAT= stat +STRIP= strip +STTY= stty +SUM= sum +SYNC= sync +TABS= tabs +TAIL= tail +TAR= tar +TEE= tee +TEST= test +TFTP= tftp +TIDY= tidy +TIME= time +TOP= top +TOUCH= touch +TPUT= tout +TPUT= tput +TR= tr +TROFF= troff +TRUE= true +TSET= tset +TSORT= tsort +UL= ul +UNAME= uname +UNCOMPRESS= uncompress +UNEXPAND= unexpand +UNIFDEF= unifdef +UNIFDEFALL= unifdefall +UNIQ= uniq +UNITS= units +UNLINK= unlink +UNZIP= unzip +UNZIPSFX= unzipsfx +UPTIME= uptime +UUDECODE= uudecode +UUENCODE= uuencode +UUIDGEN= uuidgen +VI= vi +VIEW= view +VIM= vim +VIMDIFF= vimdiff +W= w +WAIT4PATH= wait4path +WAIT= wait +WC= wc +WGET= wget +WHAT= what +WHATIS= whatis +WHICH= which +WHO= who +WHOAMI= whoami +WHOIS= whois +WRTIE= write +XAR= xar +XARGS= xargs +XATTR= xattr +XXD= xxd +YACC= yacc +YES= yes +ZCAT= zcat +ZCMP= zcmp +ZDIFF= zdiff +ZEGREP= zegrep +ZFGREP= zfgrep +ZFORCE= zforce +ZGREP= zgrep +ZIP= zip +ZIPCLOAK= zipcloak +ZIPGREp= zipgrep +ZIPINFo= zipinfo +ZIPNOTE= zipnote +ZIPSPLIT= zipsplit +ZLESS= zless +ZMORE= zmore +ZNEW= znew +ZPRINT= zprint +ZSH= zsh -${WINNERS} merlyn.c nextmove.c ttt_game.c: - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Set X11_LIBDIR to the directory where the X11 library resides +# +#X11_LIBDIR= /usr/X11R6/lib +#X11_LIBDIR= /usr/X11/lib +X11_LIBDIR= /opt/X11/lib -ttt: ttt.sh - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# +#X11_INCDIR= /usr/X11R6/include +#X11_INCDIR= /usr/X11/include +X11_INCDIR= /opt/X11/include -merlyn: merlyn.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@ \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Common C compiler warnings to silence +# +#CSILENCE= +CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-overlength-strings \ + -Wno-unused-parameter -ttt_game: ttt_game.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +CWARN= -Wall -Wextra ${CSILENCE} +#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -nextmove: nextmove.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Compiler standard +# +#CSTD= +#CSTD= -ansi +CSTD= -std=gnu90 +# Compiler bit architecture +# +# Some entries require 32-bitness: +# ARCH= -m32 +# +# Some entries require 64-bitness: +# ARCH= -m64 +# +# By default we assume nothing: +# +ARCH= + +# Defines that are needed to compile +# +CDEFINE= +#CDEFINE= -DIOCCC + +# Include files that are needed to compile +# +CINCLUDE= +#CINCLUDE= -include stdlib.h +#CINCLUDE= -include stdio.h +#CINCLUDE= -include stdlib.h -include stdio.h +#CINCLUDE= -I ${X11_INCDIR} +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 + +# Optimization +# +# Most compiles will safely use -O2. Some can use only -O1 or -O. +# A few compilers have broken optimizers or this entry make break +# under those buggy optimizers and thus you may not want anything. +# Reasonable compilers will allow for -O3. +# +#OPT= +#OPT= -O +#OPT= -O1 +#OPT= -O2 +OPT= -O3 + +# Default flags for ANSI C compilation +# +CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} + +# Libraries needed to build +# +LIBS= +#LIBS= -lm +#LIBS= -L ${X11_LIBDIR} -lX11 +#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL + +# C compiler to use +# +CC= cc +#CC=clang +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-implicit-int-conversion -Wno-missing-variable-declarations + -Wno-pedantic -Wno-poison-system-directorie +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif + + +############################## +# Special flags for this entry +############################## +# +ENTRY= dds +PROG= ${ENTRY} +# +OBJ= ${PROG}.o +DATA= +TARGET= ${PROG} +# +ALT_OBJ= +ALT_TARGET= + + +################# +# build the entry +################# +# +all: data ${TARGET} + @${TRUE} + +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto + +${PROG}: ${PROG}.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + +# alternative executable +# +alt: data ${ALT_TARGET} + @${TRUE} + +# data files +# +data: ${DATA} + @${TRUE} + +# both all and alt +# +everything: all alt + + +############### +# utility rules +############### +# clean: - ${MAKE} -f ansi.mk clean - ${MAKE} -f common.mk clean -clobber: - ${MAKE} -f ansi.mk clobber - ${MAKE} -f common.mk clobber -nuke: clobber - ${MAKE} -f ansi.mk nuke - ${MAKE} -f common.mk nuke + ${RM} -f ${OBJ} ${ALT_OBJ} + @-if [ -f indent.c ]; then \ + echo ${RM} -f indent.c; \ + ${RM} -f indent.c; \ + fi + +clobber: clean + ${RM} -f ${TARGET} ${ALT_TARGET} + ${RM} -f a.out + @-if [ -e sandwich ]; then \ + ${RM} -f sandwich; \ + echo 'ate sandwich'; \ + fi + install: - ${MAKE} -f ansi.mk install - ${MAKE} -f common.mk install + @echo "Dr. Spock says that is not logical!" + @${TRUE} + +# you may be able to misunderstand the source by reading indent.c +# +indent.c: ${PROG}.c + @if which "${GINDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${GINDENT} < $< > $@"; \ + ${GINDENT} < $< > $@; \ + elif which "${INDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${INDENT} < $< > $@"; \ + ${INDENT} < $< > $@; \ + else \ + echo "no intent tool found, ident $< yourself, sorry"; \ + echo "exit 1"; \ + exit 1; \ + fi + + +################## +# 133t hacker rulz +################## +# +love: + @echo 'not war?' + @${TRUE} + +haste: + $(MAKE) waste + @${TRUE} + +waste: + @echo 'haste' + @${TRUE} + +maker: + @echo 'Participate in a maker faire' + @${TRUE} + +easter_egg: + @echo "you expected to often misunderstand this $${RANDOM} magic" + @echo "chongo '' /\\oo/\\" + @echo "Eggy" + +sandwich: easter_egg + @if [ `id -u` -eq 0 ]; then \ + echo 'Okay.'; \ + echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ + else \ + echo 'What? Make it yourself.'; \ + exit 1; \ + fi + +# Understand the history of the Homebrew Computer Club +# as well as the West Coast Computer Faire and +# you might be confused different. :-) +# +supernova: sandwich + @-if [ -r .code_anal ]; then \ + ${RM} -f .code_anal_v6; \ + else \ + echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ + fi + @echo "A $@ helps ${MAKE} the elements that help form planets" + @${TRUE} + +deep_magic: supernova + @-if [ -r .code_anal ]; then \ + ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ + --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + fi + @${TRUE} + +magic: deep_magic + @-if [ -r .code_anal ]; then \ + ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "If you don't eat yer meat, you can't have any pudding!"; \ + echo "How can you have any pudding if you don't eat yer meat?!"; \ + fi + @${TRUE} + +# The IOCCC resident astronomer states +# +charon: magic + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore IAU, $@ is a planet" + +pluto: charon + ${MAKE} charon + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore, $@ is a planet" + @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" diff --git a/1991/dds/README.md b/1991/dds/README.md index 897823dc3..b2551e607 100644 --- a/1991/dds/README.md +++ b/1991/dds/README.md @@ -1,4 +1,4 @@ -Most Well Rounded: +# Most Well Rounded: Diomidis Spinellis Imperial College, University of London @@ -7,14 +7,20 @@ Most Well Rounded: Greece -Judges' comments: +## To build: + + make all + +### To run + + ./dds basic_program + ./a.out + +## Judges' comments Make and run as follows: make dds - dds basic_program - a.out - For example, the author suggests trying: dds LANDER.BAS @@ -30,7 +36,7 @@ Judges' comments: have supplied a more portable ANSI version. -Selected notes from the author: +## Author's comments This program is a companion to the DDS-BASIC interpreter program that was submitted to the contest in 1990. This compiles BASIC programs into diff --git a/1991/dds/dds.ansi.c b/1991/dds/dds.ansi.c deleted file mode 100644 index 1868a83e0..000000000 --- a/1991/dds/dds.ansi.c +++ /dev/null @@ -1,17 +0,0 @@ -#include -#define Q r=R[*p++-'0'];while( -#define B ;break;case -char*s="Qjou!s\\311^-g\\311^-n\\311^-c\\::^-q-ma%mO1JBHm%BQ-aP1J[O1HB%[QaP2QaP4HC%T\ -Qs\\q,,^>m,2aP4HC%SD12N1\nJNQm>s\\..q^aHC%NHb%GN1!D32P3%RN1UP1D12JPQUaP1H\ -R%PN4\nQaP2Q,2aP4Hb%OD12D12N2!N3\nJVP3Q,,n\ -\\(aP3Q(^*m>g\\(aP3Q(^::::aHC%VP3Q>bupj)hfut)c**aHb%JD12JON1!Qjg)a%LN1UP1D12JIQUa\ -P1HL%IQ*m>aN2!N2\nP2QP2Q>aN2\nP2Hbdd!b/d";int k;char R[4][99] -;main(c,v)char**v;{char*p,*r,*q;for(q=s;*q;q++)*q>' '&&(*q)--;{FILE*i=fopen(v -[1],"r"),*o=fopen(q-3,"w");for(p=s;;p++)switch(*p++){B'M':Q(k=fgetc(i))!=EOF -&&k!=*p)*r++=k;if(k==EOF){fputs("}}\n",o);fclose(o);return system(q-6);}*r=0 -B'P':while(*p!='`')fputc(*p++,o)B'O':Q*r)fputc(*r++,o);p--B'C':k=0;Q k<*p-'0' -)(*r++=fgetc(i),k++);*r=0 B'I':k= *p;if(**R==k)goto G B'G':k= *p;G:p=s;while( -*p!='$'||p[1]!= k)p++;p++B'N':R[*p-'0'][0]++;}}} diff --git a/1991/dds/dds.c b/1991/dds/dds.c index c2e837c57..1868a83e0 100644 --- a/1991/dds/dds.c +++ b/1991/dds/dds.c @@ -8,7 +8,7 @@ Qs\\q,,^>m,2aP4HC%SD12N1\nJNQm>s\\..q^aHC%NHb%GN1!D32P3%RN1UP1D12JPQUaP1H\ R%PN4\nQaP2Q,2aP4Hb%OD12D12N2!N3\nJVP3Q,,n\ \\(aP3Q(^*m>g\\(aP3Q(^::::aHC%VP3Q>bupj)hfut)c**aHb%JD12JON1!Qjg)a%LN1UP1D12JIQUa\ -P1HL%IQ*m>aN2!N2\nP2QP2Q>aN2\nP2Hbdd!b/d";k;char R[4][99] +P1HL%IQ*m>aN2!N2\nP2QP2Q>aN2\nP2Hbdd!b/d";int k;char R[4][99] ;main(c,v)char**v;{char*p,*r,*q;for(q=s;*q;q++)*q>' '&&(*q)--;{FILE*i=fopen(v [1],"r"),*o=fopen(q-3,"w");for(p=s;;p++)switch(*p++){B'M':Q(k=fgetc(i))!=EOF &&k!=*p)*r++=k;if(k==EOF){fputs("}}\n",o);fclose(o);return system(q-6);}*r=0 diff --git a/1991/fine/.gitignore b/1991/fine/.gitignore new file mode 100644 index 000000000..86815ca75 --- /dev/null +++ b/1991/fine/.gitignore @@ -0,0 +1 @@ +fine diff --git a/1991/fine/Makefile b/1991/fine/Makefile index 57c7302a6..a0e787eff 100644 --- a/1991/fine/Makefile +++ b/1991/fine/Makefile @@ -1,129 +1,594 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1991 makefile +# IOCCC 1991 winning entry - fine + +################################################################################ # -# Copyright (c) 1991, Landon Curt Noll & Larry Bassel. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll and Larry Bassel. - - -SHELL=/bin/sh -MAKE=make -MAKEFLAGS=e - -# uncomment the line to select the preferred type of compile +# An Historical Makefile NOTE: # -# You should also check the ansi.mk or common.mk for the -# proper compiler name and flags. +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. # -# NOTE ==> USE=ansi compile with an ANSI compiler by default -#USE=ansi -# NOTE ==> USE=common compile with a common K&R compiler by default -#USE=common +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. +# +# Regarding individual entries: +# +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. +# +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. +# +# GitHub pull requests are welcome: +# +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judges to +# consider. +# +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: +# +# https://github.com/ioccc-src/winner +# +################################################################################ -WINNERS= ant brnstnd buzzard cdupont davidguy dds fine rince westley +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# +# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# +# See: http://creativecommons.org/licenses/by-sa/3.0/ -all: - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -k -f common.mk all; \ - ${MAKE} -k -f common.mk all; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -k -f ansi.mk all; \ - ${MAKE} -k -f ansi.mk all; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1; \ - fi -ansi: - ${MAKE} -f ansi.mk all +############################# +# shell used by this Makefile +############################# +# +SHELL= bash -common: - ${MAKE} -f common.mk all +####################### +# common tool locations +####################### +# +A2P= a2p +AR= ar +ASA= asa +AT= at +ATQ= atq +ATRM= atrm +AWK= awk +BANNER= banner +BASE64= base64 +BASENAME= basename +BATCH= batch +BC= bc +BINHEX= binhex +BISON= bison +BUNZIP2= bunzip2 +BZCAT= bzcat +BZCMP= bzcmp +BZDIFF= bzdiff +BZEGREP= bzegrep +BZFGREP= bzfgrep +BZGREP= bzgrep +BZIP2= bzip2 +BZLESS= bzless +BZMORE= bzmore +C2PH= c2ph +C89= c89 +C99= c99 +CAL= cal +CALC= calc +CAT= cat +CD= cd +CHFLAGS= chflags +CHGRP= chgrp +CHMOD= chmod +CKSUM= cksum +CLANG= clang +CLANG_PLUSPLUS= clang++ +CLEAR= clear +CMP= cmp +COL= col +COLLDEF= colldef +COLRM= colrm +COLUMN= column +COMPRESS= compress +CP= cp +CPIO= cpio +CPP= cpp +CRC32= crc32 +CSH= csh +CSPLIT= csplit +CURL= curl +CUT= cut +C_PLUSPLUS= c++ +C_PLUSPLUS_FILT= c++filt +DATE= date +DC= dc +DD= dd +DF= df +DIFF3= diff3 +DIFF= diff +DIG= dig +DIRNAME= dirname +ED= ed +EGREP= egrep +ENV= env +EQN= eqn +ETAGS= etags +EXPECT= expect +EXPR= expr +FALSE= false +FGREP= fgrep +FILE= file +FIND2PERL= find2perl +FIND= find +FLEX= flex +FLEX_PLUSPLUS= flex++ +FMT= fmt +FOLD= fold +FS_USAGE= fs_usage +FUNZIP= funzip +FUSER= fuser +GCC= gcc +GDIFFMK= gdiffmk +GENCAT= gencat +GENSTRINGS= genstrings +GETOPT= getopt +GETOPTS= getopts +GINDENT= gindent +GNUMAKE= gnumake +GREP= grep +GROFF= groff +GROFFER= groffer +GROG= grog +GROPS= grops +GROTTY= grotty +GUNZIP= gunzip +GVIM= gvim +GZCAT= gzcat +GZEXE= gzexe +GZIP_PROG= gzip +G_PLUSPLUS= g++ +H2PH= h2ph +H2XS= h2xs +HASH= hash +HEAD= head +HOSTNAME_PROG= hostname +ICONV= iconv +ID= id +INDENT= indent +INFO= info +JOT= jot +KILL= kill +KSH= ksh +LAST= last +LD= ld +LESSECHO= lessecho +LEX= len +LINK= link +LN= ln +LS= ls +M4= m4 +MAKE= make +MAN= man +MKDIR= mkdir +MKFIFO= mkfifo +MKTEMP= mktemp +MV= mv +NANO= nano +NASM= nasm +NEQN= neqn +NICE= nice +NL= nl +NM= nm +NOHUP= nohup +NROFF= nroff +NSLOOKUP= nslookup +OD= od +OPENSSL= openssl +PASTE= paste +PATCH= patch +PATHCHK= pathchk +PAX= pax +PERL= perl +PICO= pico +PR= pr +PRINTENV= printenv +PS= ps +PTAR= ptar +PTARDIFF= ptardiff +PTARGREP= ptargrep +PWD= pwd +PYDOC= pydoc +PYTHON= python +PYTHONW= pythonw +READLINK= readlink +RENICE= renice +RESET= reset +REV= rev +RI= ri +RM= rm +RMDIR= rmdir +RSYNC= rsync +RUBY= ruby +RVIM= rvim +SAY= say +SCP= scp +SCREEN= screen +SCRIPT= script +SDIFF= sdiff +SED= sed +SEQ= seq +SFTP= sftp +SH= sh +SHA1= sha1 +SHA= sha +SHAR= shar +SHASUM5_18= shasum5.18 +SHASUM= shasum +SIZE= size +SLEEP= sleep +SORT= sort +SSH= ssh +STAT= stat +STRIP= strip +STTY= stty +SUM= sum +SYNC= sync +TABS= tabs +TAIL= tail +TAR= tar +TEE= tee +TEST= test +TFTP= tftp +TIDY= tidy +TIME= time +TOP= top +TOUCH= touch +TPUT= tout +TPUT= tput +TR= tr +TROFF= troff +TRUE= true +TSET= tset +TSORT= tsort +UL= ul +UNAME= uname +UNCOMPRESS= uncompress +UNEXPAND= unexpand +UNIFDEF= unifdef +UNIFDEFALL= unifdefall +UNIQ= uniq +UNITS= units +UNLINK= unlink +UNZIP= unzip +UNZIPSFX= unzipsfx +UPTIME= uptime +UUDECODE= uudecode +UUENCODE= uuencode +UUIDGEN= uuidgen +VI= vi +VIEW= view +VIM= vim +VIMDIFF= vimdiff +W= w +WAIT4PATH= wait4path +WAIT= wait +WC= wc +WGET= wget +WHAT= what +WHATIS= whatis +WHICH= which +WHO= who +WHOAMI= whoami +WHOIS= whois +WRTIE= write +XAR= xar +XARGS= xargs +XATTR= xattr +XXD= xxd +YACC= yacc +YES= yes +ZCAT= zcat +ZCMP= zcmp +ZDIFF= zdiff +ZEGREP= zegrep +ZFGREP= zfgrep +ZFORCE= zforce +ZGREP= zgrep +ZIP= zip +ZIPCLOAK= zipcloak +ZIPGREp= zipgrep +ZIPINFo= zipinfo +ZIPNOTE= zipnote +ZIPSPLIT= zipsplit +ZLESS= zless +ZMORE= zmore +ZNEW= znew +ZPRINT= zprint +ZSH= zsh -${WINNERS} merlyn.c nextmove.c ttt_game.c: - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Set X11_LIBDIR to the directory where the X11 library resides +# +#X11_LIBDIR= /usr/X11R6/lib +#X11_LIBDIR= /usr/X11/lib +X11_LIBDIR= /opt/X11/lib -ttt: ttt.sh - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# +#X11_INCDIR= /usr/X11R6/include +#X11_INCDIR= /usr/X11/include +X11_INCDIR= /opt/X11/include -merlyn: merlyn.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@ \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Common C compiler warnings to silence +# +#CSILENCE= +CSILENCE= -Wno-bitwise-op-parentheses -Wno-error -Wno-implicit-function-declaration \ + -Wno-int-conversion -Wno-pointer-to-int-cast -ttt_game: ttt_game.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +#CWARN= -Wall -Wextra ${CSILENCE} +CWARN= -Wall -Wextra -pedantic ${CSILENCE} -nextmove: nextmove.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Compiler standard +# +#CSTD= +#CSTD= -ansi +CSTD= -std=gnu90 +# Compiler bit architecture +# +# Some entries require 32-bitness: +# ARCH= -m32 +# +# Some entries require 64-bitness: +# ARCH= -m64 +# +# By default we assume nothing: +# +ARCH= + +# Defines that are needed to compile +# +CDEFINE= +#CDEFINE= -DIOCCC + +# Include files that are needed to compile +# +CINCLUDE= +#CINCLUDE= -include stdlib.h +#CINCLUDE= -include stdio.h +#CINCLUDE= -include stdlib.h -include stdio.h +#CINCLUDE= -I ${X11_INCDIR} +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 + +# Optimization +# +# Most compiles will safely use -O2. Some can use only -O1 or -O. +# A few compilers have broken optimizers or this entry make break +# under those buggy optimizers and thus you may not want anything. +# Reasonable compilers will allow for -O3. +# +#OPT= +#OPT= -O +#OPT= -O1 +#OPT= -O2 +OPT= -O3 + +# Default flags for ANSI C compilation +# +CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} + +# Libraries needed to build +# +LIBS= +#LIBS= -lm +#LIBS= -L ${X11_LIBDIR} -lX11 +#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL + +# C compiler to use +# +CC= cc +#CC=clang +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-poison-system-directories +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif + + +############################## +# Special flags for this entry +############################## +# +ENTRY= fine +PROG= ${ENTRY} +# +OBJ= ${PROG}.o +DATA= +TARGET= ${PROG} +# +ALT_OBJ= +ALT_TARGET= + + +################# +# build the entry +################# +# +all: data ${TARGET} + @${TRUE} + +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto + +${PROG}: ${PROG}.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + +# alternative executable +# +alt: data ${ALT_TARGET} + @${TRUE} + +# data files +# +data: ${DATA} + @${TRUE} + +# both all and alt +# +everything: all alt + + +############### +# utility rules +############### +# clean: - ${MAKE} -f ansi.mk clean - ${MAKE} -f common.mk clean -clobber: - ${MAKE} -f ansi.mk clobber - ${MAKE} -f common.mk clobber -nuke: clobber - ${MAKE} -f ansi.mk nuke - ${MAKE} -f common.mk nuke + ${RM} -f ${OBJ} ${ALT_OBJ} + @-if [ -f indent.c ]; then \ + echo ${RM} -f indent.c; \ + ${RM} -f indent.c; \ + fi + +clobber: clean + ${RM} -f ${TARGET} ${ALT_TARGET} + @-if [ -e sandwich ]; then \ + ${RM} -f sandwich; \ + echo 'ate sandwich'; \ + fi + install: - ${MAKE} -f ansi.mk install - ${MAKE} -f common.mk install + @echo "Dr. Spock says that is not logical!" + @${TRUE} + +# you may be able to misunderstand the source by reading indent.c +# +indent.c: ${PROG}.c + @if which "${GINDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${GINDENT} < $< > $@"; \ + ${GINDENT} < $< > $@; \ + elif which "${INDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${INDENT} < $< > $@"; \ + ${INDENT} < $< > $@; \ + else \ + echo "no intent tool found, ident $< yourself, sorry"; \ + echo "exit 1"; \ + exit 1; \ + fi + + +################## +# 133t hacker rulz +################## +# +love: + @echo 'not war?' + @${TRUE} + +haste: + $(MAKE) waste + @${TRUE} + +waste: + @echo 'haste' + @${TRUE} + +maker: + @echo 'Participate in a maker faire' + @${TRUE} + +easter_egg: + @echo "you expected to often misunderstand this $${RANDOM} magic" + @echo "chongo '' /\\oo/\\" + @echo "Eggy" + +sandwich: easter_egg + @if [ `id -u` -eq 0 ]; then \ + echo 'Okay.'; \ + echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ + else \ + echo 'What? Make it yourself.'; \ + exit 1; \ + fi + +# Understand the history of the Homebrew Computer Club +# as well as the West Coast Computer Faire and +# you might be confused different. :-) +# +supernova: sandwich + @-if [ -r .code_anal ]; then \ + ${RM} -f .code_anal_v6; \ + else \ + echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ + fi + @echo "A $@ helps ${MAKE} the elements that help form planets" + @${TRUE} + +deep_magic: supernova + @-if [ -r .code_anal ]; then \ + ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ + --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + fi + @${TRUE} + +magic: deep_magic + @-if [ -r .code_anal ]; then \ + ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "If you don't eat yer meat, you can't have any pudding!"; \ + echo "How can you have any pudding if you don't eat yer meat?!"; \ + fi + @${TRUE} + +# The IOCCC resident astronomer states +# +charon: magic + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore IAU, $@ is a planet" + +pluto: charon + ${MAKE} charon + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore, $@ is a planet" + @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" diff --git a/1991/fine/README.md b/1991/fine/README.md index a7a51f518..498cb1bee 100644 --- a/1991/fine/README.md +++ b/1991/fine/README.md @@ -1,4 +1,4 @@ -Best One Liner: +# Best One Liner: Thomas A. Fine Ohio State University @@ -7,19 +7,21 @@ Best One Liner: Columbus, Ohio 43210 USA +## To build: -Judges' comments: + make all - Make and run as follows: +### To run - make fine echo "green terra - vex - tang - vend onyx - cheryl be flashy - rail - clerk" | fine +vex +tang +vend onyx +cheryl be flashy +rail +clerk" | ./fine + +## Judges' comments This filter, 80 chars plus a newline, fits into a single line on most terminals (unless your terminal has a line wrap mis-feature :-)). @@ -32,8 +34,7 @@ Judges' comments: into 2 bytes, allowing the program to still work, but also stripping the high bit off of some input? - -Selected notes from the author: +## Author's comments The author wishes to thank J Greely for the last 6 bytes. diff --git a/1991/fine/fine.c b/1991/fine/fine.c index f48cef507..b465e06f3 100644 --- a/1991/fine/fine.c +++ b/1991/fine/fine.c @@ -1 +1 @@ -main(a,b){while((a=getchar())+1)putchar((b=64^a&223)&&b<27?a&96|(b+12)%26+1:a);} +int main(int a, char **b){while((a=getchar())+1)putchar((b=64^a&223)&&(int)b<27?a&96|((int)b+12)%26+1:a);} diff --git a/1991/rince/.gitignore b/1991/rince/.gitignore new file mode 100644 index 000000000..8e87c9d18 --- /dev/null +++ b/1991/rince/.gitignore @@ -0,0 +1 @@ +rince diff --git a/1991/rince/Makefile b/1991/rince/Makefile index 57c7302a6..9ca33e43d 100644 --- a/1991/rince/Makefile +++ b/1991/rince/Makefile @@ -1,129 +1,594 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1991 makefile +# IOCCC 1991 winning entry - rince + +################################################################################ # -# Copyright (c) 1991, Landon Curt Noll & Larry Bassel. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll and Larry Bassel. - - -SHELL=/bin/sh -MAKE=make -MAKEFLAGS=e - -# uncomment the line to select the preferred type of compile +# An Historical Makefile NOTE: # -# You should also check the ansi.mk or common.mk for the -# proper compiler name and flags. +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. # -# NOTE ==> USE=ansi compile with an ANSI compiler by default -#USE=ansi -# NOTE ==> USE=common compile with a common K&R compiler by default -#USE=common +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. +# +# Regarding individual entries: +# +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. +# +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. +# +# GitHub pull requests are welcome: +# +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judges to +# consider. +# +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: +# +# https://github.com/ioccc-src/winner +# +################################################################################ -WINNERS= ant brnstnd buzzard cdupont davidguy dds fine rince westley +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# +# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# +# See: http://creativecommons.org/licenses/by-sa/3.0/ -all: - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -k -f common.mk all; \ - ${MAKE} -k -f common.mk all; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -k -f ansi.mk all; \ - ${MAKE} -k -f ansi.mk all; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1; \ - fi -ansi: - ${MAKE} -f ansi.mk all +############################# +# shell used by this Makefile +############################# +# +SHELL= bash -common: - ${MAKE} -f common.mk all +####################### +# common tool locations +####################### +# +A2P= a2p +AR= ar +ASA= asa +AT= at +ATQ= atq +ATRM= atrm +AWK= awk +BANNER= banner +BASE64= base64 +BASENAME= basename +BATCH= batch +BC= bc +BINHEX= binhex +BISON= bison +BUNZIP2= bunzip2 +BZCAT= bzcat +BZCMP= bzcmp +BZDIFF= bzdiff +BZEGREP= bzegrep +BZFGREP= bzfgrep +BZGREP= bzgrep +BZIP2= bzip2 +BZLESS= bzless +BZMORE= bzmore +C2PH= c2ph +C89= c89 +C99= c99 +CAL= cal +CALC= calc +CAT= cat +CD= cd +CHFLAGS= chflags +CHGRP= chgrp +CHMOD= chmod +CKSUM= cksum +CLANG= clang +CLANG_PLUSPLUS= clang++ +CLEAR= clear +CMP= cmp +COL= col +COLLDEF= colldef +COLRM= colrm +COLUMN= column +COMPRESS= compress +CP= cp +CPIO= cpio +CPP= cpp +CRC32= crc32 +CSH= csh +CSPLIT= csplit +CURL= curl +CUT= cut +C_PLUSPLUS= c++ +C_PLUSPLUS_FILT= c++filt +DATE= date +DC= dc +DD= dd +DF= df +DIFF3= diff3 +DIFF= diff +DIG= dig +DIRNAME= dirname +ED= ed +EGREP= egrep +ENV= env +EQN= eqn +ETAGS= etags +EXPECT= expect +EXPR= expr +FALSE= false +FGREP= fgrep +FILE= file +FIND2PERL= find2perl +FIND= find +FLEX= flex +FLEX_PLUSPLUS= flex++ +FMT= fmt +FOLD= fold +FS_USAGE= fs_usage +FUNZIP= funzip +FUSER= fuser +GCC= gcc +GDIFFMK= gdiffmk +GENCAT= gencat +GENSTRINGS= genstrings +GETOPT= getopt +GETOPTS= getopts +GINDENT= gindent +GNUMAKE= gnumake +GREP= grep +GROFF= groff +GROFFER= groffer +GROG= grog +GROPS= grops +GROTTY= grotty +GUNZIP= gunzip +GVIM= gvim +GZCAT= gzcat +GZEXE= gzexe +GZIP_PROG= gzip +G_PLUSPLUS= g++ +H2PH= h2ph +H2XS= h2xs +HASH= hash +HEAD= head +HOSTNAME_PROG= hostname +ICONV= iconv +ID= id +INDENT= indent +INFO= info +JOT= jot +KILL= kill +KSH= ksh +LAST= last +LD= ld +LESSECHO= lessecho +LEX= len +LINK= link +LN= ln +LS= ls +M4= m4 +MAKE= make +MAN= man +MKDIR= mkdir +MKFIFO= mkfifo +MKTEMP= mktemp +MV= mv +NANO= nano +NASM= nasm +NEQN= neqn +NICE= nice +NL= nl +NM= nm +NOHUP= nohup +NROFF= nroff +NSLOOKUP= nslookup +OD= od +OPENSSL= openssl +PASTE= paste +PATCH= patch +PATHCHK= pathchk +PAX= pax +PERL= perl +PICO= pico +PR= pr +PRINTENV= printenv +PS= ps +PTAR= ptar +PTARDIFF= ptardiff +PTARGREP= ptargrep +PWD= pwd +PYDOC= pydoc +PYTHON= python +PYTHONW= pythonw +READLINK= readlink +RENICE= renice +RESET= reset +REV= rev +RI= ri +RM= rm +RMDIR= rmdir +RSYNC= rsync +RUBY= ruby +RVIM= rvim +SAY= say +SCP= scp +SCREEN= screen +SCRIPT= script +SDIFF= sdiff +SED= sed +SEQ= seq +SFTP= sftp +SH= sh +SHA1= sha1 +SHA= sha +SHAR= shar +SHASUM5_18= shasum5.18 +SHASUM= shasum +SIZE= size +SLEEP= sleep +SORT= sort +SSH= ssh +STAT= stat +STRIP= strip +STTY= stty +SUM= sum +SYNC= sync +TABS= tabs +TAIL= tail +TAR= tar +TEE= tee +TEST= test +TFTP= tftp +TIDY= tidy +TIME= time +TOP= top +TOUCH= touch +TPUT= tout +TPUT= tput +TR= tr +TROFF= troff +TRUE= true +TSET= tset +TSORT= tsort +UL= ul +UNAME= uname +UNCOMPRESS= uncompress +UNEXPAND= unexpand +UNIFDEF= unifdef +UNIFDEFALL= unifdefall +UNIQ= uniq +UNITS= units +UNLINK= unlink +UNZIP= unzip +UNZIPSFX= unzipsfx +UPTIME= uptime +UUDECODE= uudecode +UUENCODE= uuencode +UUIDGEN= uuidgen +VI= vi +VIEW= view +VIM= vim +VIMDIFF= vimdiff +W= w +WAIT4PATH= wait4path +WAIT= wait +WC= wc +WGET= wget +WHAT= what +WHATIS= whatis +WHICH= which +WHO= who +WHOAMI= whoami +WHOIS= whois +WRTIE= write +XAR= xar +XARGS= xargs +XATTR= xattr +XXD= xxd +YACC= yacc +YES= yes +ZCAT= zcat +ZCMP= zcmp +ZDIFF= zdiff +ZEGREP= zegrep +ZFGREP= zfgrep +ZFORCE= zforce +ZGREP= zgrep +ZIP= zip +ZIPCLOAK= zipcloak +ZIPGREp= zipgrep +ZIPINFo= zipinfo +ZIPNOTE= zipnote +ZIPSPLIT= zipsplit +ZLESS= zless +ZMORE= zmore +ZNEW= znew +ZPRINT= zprint +ZSH= zsh -${WINNERS} merlyn.c nextmove.c ttt_game.c: - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Set X11_LIBDIR to the directory where the X11 library resides +# +#X11_LIBDIR= /usr/X11R6/lib +#X11_LIBDIR= /usr/X11/lib +X11_LIBDIR= /opt/X11/lib -ttt: ttt.sh - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# +#X11_INCDIR= /usr/X11R6/include +#X11_INCDIR= /usr/X11/include +X11_INCDIR= /opt/X11/include -merlyn: merlyn.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@ \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Common C compiler warnings to silence +# +#CSILENCE= +CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-parentheses -ttt_game: ttt_game.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +#CWARN= -Wall -Wextra ${CSILENCE} +CWARN= -Wall -Wextra -pedantic ${CSILENCE} -nextmove: nextmove.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Compiler standard +# +#CSTD= +#CSTD= -ansi +CSTD= -std=gnu90 +# Compiler bit architecture +# +# Some entries require 32-bitness: +# ARCH= -m32 +# +# Some entries require 64-bitness: +# ARCH= -m64 +# +# By default we assume nothing: +# +ARCH= + +# Defines that are needed to compile +# +CDEFINE= +#CDEFINE= -DIOCCC + +# Include files that are needed to compile +# +CINCLUDE= +#CINCLUDE= -include stdlib.h +#CINCLUDE= -include stdio.h +#CINCLUDE= -include stdlib.h -include stdio.h +#CINCLUDE= -I ${X11_INCDIR} +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 + +# Optimization +# +# Most compiles will safely use -O2. Some can use only -O1 or -O. +# A few compilers have broken optimizers or this entry make break +# under those buggy optimizers and thus you may not want anything. +# Reasonable compilers will allow for -O3. +# +#OPT= +#OPT= -O +#OPT= -O1 +#OPT= -O2 +OPT= -O3 + +# Default flags for ANSI C compilation +# +CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} + +# Libraries needed to build +# +#LIBS= +LIBS= -lcurses -ltermcap +#LIBS= -L ${X11_LIBDIR} -lX11 +#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL + +# C compiler to use +# +CC= cc +#CC=clang +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-comma -Wno-missing-variable-declarations \ + -Wno-poison-system-directories -Wno-shorten-64-to-32 +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif + + +############################## +# Special flags for this entry +############################## +# +ENTRY= rince +PROG= ${ENTRY} +# +OBJ= ${PROG}.o +DATA= +TARGET= ${PROG} +# +ALT_OBJ= +ALT_TARGET= + + +################# +# build the entry +################# +# +all: data ${TARGET} + @${TRUE} + +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto + +${PROG}: ${PROG}.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + +# alternative executable +# +alt: data ${ALT_TARGET} + @${TRUE} + +# data files +# +data: ${DATA} + @${TRUE} + +# both all and alt +# +everything: all alt + + +############### +# utility rules +############### +# clean: - ${MAKE} -f ansi.mk clean - ${MAKE} -f common.mk clean -clobber: - ${MAKE} -f ansi.mk clobber - ${MAKE} -f common.mk clobber -nuke: clobber - ${MAKE} -f ansi.mk nuke - ${MAKE} -f common.mk nuke + ${RM} -f ${OBJ} ${ALT_OBJ} + @-if [ -f indent.c ]; then \ + echo ${RM} -f indent.c; \ + ${RM} -f indent.c; \ + fi + +clobber: clean + ${RM} -f ${TARGET} ${ALT_TARGET} + @-if [ -e sandwich ]; then \ + ${RM} -f sandwich; \ + echo 'ate sandwich'; \ + fi + install: - ${MAKE} -f ansi.mk install - ${MAKE} -f common.mk install + @echo "Dr. Spock says that is not logical!" + @${TRUE} + +# you may be able to misunderstand the source by reading indent.c +# +indent.c: ${PROG}.c + @if which "${GINDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${GINDENT} < $< > $@"; \ + ${GINDENT} < $< > $@; \ + elif which "${INDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${INDENT} < $< > $@"; \ + ${INDENT} < $< > $@; \ + else \ + echo "no intent tool found, ident $< yourself, sorry"; \ + echo "exit 1"; \ + exit 1; \ + fi + + +################## +# 133t hacker rulz +################## +# +love: + @echo 'not war?' + @${TRUE} + +haste: + $(MAKE) waste + @${TRUE} + +waste: + @echo 'haste' + @${TRUE} + +maker: + @echo 'Participate in a maker faire' + @${TRUE} + +easter_egg: + @echo "you expected to often misunderstand this $${RANDOM} magic" + @echo "chongo '' /\\oo/\\" + @echo "Eggy" + +sandwich: easter_egg + @if [ `id -u` -eq 0 ]; then \ + echo 'Okay.'; \ + echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ + else \ + echo 'What? Make it yourself.'; \ + exit 1; \ + fi + +# Understand the history of the Homebrew Computer Club +# as well as the West Coast Computer Faire and +# you might be confused different. :-) +# +supernova: sandwich + @-if [ -r .code_anal ]; then \ + ${RM} -f .code_anal_v6; \ + else \ + echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ + fi + @echo "A $@ helps ${MAKE} the elements that help form planets" + @${TRUE} + +deep_magic: supernova + @-if [ -r .code_anal ]; then \ + ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ + --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + fi + @${TRUE} + +magic: deep_magic + @-if [ -r .code_anal ]; then \ + ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "If you don't eat yer meat, you can't have any pudding!"; \ + echo "How can you have any pudding if you don't eat yer meat?!"; \ + fi + @${TRUE} + +# The IOCCC resident astronomer states +# +charon: magic + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore IAU, $@ is a planet" + +pluto: charon + ${MAKE} charon + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore, $@ is a planet" + @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" diff --git a/1991/rince/README.md b/1991/rince/README.md index 2ab9c0060..c307fd550 100644 --- a/1991/rince/README.md +++ b/1991/rince/README.md @@ -1,4 +1,4 @@ -Best Game: +# Best Game: James Bonfield University of Warwick @@ -8,28 +8,19 @@ Best Game: SG19 2HA England +## To build: -Judges' comments: + make all - Make and run as follows: +### To run - make rince - rince + ./rince - This entry exposed a number of bugs in a number of ANSI C compilers! - Because of this, we have provided a number of different versions: +## Judges' comments - rince.orig.c - James Bonfield entry - (many non-GNU ANSI compilers can't grok this code) - rince.c - our non-ANSI version of rince.orig.c - rince_ansi.c - same as rince.c - (most ANSI C compilers can deal with this) - - You may need to change the makefile depending on what type of system - you are running. See the notes in ansi.mk or common.mk. + This entry has been updated to allow most ANSI C compiler. - -Selected notes from the author: +## Author's comments This program is a simple puzzle type game. (I'll leave you to play it to see the rest of it .. :-) .) The general idea was to try and diff --git a/1991/rince/rince.orig.c b/1991/rince/rince.orig.c deleted file mode 100644 index dce39f4f6..000000000 --- a/1991/rince/rince.orig.c +++ /dev/null @@ -1,30 +0,0 @@ -#include -#define R break -#define U M[h][f] -#define W M[g][e] -#define T M[y][x] -#define B(a) "A"#a"A", -#define A "AAAAAAAAAAAAAAAAAAAAAA" -#define z(a) case a:if(U=='B')U=W,x=e,y=g,u--; -#define Z(a,b) else if(U==a&&d==b)U=W='B';R; -#define K(a) a##a##a -#define k(a) #a#a#a#a#a#a"\0" -#define V " \0" -#define S " \0/----\\\0_/ \\_" -int u=484,X[]={-1,0,0,1},Y[]={0,1,-1,0},x,y,D,i,j,a;char o,m,*t,*O="MNOH" -,*k="hjkl",*s=K(k(#))V V V" ___ \0 / \\\0 \\___/\0 ___ \0 /@@@\\\0 " -"\\@@@/\0| | /\\\0----||\0 \\/\0 /--\\\0 \\/ \0 ==| \0 ==| \0 " -" /\\ \0 \\--/\0 /O__o\0 \\___/\0 /_\\_ \0"K(" << \0")V k(v)V V k(^)V -" /\\ \0 < > \0 \\/ \0o__O\\ \0\\___/ \0 _/_\\ \0 O__O"S"\0 ^__^"S, -M[12][22]={A,B(LCABBBBBBBABBCBBCABB)B(CCABAKAAABAFBABABAEB -)B(BBBBABBIBBBBBEEABACL)B(CCBNIBBAAAAGALBBBABC)B(AAAAAAJACBABBCABAABC -)B(LLAACCBACBAAALLCABBB)B(BDLAAABABCAAAALCABBL)B(BCBIBBBBBBBBAAAAACBB -)B(BCCAABBADBBBBDBDBDBC)B(LBBACCCCDBCABBBDBBBB)A};main(){initscr();clear(); -noecho();cbreak();x=y=4;D=39,o='M';m=T;while(D&&u){for(i=j=a=0;j<7;!(mvaddstr( -j*3+a,i*6,s+(((M[((y-1)/5)*5+j][((x-1)/10)*10+i]-'A')*3+a++)*7)),a^3)&&(a=0,! -(++i^12))&&(a=i=0,j++));refresh();T='B';if(t=(char*)strchr(k,getch())){int e= -x,g=y,f=x,h=y,d=t-k;o=O[d];f=(e=x+X[d])+d[X];h=(g=y+Y[d])+d[Y];switch(W){case -'B':x=e;y=g,u--;R;z('C')else if(U=='C')U=W='L';R;z('D')R;case'L':x=e;y=g,u--;D ---;R;z('E')Z('I',0)z('F')Z('J',1)z('G')Z('K',2)}}m=T;T=o;}clear();mvaddstr(12 -,31,u?"Well done!":"Too many moves");move(23,0);refresh();endwin();return 0;} - diff --git a/1991/rince/rince_ansi.c b/1991/rince/rince_ansi.c deleted file mode 100644 index 1d5d5edd5..000000000 --- a/1991/rince/rince_ansi.c +++ /dev/null @@ -1,12 +0,0 @@ -#include -int u=484,X[]={-1,0,0,1},Y[]={0,1,-1,0},x,y,D,i,j,a; -char o,m,*t,*O="MNOH",*k="hjkl",*s="######\0######\0######\0 \0 \0 \0 ___ \0 / \\\0 \\___/\0 ___ \0 /@@@\\\0 \\@@@/\0| | /\\\0----||\0 \\/\0 /--\\\0 \\/ \0 ==| \0 ==| \0 /\\ \0 \\--/\0 /O__o\0 \\___/\0 /_\\_ \0 << \0 << \0 << \0 \0vvvvvv\0 \0 \0^^^^^^\0 \0 /\\ \0 < > \0 \\/ \0o__O\\ \0\\___/ \0 _/_\\ \0 O__O \0/----\\\0_/ \\_\0 ^__^ \0/----\\\0_/ \\_" , -M[12][22]={"AAAAAAAAAAAAAAAAAAAAAA" ,"ALCABBBBBBBABBCBBCABBA", "ACCABAKAAABAFBABABAEBA", "ABBBBABBIBBBBBEEABACLA", "ACCBNIBBAAAAGALBBBABCA", "AAAAAAAJACBABBCABAABCA", "ALLAACCBACBAAALLCABBBA", "ABDLAAABABCAAAALCABBLA", "ABCBIBBBBBBBBAAAAACBBA", "ABCCAABBADBBBBDBDBDBCA", "ALBBACCCCDBCABBBDBBBBA", "AAAAAAAAAAAAAAAAAAAAAA" };main(){initscr();clear(); -noecho();cbreak();x=y=4;D=39,o='M';m=M[y][x] ;while(D&&u){for(i=j=a=0;j<7;!(mvaddstr( -j*3+a,i*6,s+(((M[((y-1)/5)*5+j][((x-1)/10)*10+i]-'A')*3+a++)*7)),a^3)&&(a=0,! -(++i^12))&&(a=i=0,j++));refresh();M[y][x] ='B';if(t=(char*)strchr(k,getch())){int e= -x,g=y,f=x,h=y,d=t-k;o=O[d];f=(e=x+X[d])+X[d];h=(g=y+Y[d])+Y[d];switch(M[g][e] ){case -'B':x=e;y=g,u--;break ;case 'C':if(M[h][f] =='B')M[h][f] =M[g][e] ,x=e,y=g,u--; else if(M[h][f] =='C')M[h][f] =M[g][e] ='L';break ;case 'D':if(M[h][f] =='B')M[h][f] =M[g][e] ,x=e,y=g,u--; break ;case'L':x=e;y=g,u--;D ---;break ;case 'E':if(M[h][f] =='B')M[h][f] =M[g][e] ,x=e,y=g,u--; else if(M[h][f] =='I'&&d==0)M[h][f] =M[g][e] ='B';break ; case 'F':if(M[h][f] =='B')M[h][f] =M[g][e] ,x=e,y=g,u--; else if(M[h][f] =='J'&&d==1)M[h][f] =M[g][e] ='B';break ; case 'G':if(M[h][f] =='B')M[h][f] =M[g][e] ,x=e,y=g,u--; else if(M[h][f] =='K'&&d==2)M[h][f] =M[g][e] ='B';break ; }}m=M[y][x] ;M[y][x] =o;}clear();mvaddstr(12 -,31,u?"Well done!":"Too many moves");move(23,0);refresh();endwin();return 0;} - diff --git a/1991/westley/.gitignore b/1991/westley/.gitignore new file mode 100644 index 000000000..afba99c52 --- /dev/null +++ b/1991/westley/.gitignore @@ -0,0 +1,8 @@ +merlyn +merlyn.c +nextmove +nextmove.c +ttt +ttt_game +ttt_game.c +westley diff --git a/1991/westley/Makefile b/1991/westley/Makefile index 57c7302a6..d16183877 100644 --- a/1991/westley/Makefile +++ b/1991/westley/Makefile @@ -1,129 +1,650 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1991 makefile +# IOCCC 1991 winning entry - westley + +################################################################################ # -# Copyright (c) 1991, Landon Curt Noll & Larry Bassel. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll and Larry Bassel. - - -SHELL=/bin/sh -MAKE=make -MAKEFLAGS=e - -# uncomment the line to select the preferred type of compile +# An Historical Makefile NOTE: # -# You should also check the ansi.mk or common.mk for the -# proper compiler name and flags. +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. # -# NOTE ==> USE=ansi compile with an ANSI compiler by default -#USE=ansi -# NOTE ==> USE=common compile with a common K&R compiler by default -#USE=common +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. +# +# Regarding individual entries: +# +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. +# +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. +# +# GitHub pull requests are welcome: +# +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judges to +# consider. +# +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: +# +# https://github.com/ioccc-src/winner +# +################################################################################ -WINNERS= ant brnstnd buzzard cdupont davidguy dds fine rince westley +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# +# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# +# See: http://creativecommons.org/licenses/by-sa/3.0/ -all: - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -k -f common.mk all; \ - ${MAKE} -k -f common.mk all; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -k -f ansi.mk all; \ - ${MAKE} -k -f ansi.mk all; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1; \ - fi -ansi: - ${MAKE} -f ansi.mk all +############################# +# shell used by this Makefile +############################# +# +SHELL= bash -common: - ${MAKE} -f common.mk all +####################### +# common tool locations +####################### +# +A2P= a2p +AR= ar +ASA= asa +AT= at +ATQ= atq +ATRM= atrm +AWK= awk +BANNER= banner +BASE64= base64 +BASENAME= basename +BATCH= batch +BC= bc +BINHEX= binhex +BISON= bison +BUNZIP2= bunzip2 +BZCAT= bzcat +BZCMP= bzcmp +BZDIFF= bzdiff +BZEGREP= bzegrep +BZFGREP= bzfgrep +BZGREP= bzgrep +BZIP2= bzip2 +BZLESS= bzless +BZMORE= bzmore +C2PH= c2ph +C89= c89 +C99= c99 +CAL= cal +CALC= calc +CAT= cat +CD= cd +CHFLAGS= chflags +CHGRP= chgrp +CHMOD= chmod +CKSUM= cksum +CLANG= clang +CLANG_PLUSPLUS= clang++ +CLEAR= clear +CMP= cmp +COL= col +COLLDEF= colldef +COLRM= colrm +COLUMN= column +COMPRESS= compress +CP= cp +CPIO= cpio +CPP= cpp +CRC32= crc32 +CSH= csh +CSPLIT= csplit +CURL= curl +CUT= cut +C_PLUSPLUS= c++ +C_PLUSPLUS_FILT= c++filt +DATE= date +DC= dc +DD= dd +DF= df +DIFF3= diff3 +DIFF= diff +DIG= dig +DIRNAME= dirname +ED= ed +EGREP= egrep +ENV= env +EQN= eqn +ETAGS= etags +EXPECT= expect +EXPR= expr +FALSE= false +FGREP= fgrep +FILE= file +FIND2PERL= find2perl +FIND= find +FLEX= flex +FLEX_PLUSPLUS= flex++ +FMT= fmt +FOLD= fold +FS_USAGE= fs_usage +FUNZIP= funzip +FUSER= fuser +GCC= gcc +GDIFFMK= gdiffmk +GENCAT= gencat +GENSTRINGS= genstrings +GETOPT= getopt +GETOPTS= getopts +GINDENT= gindent +GNUMAKE= gnumake +GREP= grep +GROFF= groff +GROFFER= groffer +GROG= grog +GROPS= grops +GROTTY= grotty +GUNZIP= gunzip +GVIM= gvim +GZCAT= gzcat +GZEXE= gzexe +GZIP_PROG= gzip +G_PLUSPLUS= g++ +H2PH= h2ph +H2XS= h2xs +HASH= hash +HEAD= head +HOSTNAME_PROG= hostname +ICONV= iconv +ID= id +INDENT= indent +INFO= info +JOT= jot +KILL= kill +KSH= ksh +LAST= last +LD= ld +LESSECHO= lessecho +LEX= len +LINK= link +LN= ln +LS= ls +M4= m4 +MAKE= make +MAN= man +MKDIR= mkdir +MKFIFO= mkfifo +MKTEMP= mktemp +MV= mv +NANO= nano +NASM= nasm +NEQN= neqn +NICE= nice +NL= nl +NM= nm +NOHUP= nohup +NROFF= nroff +NSLOOKUP= nslookup +OD= od +OPENSSL= openssl +PASTE= paste +PATCH= patch +PATHCHK= pathchk +PAX= pax +PERL= perl +PICO= pico +PR= pr +PRINTENV= printenv +PS= ps +PTAR= ptar +PTARDIFF= ptardiff +PTARGREP= ptargrep +PWD= pwd +PYDOC= pydoc +PYTHON= python +PYTHONW= pythonw +READLINK= readlink +RENICE= renice +RESET= reset +REV= rev +RI= ri +RM= rm +RMDIR= rmdir +RSYNC= rsync +RUBY= ruby +RVIM= rvim +SAY= say +SCP= scp +SCREEN= screen +SCRIPT= script +SDIFF= sdiff +SED= sed +SEQ= seq +SFTP= sftp +SH= sh +SHA1= sha1 +SHA= sha +SHAR= shar +SHASUM5_18= shasum5.18 +SHASUM= shasum +SIZE= size +SLEEP= sleep +SORT= sort +SSH= ssh +STAT= stat +STRIP= strip +STTY= stty +SUM= sum +SYNC= sync +TABS= tabs +TAIL= tail +TAR= tar +TEE= tee +TEST= test +TFTP= tftp +TIDY= tidy +TIME= time +TOP= top +TOUCH= touch +TPUT= tout +TPUT= tput +TR= tr +TROFF= troff +TRUE= true +TSET= tset +TSORT= tsort +UL= ul +UNAME= uname +UNCOMPRESS= uncompress +UNEXPAND= unexpand +UNIFDEF= unifdef +UNIFDEFALL= unifdefall +UNIQ= uniq +UNITS= units +UNLINK= unlink +UNZIP= unzip +UNZIPSFX= unzipsfx +UPTIME= uptime +UUDECODE= uudecode +UUENCODE= uuencode +UUIDGEN= uuidgen +VI= vi +VIEW= view +VIM= vim +VIMDIFF= vimdiff +W= w +WAIT4PATH= wait4path +WAIT= wait +WC= wc +WGET= wget +WHAT= what +WHATIS= whatis +WHICH= which +WHO= who +WHOAMI= whoami +WHOIS= whois +WRTIE= write +XAR= xar +XARGS= xargs +XATTR= xattr +XXD= xxd +YACC= yacc +YES= yes +ZCAT= zcat +ZCMP= zcmp +ZDIFF= zdiff +ZEGREP= zegrep +ZFGREP= zfgrep +ZFORCE= zforce +ZGREP= zgrep +ZIP= zip +ZIPCLOAK= zipcloak +ZIPGREp= zipgrep +ZIPINFo= zipinfo +ZIPNOTE= zipnote +ZIPSPLIT= zipsplit +ZLESS= zless +ZMORE= zmore +ZNEW= znew +ZPRINT= zprint +ZSH= zsh -${WINNERS} merlyn.c nextmove.c ttt_game.c: - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# Set X11_LIBDIR to the directory where the X11 library resides +# +#X11_LIBDIR= /usr/X11R6/lib +#X11_LIBDIR= /usr/X11/lib +X11_LIBDIR= /opt/X11/lib +# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# +#X11_INCDIR= /usr/X11R6/include +#X11_INCDIR= /usr/X11/include +X11_INCDIR= /opt/X11/include + +# Common C compiler warnings to silence +# +#CSILENCE= +CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-parentheses \ + -Wno-shift-op-parentheses -Wno-return-type + +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +CWARN= -Wall -Wextra ${CSILENCE} +#CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard +# +#CSTD= +#CSTD= -ansi +CSTD= -std=gnu90 + +# Compiler bit architecture +# +# Some entries require 32-bitness: +# ARCH= -m32 +# +# Some entries require 64-bitness: +# ARCH= -m64 +# +# By default we assume nothing: +# +ARCH= + +# Defines that are needed to compile +# +#CDEFINE= +CDEFINE= -DP=putchar -DN="P(10)" -DQ="P(34)" -DF="S(&X)" \ + -DJ=z[4] -DK=J[14] \ + -DH="w[]={146,7,292,73,448,56,84,273,325,297,108,324,22,40,48,40,17,325}" + +# Include files that are needed to compile +# +CINCLUDE= +#CINCLUDE= -include stdlib.h +#CINCLUDE= -include stdio.h +#CINCLUDE= -include stdlib.h -include stdio.h +#CINCLUDE= -I ${X11_INCDIR} +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 + +# Optimization +# +# Most compiles will safely use -O2. Some can use only -O1 or -O. +# A few compilers have broken optimizers or this entry make break +# under those buggy optimizers and thus you may not want anything. +# Reasonable compilers will allow for -O3. +# +#OPT= +#OPT= -O +#OPT= -O1 +#OPT= -O2 +OPT= -O3 + +# Default flags for ANSI C compilation +# +CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} + +# Libraries needed to build +# +LIBS= +#LIBS= -lm +#LIBS= -L ${X11_LIBDIR} -lX11 +#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL + +# C compiler to use +# +CC= cc +#CC=clang +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-comma -Wno-implicit-int-conversion -Wno-missing-prototypes \ + -Wno-missing-variable-declarations -Wno-pedantic \ + -Wno-poison-system-directories -Wno-shadow -Wno-strict-prototypes +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif + + +############################## +# Special flags for this entry +############################## +# +ENTRY= westley +PROG= ${ENTRY} +# +OBJ= ${PROG}.o +DATA= +TARGET= ${PROG} ttt +# +ALT_OBJ= +ALT_TARGET= + + +################# +# build the entry +################# +# +all: data ${TARGET} + @${TRUE} + +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto + +${PROG}: ${PROG}.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + +# alternative executable +# +alt: data ${ALT_TARGET} + @${TRUE} + +# the hint file gives nextmove.c as an example, provide a build rule for it +# +nextmove: nextmove.c ttt + ${CC} ${CFLAGS} -DP=putchar -DN="P(10)" -DQ="P(34)" -DF="S(&X)" \ + -DJ=z[4] -DK=J[14] \ + -DH="w[]={146,7,292,73,448,56,84,273,325,297,108,324,22,40,48,40,17,325}" \ + nextmove.c -o nextmove + +# the ttt script has been added by the judges to make playing westley easy +# ttt: ttt.sh - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi + ${RM} -f ttt + ${CP} -f ttt.sh ttt + ${CHMOD} +x ttt -merlyn: merlyn.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@ \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# used by the ttt shell script when playing westley +# +# The ttt script controls what goes into merlyn.c, and how it is used. +# The merlyn program and source represent the best (hopefully) state that +# the program has evolved into thus far. The ttt_game program and source +# represent the current state of the game. +# +merlyn: merlyn.c ttt + @${CC} ${CFLAGS} -DP=putchar -DN="P(10)" -DQ="P(34)" -DF="S(&X)" \ + -DJ=z[4] -DK=J[14] \ + -DH="w[]={146,7,292,73,448,56,84,273,325,297,108,324,22,40,48,40,17,325}" \ + merlyn.c -o merlyn +ttt_game: ttt_game.c ttt + @${CC} ${CFLAGS} -DP=putchar -DN="P(10)" -DQ="P(34)" -DF="S(&X)" \ + -DJ=z[4] -DK=J[14] \ + -DH="w[]={146,7,292,73,448,56,84,273,325,297,108,324,22,40,48,40,17,325}" \ + ttt_game.c -o ttt_game -ttt_game: ttt_game.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# The upper level makefile wants to make these source files if they don't +# already exist. +# +merlyn.c: westley.c + ${RM} -f merlyn.c + ${CP} -f westley.c merlyn.c + ${CHMOD} +w merlyn.c +nextmove.c: westley.c + ${RM} -f nextmove.c + ${CP} -f westley.c nextmove.c + ${CHMOD} +w nextmove.c +ttt_game.c: westley.c + ${RM} -f ttt_game.c + ${CP} -f westley.c ttt_game.c + ${CHMOD} +w ttt_game.c -nextmove: nextmove.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# data files +# +data: ${DATA} + @${TRUE} +# both all and alt +# +everything: all alt + + +############### +# utility rules +############### +# clean: - ${MAKE} -f ansi.mk clean - ${MAKE} -f common.mk clean -clobber: - ${MAKE} -f ansi.mk clobber - ${MAKE} -f common.mk clobber -nuke: clobber - ${MAKE} -f ansi.mk nuke - ${MAKE} -f common.mk nuke + ${RM} -f ${OBJ} ${ALT_OBJ} + ${RM} -f new_merlyn.c + @-if [ -f indent.c ]; then \ + echo ${RM} -f indent.c; \ + ${RM} -f indent.c; \ + fi + +clobber: clean + ${RM} -f ${TARGET} ${ALT_TARGET} + ${RM} -f merlyn merlyn.c nextmove.c nextmove.c + ${RM} -f ttt_game ttt_game.c ttt_old.c ttt_new.c nextmove + @-if [ -e sandwich ]; then \ + ${RM} -f sandwich; \ + echo 'ate sandwich'; \ + fi + install: - ${MAKE} -f ansi.mk install - ${MAKE} -f common.mk install + @echo "Dr. Spock says that is not logical!" + @${TRUE} + +# you may be able to misunderstand the source by reading indent.c +# +indent.c: ${PROG}.c + @if which "${GINDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${GINDENT} < $< > $@"; \ + ${GINDENT} < $< > $@; \ + elif which "${INDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${INDENT} < $< > $@"; \ + ${INDENT} < $< > $@; \ + else \ + echo "no intent tool found, ident $< yourself, sorry"; \ + echo "exit 1"; \ + exit 1; \ + fi + + +################## +# 133t hacker rulz +################## +# +love: + @echo 'not war?' + @${TRUE} + +haste: + $(MAKE) waste + @${TRUE} + +waste: + @echo 'haste' + @${TRUE} + +maker: + @echo 'Participate in a maker faire' + @${TRUE} + +easter_egg: + @echo "you expected to often misunderstand this $${RANDOM} magic" + @echo "chongo '' /\\oo/\\" + @echo "Eggy" + +sandwich: easter_egg + @if [ `id -u` -eq 0 ]; then \ + echo 'Okay.'; \ + echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ + else \ + echo 'What? Make it yourself.'; \ + exit 1; \ + fi + +# Understand the history of the Homebrew Computer Club +# as well as the West Coast Computer Faire and +# you might be confused different. :-) +# +supernova: sandwich + @-if [ -r .code_anal ]; then \ + ${RM} -f .code_anal_v6; \ + else \ + echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ + fi + @echo "A $@ helps ${MAKE} the elements that help form planets" + @${TRUE} + +deep_magic: supernova + @-if [ -r .code_anal ]; then \ + ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ + --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + fi + @${TRUE} + +magic: deep_magic + @-if [ -r .code_anal ]; then \ + ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "If you don't eat yer meat, you can't have any pudding!"; \ + echo "How can you have any pudding if you don't eat yer meat?!"; \ + fi + @${TRUE} + +# The IOCCC resident astronomer states +# +charon: magic + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore IAU, $@ is a planet" + +pluto: charon + ${MAKE} charon + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore, $@ is a planet" + @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" diff --git a/1991/westley/README.md b/1991/westley/README.md index b66225efd..9397b175a 100644 --- a/1991/westley/README.md +++ b/1991/westley/README.md @@ -1,17 +1,19 @@ -Grand Prize: +# Grand Prize: Brian Westley (Merlyn LeRoy on usenet) DigiBoard, Inc. 1026 Blair Ave. St. Paul, MN 55104 USA +## To build: -Judges' comments: + make all + +### To run Make and run as follows: - make westley - westley [move_location] | tee nextmove.c + ./westley [move_location] | tee nextmove.c where the 'move_location' is a digit from 1 to 9 that represents a move on a tic-tac-toe board: @@ -24,25 +26,26 @@ Judges' comments: next move, recompile nextmove.c and play it again: make nextmove - nextmove move_location | tee nextmove.c + ./nextmove move_location | tee nextmove.c + +## Judges' comments We have provided the shell script, ttt, to make it easier to play the game: make ttt - ttt [first_move] <- omit first arg to have it move first - ttt next_move + ./ttt [first_move] <- omit first arg to have it move first + ./ttt next_move The shell script determines when the game is over, and automatically replaces merlyn.c with an improved version after a loss. The ttt script has two other modes: - ttt quitgame <- cancel any game in process, revert to merlyn.c - ttt clobber <- remove all game files, revert to original source + ./ttt quitgame <- cancel any game in process, revert to merlyn.c + ./ttt clobber <- remove all game files, revert to original source Try not to cheat, the computer has not learned how to catch you doing it. - -Selected notes from the author: +## Author's comments A tic-tac-toe self-modifying program that "learns". This C program plays standard tic-tac-toe on itself. The code is written as a diff --git a/1991/westley/ttt.sh b/1991/westley/ttt.sh old mode 100644 new mode 100755 index b17d91fbf..f5a37adcb --- a/1991/westley/ttt.sh +++ b/1991/westley/ttt.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env sh # # play tic-tac-toe diff --git a/1992/Makefile b/1992/Makefile index 3e87e677d..1aee26224 100644 --- a/1992/Makefile +++ b/1992/Makefile @@ -50,7 +50,7 @@ # tool locations ################ # -SHELL= /bin/bash +SHELL= bash MAKE= make diff --git a/1992/adrian/.gitignore b/1992/adrian/.gitignore new file mode 100644 index 000000000..4450cfb5f --- /dev/null +++ b/1992/adrian/.gitignore @@ -0,0 +1,12 @@ +adbasename +adbasename.c +adecho +adecho.c +adgrep +adhead +adhead.c +adrian +adsleep +adsleep.c +adwc +adwc.c diff --git a/1992/adrian/Makefile b/1992/adrian/Makefile index 2eb115d13..32e4c820f 100644 --- a/1992/adrian/Makefile +++ b/1992/adrian/Makefile @@ -1,244 +1,621 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1992 makefile +# IOCCC 1992 winning entry - adrian + +################################################################################ # -# Copyright (c) 1992, Landon Curt Noll & Larry Bassel. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll and Larry Bassel. +# An Historical Makefile NOTE: +# +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. +# +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. +# +# Regarding individual entries: +# +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. +# +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. +# +# GitHub pull requests are welcome: +# +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judges to +# consider. +# +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: +# +# https://github.com/ioccc-src/winner +# +################################################################################ + +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# +# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# +# See: http://creativecommons.org/licenses/by-sa/3.0/ -SHELL=/bin/sh -CHMOD=chmod -CP=cp -RM=rm -SED=sed -LN=ln -UNIQ=uniq -CB=cb -GREP=grep -# set this to where your C Processor resides +############################# +# shell used by this Makefile +############################# # -# On some systems: -# CPP=/lib/cpp -# -CPP=/usr/ccs/lib/acpp +SHELL= bash -# flags for ansi compiles +####################### +# common tool locations +####################### # -# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, -# others such as gcc may want -ansi, others may want nothing -# at all. Adjust the CFLAGS line as needed. -# -# NOTE: Some compilers cannot optimize, or optimize some entries -# entries incorrectly. You might want need to turn on -O -# to see if your compiler can handle them. -# -#CFLAGS=-O -Xa -CFLAGS=-Xa -CC=cc +A2P= a2p +AR= ar +ASA= asa +AT= at +ATQ= atq +ATRM= atrm +AWK= awk +BANNER= banner +BASE64= base64 +BASENAME= basename +BATCH= batch +BC= bc +BINHEX= binhex +BISON= bison +BUNZIP2= bunzip2 +BZCAT= bzcat +BZCMP= bzcmp +BZDIFF= bzdiff +BZEGREP= bzegrep +BZFGREP= bzfgrep +BZGREP= bzgrep +BZIP2= bzip2 +BZLESS= bzless +BZMORE= bzmore +C2PH= c2ph +C89= c89 +C99= c99 +CAL= cal +CALC= calc +CAT= cat +CD= cd +CHFLAGS= chflags +CHGRP= chgrp +CHMOD= chmod +CKSUM= cksum +CLANG= clang +CLANG_PLUSPLUS= clang++ +CLEAR= clear +CMP= cmp +COL= col +COLLDEF= colldef +COLRM= colrm +COLUMN= column +COMPRESS= compress +CP= cp +CPIO= cpio +CPP= cpp +CRC32= crc32 +CSH= csh +CSPLIT= csplit +CURL= curl +CUT= cut +C_PLUSPLUS= c++ +C_PLUSPLUS_FILT= c++filt +DATE= date +DC= dc +DD= dd +DF= df +DIFF3= diff3 +DIFF= diff +DIG= dig +DIRNAME= dirname +ED= ed +EGREP= egrep +ENV= env +EQN= eqn +ETAGS= etags +EXPECT= expect +EXPR= expr +FALSE= false +FGREP= fgrep +FILE= file +FIND2PERL= find2perl +FIND= find +FLEX= flex +FLEX_PLUSPLUS= flex++ +FMT= fmt +FOLD= fold +FS_USAGE= fs_usage +FUNZIP= funzip +FUSER= fuser +GCC= gcc +GDIFFMK= gdiffmk +GENCAT= gencat +GENSTRINGS= genstrings +GETOPT= getopt +GETOPTS= getopts +GINDENT= gindent +GNUMAKE= gnumake +GREP= grep +GROFF= groff +GROFFER= groffer +GROG= grog +GROPS= grops +GROTTY= grotty +GUNZIP= gunzip +GVIM= gvim +GZCAT= gzcat +GZEXE= gzexe +GZIP_PROG= gzip +G_PLUSPLUS= g++ +H2PH= h2ph +H2XS= h2xs +HASH= hash +HEAD= head +HOSTNAME_PROG= hostname +ICONV= iconv +ID= id +INDENT= indent +INFO= info +JOT= jot +KILL= kill +KSH= ksh +LAST= last +LD= ld +LESSECHO= lessecho +LEX= len +LINK= link +LN= ln +LS= ls +M4= m4 +MAKE= make +MAN= man +MKDIR= mkdir +MKFIFO= mkfifo +MKTEMP= mktemp +MV= mv +NANO= nano +NASM= nasm +NEQN= neqn +NICE= nice +NL= nl +NM= nm +NOHUP= nohup +NROFF= nroff +NSLOOKUP= nslookup +OD= od +OPENSSL= openssl +PASTE= paste +PATCH= patch +PATHCHK= pathchk +PAX= pax +PERL= perl +PICO= pico +PR= pr +PRINTENV= printenv +PS= ps +PTAR= ptar +PTARDIFF= ptardiff +PTARGREP= ptargrep +PWD= pwd +PYDOC= pydoc +PYTHON= python +PYTHONW= pythonw +READLINK= readlink +RENICE= renice +RESET= reset +REV= rev +RI= ri +RM= rm +RMDIR= rmdir +RSYNC= rsync +RUBY= ruby +RVIM= rvim +SAY= say +SCP= scp +SCREEN= screen +SCRIPT= script +SDIFF= sdiff +SED= sed +SEQ= seq +SFTP= sftp +SH= sh +SHA1= sha1 +SHA= sha +SHAR= shar +SHASUM5_18= shasum5.18 +SHASUM= shasum +SIZE= size +SLEEP= sleep +SORT= sort +SSH= ssh +STAT= stat +STRIP= strip +STTY= stty +SUM= sum +SYNC= sync +TABS= tabs +TAIL= tail +TAR= tar +TEE= tee +TEST= test +TFTP= tftp +TIDY= tidy +TIME= time +TOP= top +TOUCH= touch +TPUT= tout +TPUT= tput +TR= tr +TROFF= troff +TRUE= true +TSET= tset +TSORT= tsort +UL= ul +UNAME= uname +UNCOMPRESS= uncompress +UNEXPAND= unexpand +UNIFDEF= unifdef +UNIFDEFALL= unifdefall +UNIQ= uniq +UNITS= units +UNLINK= unlink +UNZIP= unzip +UNZIPSFX= unzipsfx +UPTIME= uptime +UUDECODE= uudecode +UUENCODE= uuencode +UUIDGEN= uuidgen +VI= vi +VIEW= view +VIM= vim +VIMDIFF= vimdiff +W= w +WAIT4PATH= wait4path +WAIT= wait +WC= wc +WGET= wget +WHAT= what +WHATIS= whatis +WHICH= which +WHO= who +WHOAMI= whoami +WHOIS= whois +WRTIE= write +XAR= xar +XARGS= xargs +XATTR= xattr +XXD= xxd +YACC= yacc +YES= yes +ZCAT= zcat +ZCMP= zcmp +ZDIFF= zdiff +ZEGREP= zegrep +ZFGREP= zfgrep +ZFORCE= zforce +ZGREP= zgrep +ZIP= zip +ZIPCLOAK= zipcloak +ZIPGREp= zipgrep +ZIPINFo= zipinfo +ZIPNOTE= zipnote +ZIPSPLIT= zipsplit +ZLESS= zless +ZMORE= zmore +ZNEW= znew +ZPRINT= zprint +ZSH= zsh -# misc shell babble +# Set X11_LIBDIR to the directory where the X11 library resides # -NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/' -SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g' -CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*' +#X11_LIBDIR= /usr/X11R6/lib +#X11_LIBDIR= /usr/X11/lib +X11_LIBDIR= /opt/X11/lib -# winners that compile under ANSI C +# Set X11_INCLUDEDIR to the directory where the X11 include files reside # -WINNERS= adrian albert ant buzzard.1 buzzard.2 gson kivinen imc \ - lush marangon nathan vern westley -ALT_NAMES= adgrep am babble first ag whereami +#X11_INCDIR= /usr/X11R6/include +#X11_INCDIR= /usr/X11/include +X11_INCDIR= /opt/X11/include -all: $(WINNERS) $(ALT_NAMES) +# Common C compiler warnings to silence +# +#CSILENCE= +CSILENCE= -Wno-bitwise-op-parentheses -Wno-comment -Wno-deprecated-declarations \ + -Wno-error -Wno-implicit-function-declaration -Wno-format-security \ + -Wno-logical-op-parentheses -Wno-macro-redefined -Wno-parentheses \ + -Wno-return-type -Wno-uninitialized -Wno-unused-value -Wno-unused-variable \ + -Wno-unused-but-set-variable -Wno-unsequenced -Wno-unused-parameter -adrian: adrian.c - $(CC) $(CFLAGS) adrian.c -o adrian - $(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c - $(SED) '1s/\..*\./. wc ./' adrian.c > ad.temp +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +#CWARN= -Wall -Wextra ${CSILENCE} +CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard +# +#CSTD= +#CSTD= -ansi +CSTD= -std=gnu90 + +# Compiler bit architecture +# +# Some entries require 32-bitness: +# ARCH= -m32 +# +# Some entries require 64-bitness: +# ARCH= -m64 +# +# By default we assume nothing: +# +ARCH= + +# Defines that are needed to compile +# +CDEFINE= +#CDEFINE= -DIOCCC + +# Include files that are needed to compile +# +CINCLUDE= +#CINCLUDE= -include stdlib.h +#CINCLUDE= -include stdio.h +#CINCLUDE= -include stdlib.h -include stdio.h +#CINCLUDE= -I ${X11_INCDIR} +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 + +# Optimization +# +# Most compiles will safely use -O2. Some can use only -O1 or -O. +# A few compilers have broken optimizers or this entry make break +# under those buggy optimizers and thus you may not want anything. +# Reasonable compilers will allow for -O3. +# +#OPT= +#OPT= -O +#OPT= -O1 +#OPT= -O2 +OPT= -O3 + +# Default flags for ANSI C compilation +# +CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} + +# Libraries needed to build +# +LIBS= +#LIBS= -lm +#LIBS= -L ${X11_LIBDIR} -lX11 +#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL + +# C compiler to use +# +CC= cc +#CC=clang +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-comma -Wno-float-conversion -Wno-missing-noreturn \ + -Wno-missing-prototypes -Wno-missing-variable-declarations -Wno-padded \ + -Wno-poison-system-directories -Wno-shadow -Wno-unreachable-code \ + -Wno-unused-macros +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif + + +############################## +# Special flags for this entry +############################## +# +ENTRY= adrian +PROG= ${ENTRY} +# +OBJ= ${PROG}.o +DATA= +TARGET= ${PROG} +# +ALT_OBJ= +ALT_TARGET= + + +################# +# build the entry +################# +# +all: data ${TARGET} + @${TRUE} + +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto + +${PROG}: ${PROG}.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + ${RM} -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c + ${SED} '1s/\..*\./. wc ./' adrian.c > ad.temp -./adrian ad.temp adwc.c - $(CC) -o adwc adwc.c - $(SED) '1s/\..*\./. basename ./' adrian.c > ad.temp + ${CC} ${CFLAGS} -o adwc adwc.c + ${SED} '1s/\..*\./. basename ./' adrian.c > ad.temp -./adrian ad.temp adbasename.c - $(CC) -o adbasename adbasename.c - $(SED) '1s/\..*\./. echo| ./' adrian.c > ad.temp + ${CC} ${CFLAGS} -o adbasename adbasename.c + ${SED} '1s/\..*\./. echo| ./' adrian.c > ad.temp -./adrian ad.temp adecho.c - $(CC) -o adecho adecho.c - $(SED) '1s/\..*\./. head; ./' adrian.c > ad.temp + ${CC} ${CFLAGS} -o adecho adecho.c + ${SED} '1s/\..*\./. head; ./' adrian.c > ad.temp -./adrian ad.temp adhead.c - $(CC) -o adhead adhead.c - $(SED) '1s/\..*\./. sleep ./' adrian.c > ad.temp + ${CC} ${CFLAGS} -o adhead adhead.c + ${SED} '1s/\..*\./. sleep ./' adrian.c > ad.temp -./adrian ad.temp adsleep.c - $(CC) -o adsleep adsleep.c - $(RM) -f ad.temp + ${CC} ${CFLAGS} -o adsleep adsleep.c + ${RM} -f ad.temp -# NOTE: this is the original source that won +adgrep: ${PROG} + ${RM} -f $@ + ${LN} $< $@ + +# alternative executable # -adrian.orig: adrian.orig.c - $(CC) $(CFLAGS) adrian.orig.c -o adrian.orig +alt: data ${ALT_TARGET} + @${TRUE} -albert: albert.c - $(CC) $(CFLAGS) albert.c -o albert - -# NOTE: this is the original source that won +# data files # -albert.orig: albert.orig.c - $(CC) $(CFLAGS) albert.orig.c -o albert.orig +data: ${DATA} + @${TRUE} -ant: ant.c - $(CC) $(CFLAGS) ant.c -o ant - -buzzard.1: buzzard.1.c - $(CC) $(CFLAGS) buzzard.1.c -o buzzard.1 - -babble.cppcb: buzzard.1.c - $(NOINCLUDE) buzzard.1.c | \ - $(CPP) $(CPPFLAGS) | \ - $(CPPCLEAN) | \ - $(CB) $(CBFLAGS) | \ - $(UNIQ) | \ - $(SPACECLEAN) > babble.cppcb 2>&1 - -buzzard.2: buzzard.2.c - $(CC) $(CFLAGS) buzzard.2.c -o buzzard.2 - -# NOTE: this is the original source that won +# both all and alt # -buzzard.2.orig: buzzard.2.orig.c - $(CC) $(CFLAGS) buzzard.2.orig.c -o buzzard.2.orig +everything: all alt -gson: gson.c - $(CC) $(CFLAGS) gson.c -o gson -# NOTE: some systems may only need: +############### +# utility rules +############### # -# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -# -kivinen: kivinen.c - $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -lsocket -lresolv -lnsl - -# NOTE: this is the original program that won -# -# NOTE: some systems may only need: -# -# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -# -kivinen.orig: kivinen.orig.c - $(CC) $(CFLAGS) kivinen.orig.c -o kivinen.orig -lX11 \ - -lsocket -lresolv -lnsl - -imc: imc.c - $(CC) $(CFLAGS) imc.c -o imc - -# NOTE: this is the original program that won -# -imc.orig: imc.orig.c - $(CC) $(CFLAGS) imc.orig.c -o imc.orig - -lush: lush.c - $(CC) $(CFLAGS) lush.c -o lush - -lush.again: lush.c - $(CC) $(CFLAGS) lush.c -o lush.again - $(RM) -f lush.again - -# NOTE: this is the original program that won -# -lush.orig: lush.orig.c - $(CC) $(CFLAGS) lush.orig.c -o lush.orig - -# NOTE: some systems may need: -# -# $(CC) $(CFLAGS) marangon.c -o marangon -lcurses -ltermcap -# -marangon: marangon.c - $(CC) $(CFLAGS) marangon.c -o marangon -lcurses - -# NOTE: this is the original program that won -# -# NOTE: some systems may need: -# -# $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses -ltermcap -# -marangon.orig: marangon.orig.c - $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses - -nathan: nathan.c - $(CC) $(CFLAGS) nathan.c -o nathan - -# NOTE: this is the original program that won -# -nathan.orig: nathan.orig.c - $(CC) $(CFLAGS) nathan.orig.c -o nathan.orig - -vern: vern.tmp.c - $(CC) $(CFLAGS) vern.tmp.c -o vern - -vern.tmp.c: vern.c - $(RM) -f vern.tmp.c - $(SED) vern.tmp.c - -# NOTE: this is the original program that won -# -vern.orig: vern.orig.tmp.c - $(CC) $(CFLAGS) vern.orig.tmp.c -o vern.orig - -vern.orig.tmp.c: vern.orig.c - $(RM) -f vern.orig.tmp.c - $(SED) vern.orig.tmp.c - -westley: westley.c - $(CC) $(CFLAGS) westley.c -o westley - -# alternate names for selected entries -# -adgrep: adrian - $(RM) -f adgrep - $(LN) adrian adgrep -am: ant - $(RM) -f am - $(LN) ant am -babble: buzzard.1 - $(RM) -f babble - $(LN) buzzard.1 babble -first: buzzard.2 - $(RM) -f first - $(LN) buzzard.2 first -ag: gson - $(RM) -f ag - $(LN) gson ag -whereami: westley - $(RM) -f whereami - $(LN) westley whereami - clean: - $(RM) -f *.o a.out core - $(RM) -f vern.tmp.c lush.again babble.cppcb vern.orig.tmp.c - $(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c + ${RM} -f ${OBJ} ${ALT_OBJ} + @-if [ -f indent.c ]; then \ + echo ${RM} -f indent.c; \ + ${RM} -f indent.c; \ + fi clobber: clean - $(RM) -f $(WINNERS) a.out - $(RM) -f $(ALT_NAMES) - $(RM) -f adwc adbasename adecho adhead adsleep - $(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig - $(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig + ${RM} -f ${TARGET} ${ALT_TARGET} + @-if [ -e sandwich ]; then \ + ${RM} -f sandwich; \ + echo 'ate sandwich'; \ + fi -am_clobber: clean am - $(RM) -f am.safe - $(CP) am am.safe - $(RM) -f $(WINNERS) a.out - $(RM) -f $(ALT_NAMES) - $(RM) -f adwc adbasename adecho adhead adsleep - $(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig - $(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig - $(CP) am.safe am - $(RM) -f am.safe +install: + @echo "Dr. Spock says that is not logical!" + @${TRUE} -nuke: clobber - @true +# you may be able to misunderstand the source by reading indent.c +# +indent.c: ${PROG}.c + @if which "${GINDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${GINDENT} < $< > $@"; \ + ${GINDENT} < $< > $@; \ + elif which "${INDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${INDENT} < $< > $@"; \ + ${INDENT} < $< > $@; \ + else \ + echo "no intent tool found, ident $< yourself, sorry"; \ + echo "exit 1"; \ + exit 1; \ + fi -install: all - cat $(WINNERS) > /dev/null + +################## +# 133t hacker rulz +################## +# +love: + @echo 'not war?' + @${TRUE} + +haste: + $(MAKE) waste + @${TRUE} + +waste: + @echo 'haste' + @${TRUE} + +maker: + @echo 'Participate in a maker faire' + @${TRUE} + +easter_egg: + @echo "you expected to often misunderstand this $${RANDOM} magic" + @echo "chongo '' /\\oo/\\" + @echo "Eggy" + +sandwich: easter_egg + @if [ `id -u` -eq 0 ]; then \ + echo 'Okay.'; \ + echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ + else \ + echo 'What? Make it yourself.'; \ + exit 1; \ + fi + +# Understand the history of the Homebrew Computer Club +# as well as the West Coast Computer Faire and +# you might be confused different. :-) +# +supernova: sandwich + @-if [ -r .code_anal ]; then \ + ${RM} -f .code_anal_v6; \ + else \ + echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ + fi + @echo "A $@ helps ${MAKE} the elements that help form planets" + @${TRUE} + +deep_magic: supernova + @-if [ -r .code_anal ]; then \ + ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ + --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + fi + @${TRUE} + +magic: deep_magic + @-if [ -r .code_anal ]; then \ + ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "If you don't eat yer meat, you can't have any pudding!"; \ + echo "How can you have any pudding if you don't eat yer meat?!"; \ + fi + @${TRUE} + +# The IOCCC resident astronomer states +# +charon: magic + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore IAU, $@ is a planet" + +pluto: charon + ${MAKE} charon + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore, $@ is a planet" + @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" diff --git a/1992/adrian/README.md b/1992/adrian/README.md index 56ac4acc4..e57b2691a 100644 --- a/1992/adrian/README.md +++ b/1992/adrian/README.md @@ -1,4 +1,4 @@ -Most Educational: +# Most Educational: Adrian Mariano University of Washington @@ -6,25 +6,26 @@ Most Educational: Mercer Island, WA 98040 USA +## To build: -Judges' comments: + make all - To build: - make adrian +### To run - Try: - adrian adrian.grep.try < adrian.hint - - For the slow minded, try: - adsleep 32767 + ./adrian adrian.grep.try < adrian.hint + + For the slow minded, try: + + ./adsleep 32767 + +## Judges' comments Once you get past the obfuscation, you have an opportunity to learn about regular expressions and state machines. NOTE: Some compilers have had trouble optimizing this entry. - -Selected notes from the author: +## Author's comments ADrian's GREP (adgrep) diff --git a/1992/adrian/adrian.orig.c b/1992/adrian/adrian.orig.c deleted file mode 100644 index 37ea85729..000000000 --- a/1992/adrian/adrian.orig.c +++ /dev/null @@ -1,113 +0,0 @@ -/* . wc . */ -#include/* Wht majr flwchrt? */ -#include/* That mjr flwchrt! */ -#define P 257 -#define G 17 -#define z 8 -#define v(jr) jr -int W ,head; -#define S(W,b,f) strncpy(W,b,f),W[f]=0\ - - -char *wcs=" \t\n"; -struct{ char X[z+1]; - char f ; - int e ; - struct{ char g[z+1]; - int b ; - } w[ G]; - } o[ P]; -int L=0,j= -28; - - -void E(int i, int m,char*c) -{ - for(; i<43; i+=3) - putc(i["}|uutsrq`_^bji`[Zkediml[PO]a_M__]ISOYIRGTNR"]+i-9,stderr); - fprintf(stderr,"(%d): %s\n" ,m,c); - exit(1); -} - - - -int N(int m, char *t) -{ - int i ; - if (strlen ( - t)>z) t[z ]=0; - for(i= 0; i< L ; i++) if( - !strcmp (o[ i] . X - , t))return i; - if( L== P) - E(0, m, t); - S (o[ L] . X , t - ,z); - head; W = .1* head; - o[L ].f = !( strchr( t,']' )== 0 ); - o[L ++ ] . e = 0; - return L -1 ; } - -#define v(x ) - -int A(char *R) -{ - int c=0, i; - while(* R) { - i = -1; - while(j){ - if( ++ i==o[ c].e ) return 0; - if(o[ - c] .w[i ] .g[0 ] - =='.' ||strchr (o[ c].w[i] .g ,* R)){ - c= - o[ c ] .w[i].b; break;/* -main(int sl,char *j[]){ - sleep (~~~~~~~~atoi(j[1])) ;/* . sl - sl s l . sl - l l ] - sl */ } - } - R++; - } - return o[ c].f; -} - - - main(int wc,char *V[]){char Y[999],*s;FILE*W;int m=0,echo,jr,q,wcl=0,wcw=0,wcc=0; - v(s = V[1]; if (*V=strrchr(s,'/'))s=*V+1; if(( !strncmp( s + (jr=strlen(s)) - - (q=strlen(V[2]) ),V[2],q))&&jr!=q) s[jr-q] = 0; puts(s); ) - int e,p,C,Q ,basename; - W= fopen(wc>= 2 ? V[1] : "adgrep.c","rt"); -echo| m^ e| 5| (int) .8| echo| -wc |C ==o[o[C] .e] . -e| e==+p,p; s[o[C] .e ] -; -while( fgets(Y,998,W)) { wcc += strlen(Y); m++; - if( s = strtok(Y,wcs)) wcw++; - else continue ; - C= - basename= j +j+*"* . basename" - +j+*"* r ] " + N(m,s) ; -while( s = strtok(0,wcs)) { - if( o[ C ] . e == - G) E(1 ,m,o[C] .X) ; - S(o[C - ] .w[o[C ] .e].g,s, z); - Q= C ; - if(! ( s =strtok ( 0 ,wcs )))wcw -- - ,E( 2 , m, o[C] - . w[ o[ Q ] .e] . g ); - e - = o[C ] .w[o[C ] .e++ ] .b= N(m,s) - ; wcw += 2; } - 0&& - W && wcl++ - < 10 && printf((W,Y)); } - if(j+28) { { - ; } printf("%7u%7u%7u\n", wcl , wcw , wcc); } - while( gets(Y) ) if(A(Y)) puts(Y); - W, jr; } - -O(int wc,char**V) { ---wc && (printf("%s ",*++V), main(wc,V), 1) || printf("\n"); } - diff --git a/1992/albert/.gitignore b/1992/albert/.gitignore new file mode 100644 index 000000000..f6de83234 --- /dev/null +++ b/1992/albert/.gitignore @@ -0,0 +1 @@ +albert diff --git a/1992/albert/Makefile b/1992/albert/Makefile index 2eb115d13..391713ff9 100644 --- a/1992/albert/Makefile +++ b/1992/albert/Makefile @@ -1,244 +1,593 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1992 makefile +# IOCCC 1992 winning entry - albert + +################################################################################ # -# Copyright (c) 1992, Landon Curt Noll & Larry Bassel. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll and Larry Bassel. - - -SHELL=/bin/sh -CHMOD=chmod -CP=cp -RM=rm -SED=sed -LN=ln -UNIQ=uniq -CB=cb -GREP=grep -# set this to where your C Processor resides +# An Historical Makefile NOTE: # -# On some systems: -# CPP=/lib/cpp +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. # -CPP=/usr/ccs/lib/acpp - -# flags for ansi compiles +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. # -# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, -# others such as gcc may want -ansi, others may want nothing -# at all. Adjust the CFLAGS line as needed. +# Regarding individual entries: # -# NOTE: Some compilers cannot optimize, or optimize some entries -# entries incorrectly. You might want need to turn on -O -# to see if your compiler can handle them. +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. # -#CFLAGS=-O -Xa -CFLAGS=-Xa -CC=cc - -# misc shell babble +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. # -NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/' -SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g' -CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*' - -# winners that compile under ANSI C +# GitHub pull requests are welcome: # -WINNERS= adrian albert ant buzzard.1 buzzard.2 gson kivinen imc \ - lush marangon nathan vern westley -ALT_NAMES= adgrep am babble first ag whereami - -all: $(WINNERS) $(ALT_NAMES) - -adrian: adrian.c - $(CC) $(CFLAGS) adrian.c -o adrian - $(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c - $(SED) '1s/\..*\./. wc ./' adrian.c > ad.temp - -./adrian ad.temp adwc.c - $(CC) -o adwc adwc.c - $(SED) '1s/\..*\./. basename ./' adrian.c > ad.temp - -./adrian ad.temp adbasename.c - $(CC) -o adbasename adbasename.c - $(SED) '1s/\..*\./. echo| ./' adrian.c > ad.temp - -./adrian ad.temp adecho.c - $(CC) -o adecho adecho.c - $(SED) '1s/\..*\./. head; ./' adrian.c > ad.temp - -./adrian ad.temp adhead.c - $(CC) -o adhead adhead.c - $(SED) '1s/\..*\./. sleep ./' adrian.c > ad.temp - -./adrian ad.temp adsleep.c - $(CC) -o adsleep adsleep.c - $(RM) -f ad.temp - -# NOTE: this is the original source that won +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judges to +# consider. # -adrian.orig: adrian.orig.c - $(CC) $(CFLAGS) adrian.orig.c -o adrian.orig - -albert: albert.c - $(CC) $(CFLAGS) albert.c -o albert - -# NOTE: this is the original source that won +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: # -albert.orig: albert.orig.c - $(CC) $(CFLAGS) albert.orig.c -o albert.orig - -ant: ant.c - $(CC) $(CFLAGS) ant.c -o ant - -buzzard.1: buzzard.1.c - $(CC) $(CFLAGS) buzzard.1.c -o buzzard.1 - -babble.cppcb: buzzard.1.c - $(NOINCLUDE) buzzard.1.c | \ - $(CPP) $(CPPFLAGS) | \ - $(CPPCLEAN) | \ - $(CB) $(CBFLAGS) | \ - $(UNIQ) | \ - $(SPACECLEAN) > babble.cppcb 2>&1 - -buzzard.2: buzzard.2.c - $(CC) $(CFLAGS) buzzard.2.c -o buzzard.2 - -# NOTE: this is the original source that won +# https://github.com/ioccc-src/winner # -buzzard.2.orig: buzzard.2.orig.c - $(CC) $(CFLAGS) buzzard.2.orig.c -o buzzard.2.orig +################################################################################ -gson: gson.c - $(CC) $(CFLAGS) gson.c -o gson - -# NOTE: some systems may only need: +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: # -# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 +# Creative Commons Attribution-ShareAlike 3.0 Unported License. # -kivinen: kivinen.c - $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -lsocket -lresolv -lnsl +# See: http://creativecommons.org/licenses/by-sa/3.0/ -# NOTE: this is the original program that won + +############################# +# shell used by this Makefile +############################# # -# NOTE: some systems may only need: +SHELL= bash + +####################### +# common tool locations +####################### # -# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 +A2P= a2p +AR= ar +ASA= asa +AT= at +ATQ= atq +ATRM= atrm +AWK= awk +BANNER= banner +BASE64= base64 +BASENAME= basename +BATCH= batch +BC= bc +BINHEX= binhex +BISON= bison +BUNZIP2= bunzip2 +BZCAT= bzcat +BZCMP= bzcmp +BZDIFF= bzdiff +BZEGREP= bzegrep +BZFGREP= bzfgrep +BZGREP= bzgrep +BZIP2= bzip2 +BZLESS= bzless +BZMORE= bzmore +C2PH= c2ph +C89= c89 +C99= c99 +CAL= cal +CALC= calc +CAT= cat +CD= cd +CHFLAGS= chflags +CHGRP= chgrp +CHMOD= chmod +CKSUM= cksum +CLANG= clang +CLANG_PLUSPLUS= clang++ +CLEAR= clear +CMP= cmp +COL= col +COLLDEF= colldef +COLRM= colrm +COLUMN= column +COMPRESS= compress +CP= cp +CPIO= cpio +CPP= cpp +CRC32= crc32 +CSH= csh +CSPLIT= csplit +CURL= curl +CUT= cut +C_PLUSPLUS= c++ +C_PLUSPLUS_FILT= c++filt +DATE= date +DC= dc +DD= dd +DF= df +DIFF3= diff3 +DIFF= diff +DIG= dig +DIRNAME= dirname +ED= ed +EGREP= egrep +ENV= env +EQN= eqn +ETAGS= etags +EXPECT= expect +EXPR= expr +FALSE= false +FGREP= fgrep +FILE= file +FIND2PERL= find2perl +FIND= find +FLEX= flex +FLEX_PLUSPLUS= flex++ +FMT= fmt +FOLD= fold +FS_USAGE= fs_usage +FUNZIP= funzip +FUSER= fuser +GCC= gcc +GDIFFMK= gdiffmk +GENCAT= gencat +GENSTRINGS= genstrings +GETOPT= getopt +GETOPTS= getopts +GINDENT= gindent +GNUMAKE= gnumake +GREP= grep +GROFF= groff +GROFFER= groffer +GROG= grog +GROPS= grops +GROTTY= grotty +GUNZIP= gunzip +GVIM= gvim +GZCAT= gzcat +GZEXE= gzexe +GZIP_PROG= gzip +G_PLUSPLUS= g++ +H2PH= h2ph +H2XS= h2xs +HASH= hash +HEAD= head +HOSTNAME_PROG= hostname +ICONV= iconv +ID= id +INDENT= indent +INFO= info +JOT= jot +KILL= kill +KSH= ksh +LAST= last +LD= ld +LESSECHO= lessecho +LEX= len +LINK= link +LN= ln +LS= ls +M4= m4 +MAKE= make +MAN= man +MKDIR= mkdir +MKFIFO= mkfifo +MKTEMP= mktemp +MV= mv +NANO= nano +NASM= nasm +NEQN= neqn +NICE= nice +NL= nl +NM= nm +NOHUP= nohup +NROFF= nroff +NSLOOKUP= nslookup +OD= od +OPENSSL= openssl +PASTE= paste +PATCH= patch +PATHCHK= pathchk +PAX= pax +PERL= perl +PICO= pico +PR= pr +PRINTENV= printenv +PS= ps +PTAR= ptar +PTARDIFF= ptardiff +PTARGREP= ptargrep +PWD= pwd +PYDOC= pydoc +PYTHON= python +PYTHONW= pythonw +READLINK= readlink +RENICE= renice +RESET= reset +REV= rev +RI= ri +RM= rm +RMDIR= rmdir +RSYNC= rsync +RUBY= ruby +RVIM= rvim +SAY= say +SCP= scp +SCREEN= screen +SCRIPT= script +SDIFF= sdiff +SED= sed +SEQ= seq +SFTP= sftp +SH= sh +SHA1= sha1 +SHA= sha +SHAR= shar +SHASUM5_18= shasum5.18 +SHASUM= shasum +SIZE= size +SLEEP= sleep +SORT= sort +SSH= ssh +STAT= stat +STRIP= strip +STTY= stty +SUM= sum +SYNC= sync +TABS= tabs +TAIL= tail +TAR= tar +TEE= tee +TEST= test +TFTP= tftp +TIDY= tidy +TIME= time +TOP= top +TOUCH= touch +TPUT= tout +TPUT= tput +TR= tr +TROFF= troff +TRUE= true +TSET= tset +TSORT= tsort +UL= ul +UNAME= uname +UNCOMPRESS= uncompress +UNEXPAND= unexpand +UNIFDEF= unifdef +UNIFDEFALL= unifdefall +UNIQ= uniq +UNITS= units +UNLINK= unlink +UNZIP= unzip +UNZIPSFX= unzipsfx +UPTIME= uptime +UUDECODE= uudecode +UUENCODE= uuencode +UUIDGEN= uuidgen +VI= vi +VIEW= view +VIM= vim +VIMDIFF= vimdiff +W= w +WAIT4PATH= wait4path +WAIT= wait +WC= wc +WGET= wget +WHAT= what +WHATIS= whatis +WHICH= which +WHO= who +WHOAMI= whoami +WHOIS= whois +WRTIE= write +XAR= xar +XARGS= xargs +XATTR= xattr +XXD= xxd +YACC= yacc +YES= yes +ZCAT= zcat +ZCMP= zcmp +ZDIFF= zdiff +ZEGREP= zegrep +ZFGREP= zfgrep +ZFORCE= zforce +ZGREP= zgrep +ZIP= zip +ZIPCLOAK= zipcloak +ZIPGREp= zipgrep +ZIPINFo= zipinfo +ZIPNOTE= zipnote +ZIPSPLIT= zipsplit +ZLESS= zless +ZMORE= zmore +ZNEW= znew +ZPRINT= zprint +ZSH= zsh + +# Set X11_LIBDIR to the directory where the X11 library resides # -kivinen.orig: kivinen.orig.c - $(CC) $(CFLAGS) kivinen.orig.c -o kivinen.orig -lX11 \ - -lsocket -lresolv -lnsl +#X11_LIBDIR= /usr/X11R6/lib +#X11_LIBDIR= /usr/X11/lib +X11_LIBDIR= /opt/X11/lib -imc: imc.c - $(CC) $(CFLAGS) imc.c -o imc - -# NOTE: this is the original program that won +# Set X11_INCLUDEDIR to the directory where the X11 include files reside # -imc.orig: imc.orig.c - $(CC) $(CFLAGS) imc.orig.c -o imc.orig +#X11_INCDIR= /usr/X11R6/include +#X11_INCDIR= /usr/X11/include +X11_INCDIR= /opt/X11/include -lush: lush.c - $(CC) $(CFLAGS) lush.c -o lush - -lush.again: lush.c - $(CC) $(CFLAGS) lush.c -o lush.again - $(RM) -f lush.again - -# NOTE: this is the original program that won +# Common C compiler warnings to silence # -lush.orig: lush.orig.c - $(CC) $(CFLAGS) lush.orig.c -o lush.orig +#CSILENCE= +CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-unused-parameter -# NOTE: some systems may need: +# Common C compiler warning flags # -# $(CC) $(CFLAGS) marangon.c -o marangon -lcurses -ltermcap +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +#CWARN= -Wall -Wextra ${CSILENCE} +CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # -marangon: marangon.c - $(CC) $(CFLAGS) marangon.c -o marangon -lcurses +#CSTD= +#CSTD= -ansi +CSTD= -std=gnu90 -# NOTE: this is the original program that won +# Compiler bit architecture # -# NOTE: some systems may need: +# Some entries require 32-bitness: +# ARCH= -m32 # -# $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses -ltermcap +# Some entries require 64-bitness: +# ARCH= -m64 # -marangon.orig: marangon.orig.c - $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses - -nathan: nathan.c - $(CC) $(CFLAGS) nathan.c -o nathan - -# NOTE: this is the original program that won +# By default we assume nothing: # -nathan.orig: nathan.orig.c - $(CC) $(CFLAGS) nathan.orig.c -o nathan.orig +ARCH= -vern: vern.tmp.c - $(CC) $(CFLAGS) vern.tmp.c -o vern - -vern.tmp.c: vern.c - $(RM) -f vern.tmp.c - $(SED) vern.tmp.c - -# NOTE: this is the original program that won +# Defines that are needed to compile # -vern.orig: vern.orig.tmp.c - $(CC) $(CFLAGS) vern.orig.tmp.c -o vern.orig +CDEFINE= +#CDEFINE= -DIOCCC -vern.orig.tmp.c: vern.orig.c - $(RM) -f vern.orig.tmp.c - $(SED) vern.orig.tmp.c - -westley: westley.c - $(CC) $(CFLAGS) westley.c -o westley - -# alternate names for selected entries +# Include files that are needed to compile # -adgrep: adrian - $(RM) -f adgrep - $(LN) adrian adgrep -am: ant - $(RM) -f am - $(LN) ant am -babble: buzzard.1 - $(RM) -f babble - $(LN) buzzard.1 babble -first: buzzard.2 - $(RM) -f first - $(LN) buzzard.2 first -ag: gson - $(RM) -f ag - $(LN) gson ag -whereami: westley - $(RM) -f whereami - $(LN) westley whereami +CINCLUDE= +#CINCLUDE= -include stdlib.h +#CINCLUDE= -include stdio.h +#CINCLUDE= -include stdlib.h -include stdio.h +#CINCLUDE= -I ${X11_INCDIR} +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 +# Optimization +# +# Most compiles will safely use -O2. Some can use only -O1 or -O. +# A few compilers have broken optimizers or this entry make break +# under those buggy optimizers and thus you may not want anything. +# Reasonable compilers will allow for -O3. +# +#OPT= +#OPT= -O +#OPT= -O1 +#OPT= -O2 +OPT= -O3 + +# Default flags for ANSI C compilation +# +CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} + +# Libraries needed to build +# +LIBS= +#LIBS= -lm +#LIBS= -L ${X11_LIBDIR} -lX11 +#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL + +# C compiler to use +# +CC= cc +#CC=clang +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-poison-system-directories -Wno-shorten-64-to-32 +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif + + +############################## +# Special flags for this entry +############################## +# +ENTRY= albert +PROG= ${ENTRY} +# +OBJ= ${PROG}.o +DATA= +TARGET= ${PROG} +# +ALT_OBJ= +ALT_TARGET= + + +################# +# build the entry +################# +# +all: data ${TARGET} + @${TRUE} + +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto + +${PROG}: ${PROG}.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + +# alternative executable +# +alt: data ${ALT_TARGET} + @${TRUE} + +# data files +# +data: ${DATA} + @${TRUE} + +# both all and alt +# +everything: all alt + + +############### +# utility rules +############### +# clean: - $(RM) -f *.o a.out core - $(RM) -f vern.tmp.c lush.again babble.cppcb vern.orig.tmp.c - $(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c + ${RM} -f ${OBJ} ${ALT_OBJ} + @-if [ -f indent.c ]; then \ + echo ${RM} -f indent.c; \ + ${RM} -f indent.c; \ + fi clobber: clean - $(RM) -f $(WINNERS) a.out - $(RM) -f $(ALT_NAMES) - $(RM) -f adwc adbasename adecho adhead adsleep - $(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig - $(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig + ${RM} -f ${TARGET} ${ALT_TARGET} + @-if [ -e sandwich ]; then \ + ${RM} -f sandwich; \ + echo 'ate sandwich'; \ + fi -am_clobber: clean am - $(RM) -f am.safe - $(CP) am am.safe - $(RM) -f $(WINNERS) a.out - $(RM) -f $(ALT_NAMES) - $(RM) -f adwc adbasename adecho adhead adsleep - $(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig - $(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig - $(CP) am.safe am - $(RM) -f am.safe +install: + @echo "Dr. Spock says that is not logical!" + @${TRUE} -nuke: clobber - @true +# you may be able to misunderstand the source by reading indent.c +# +indent.c: ${PROG}.c + @if which "${GINDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${GINDENT} < $< > $@"; \ + ${GINDENT} < $< > $@; \ + elif which "${INDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${INDENT} < $< > $@"; \ + ${INDENT} < $< > $@; \ + else \ + echo "no intent tool found, ident $< yourself, sorry"; \ + echo "exit 1"; \ + exit 1; \ + fi -install: all - cat $(WINNERS) > /dev/null + +################## +# 133t hacker rulz +################## +# +love: + @echo 'not war?' + @${TRUE} + +haste: + $(MAKE) waste + @${TRUE} + +waste: + @echo 'haste' + @${TRUE} + +maker: + @echo 'Participate in a maker faire' + @${TRUE} + +easter_egg: + @echo "you expected to often misunderstand this $${RANDOM} magic" + @echo "chongo '' /\\oo/\\" + @echo "Eggy" + +sandwich: easter_egg + @if [ `id -u` -eq 0 ]; then \ + echo 'Okay.'; \ + echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ + else \ + echo 'What? Make it yourself.'; \ + exit 1; \ + fi + +# Understand the history of the Homebrew Computer Club +# as well as the West Coast Computer Faire and +# you might be confused different. :-) +# +supernova: sandwich + @-if [ -r .code_anal ]; then \ + ${RM} -f .code_anal_v6; \ + else \ + echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ + fi + @echo "A $@ helps ${MAKE} the elements that help form planets" + @${TRUE} + +deep_magic: supernova + @-if [ -r .code_anal ]; then \ + ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ + --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + fi + @${TRUE} + +magic: deep_magic + @-if [ -r .code_anal ]; then \ + ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "If you don't eat yer meat, you can't have any pudding!"; \ + echo "How can you have any pudding if you don't eat yer meat?!"; \ + fi + @${TRUE} + +# The IOCCC resident astronomer states +# +charon: magic + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore IAU, $@ is a planet" + +pluto: charon + ${MAKE} charon + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore, $@ is a planet" + @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" diff --git a/1992/albert/README.md b/1992/albert/README.md index 68c0bd2ac..c78f16702 100644 --- a/1992/albert/README.md +++ b/1992/albert/README.md @@ -1,4 +1,4 @@ -Most Useful Program: +# Most Useful Program: Albert van der Horst S P&A R&C @@ -6,19 +6,21 @@ Most Useful Program: 3511 RA UTRECHT The Netherlands +## To build: -Judges' comments: + make all - For a canned example: - make albert - albert 1234567890123456789 +### To run + + ./albert 1234567890123456789 + +## Judges' comments We were impressed with the speed at which it was able to factor arbitrarily large numbers consisting of factors that fit into a long. - -Selected notes from the author: +## Author's comments The Obfuscated version of the Horst algorithm. diff --git a/1992/albert/albert.c b/1992/albert/albert.c index 05f4c8472..d40c72c2b 100644 --- a/1992/albert/albert.c +++ b/1992/albert/albert.c @@ -1,152 +1,34 @@ #include -#include -#include -#include -#define new(PP) (PP *) malloc(sizeof(PP)) -typedef struct q { - jmp_buf ppp; - long qq; - struct q *P; - struct q *p; -} -PP; -PP *P; -int aaaaaa=2; -int aaaaaaa=1; - -long qqq; - - -aaAaaa(aa,aaa) -char *aa; -char *aaa; +main(argc,argv) +int argc; +char **argv; { - char aaaa = 0; - if ((((( aaa ))))) - { - aaaa = *aa; - *aa=0; - aa+=strlen(aa+1); - P =new(PP); - P->P=P; - P->p=P; - } + long arg[100]; + int i,j; + int base = 10; + int start = 0; + int end= strlen(argv[1]); - if ((((( !setjmp(P->ppp) ))))) + + for (i=0;i 2 ) { - if ((((( !isdigit(*aa) ))))) - longjmp(P->ppp,aaaaaaa); - else { - P->p->P = new(PP); - P->p->P->P = P; - P->p->P->p = P->p; - P->p = P->p->P; + while ( arg[end-1] == 0 ) { + printf("%d\n",base); + end--; + } + while ( arg[start] == 0 ) start +=1; + base += 1; - P->qq = *aa--; - P = P->p; - aaAaaa(aa,0); + for (i=start+1;istart;j--) + if ( (arg[j]-=arg[j-1])<0 ) + { + arg[j]+=base; + arg[j-1] -= 1; + } } - } else { - if ( !aaaa&&!*aa ) - longjmp(P->p->ppp,aaaaaaa); - - if ((((( (P->qq=aaaa)<10 &&! - (isdigit(aaaa)) ||! - (isdigit(*aa) ||! - *aa )))))) - { - fprintf(stderr,"Usage %c%s \n", - (aaa[0]?7:aaaa),aaa+!aaa[0]); - exit(1); - } - } } - - -ppPppp(pp,ppp) -PP **pp, *ppp; -{ - int aa; - if ((((( !(aa=setjmp(ppp->ppp))||aa==aaaaaa ))))) - { - if ((((( *pp==ppp ))))) - { - ppp = (*pp)->p; - - if ( qqq<47 ) return; - if ( ppp->qq!=48 ) return; - - while ( ppp->qq==48 ) - { - printf("%ld\n",qqq-45); - *pp = ppp; - ppp = ppp->p; - } - qqq -= 1; - longjmp(ppp->ppp,aaaaaaa); - } else { - PP *p; - - ppPppp(pp,ppp->p); - for (p=ppp;p!=*pp;p=p->p) - { - int qq=4; - if ((((( qqq<47 && - (qq=0,p->qq+=p->p->qq-96)>=48-qqq || - qqq>46 && - (p->qq-=p->p->qq)<0 ))))) - { - p->qq += qqq+qq; - if ( p->p==P && qqq<=46 ) - { - P->p->P = new(PP); - P->p->P->P = P; - P->p->P->p = P->p; - *pp = P = P->p = P->p->P; - P->qq = 48; - } - - p->p->qq+=qq==0; - p->p->qq-=qq!=0; - } - else - { - p->qq += 48; - } - } - if ( ppp->P==P ) longjmp(ppp->ppp,aaaaaaa); - } - } - else - { - qqq += 1; - - while (48==P->qq ) - { - P->P->p = P->p; - P = P->p->P = P->P; - - } - - if ( ppp!=ppp->p->p || qqq<47 ) - longjmp(ppp->ppp,aaaaaa); - else - { - printf("At most one remains\n"); - exit(0); - } - } -} - - -main(aaa,aaaa) -int aaa; -char **aaaa; -{ - aaAaaa(aaa==aaaaaaa?aaaa[0]:aaaa[1],aaaa[0]); - qqq = 39; - ppPppp(&P,P->p); -} - - diff --git a/1992/albert/albert.fix.c b/1992/albert/albert.fix.c deleted file mode 100644 index d40c72c2b..000000000 --- a/1992/albert/albert.fix.c +++ /dev/null @@ -1,34 +0,0 @@ -#include - -main(argc,argv) -int argc; -char **argv; -{ - long arg[100]; - int i,j; - int base = 10; - int start = 0; - int end= strlen(argv[1]); - - - for (i=0;i 2 ) - { - while ( arg[end-1] == 0 ) { - printf("%d\n",base); - end--; - } - while ( arg[start] == 0 ) start +=1; - base += 1; - - for (i=start+1;istart;j--) - if ( (arg[j]-=arg[j-1])<0 ) - { - arg[j]+=base; - arg[j-1] -= 1; - } - } -} diff --git a/1992/albert/albert.orig.c b/1992/albert/albert.orig.c deleted file mode 100644 index 489f27cdf..000000000 --- a/1992/albert/albert.orig.c +++ /dev/null @@ -1,152 +0,0 @@ -#include -#include -#include -#include -#define new(PP) (PP *) malloc(sizeof(PP)) -typedef struct q { - jmp_buf ppp; - long qq; - struct q *P; - struct q *p; -} -PP; - -PP *P; -int aaaaaa=2; -int aaaaaaa=1; - -long qqq; - - -aaAaaa(aa,aaa) -char *aa; -char *aaa; -{ - char aaaa = 0; - if ((((( aaa ))))) - { - aaaa = *aa; - *aa=0; - aa+=strlen(aa+1); - P =new(PP); - P->P=P; - P->p=P; - } - - if ((((( !setjmp(P->ppp) ))))) - { - if ((((( !isdigit(*aa) ))))) - longjmp(P->ppp,aaaaaaa); - else { - P->p->P = new(PP); - P->p->P->P = P; - P->p->P->p = P->p; - P->p = P->p->P; - - P->qq = *aa--; - P = P->p; - aaAaaa(aa,0); - } - } else { - if ( !aaaa&&!*aa ) - longjmp(P->p->ppp,aaaaaaa); - - if ((((( (P->qq=aaaa)<10 &&! - (isdigit(aaaa)) ||! - (isdigit(*aa) ||! - *aa )))))) - { - fprintf(stderr,"Usage %c%s \n", - (aaa[0]?7:aaaa),aaa+!aaa[0]); - exit(1); - } - } -} - - -ppPppp(pp,ppp) -PP **pp, *ppp; -{ - int aa; - if ((((( !(aa=setjmp(ppp->ppp))||aa==aaaaaa ))))) - { - if ((((( *pp==ppp ))))) - { - ppp = (*pp)->p; - - if ( qqq<47 ) return; - if ( ppp->qq!=48 ) return; - - while ( ppp->qq==48 ) - { - printf("%ld\n",qqq-45); - *pp = ppp; - ppp = ppp->p; - } - qqq -= 1; - longjmp(ppp->ppp,aaaaaaa); - } else { - PP *p; - - ppPppp(pp,ppp->p); - for (p=ppp;p!=*pp;p=p->p) - { - int qq=4; - if ((((( qqq<47 && - (qq=0,p->qq+=p->p->qq-96)>=48-qqq || - qqq>46 && - (p->qq-=p->p->qq)<0 ))))) - { - p->qq += qqq+qq; - if ( p->p==P && qqq<=46 ) - { - P->p->P = new(PP); - P->p->P->P = P; - P->p->P->p = P->p; - *pp = P = P->p = P->p->P; - P->qq = 48; - } - - p->p->qq+=qq==0; - p->p->qq-=qq!=0; - } - else - { - p->qq += 48; - } - } - if ( ppp->P==P ) longjmp(ppp->ppp,aaaaaaa); - } - } - else - { - qqq += 1; - - while (48==P->qq ) - { - P->P->p = P->p; - P = P->p->P = P->P; - - } - - if (ppp!=ppp->p->p ) - longjmp(ppp->ppp,aaaaaa); - else - { - printf("At most one remains\n"); - exit(0); - } - } -} - - -main(aaa,aaaa) -int aaa; -char **aaaa; -{ - aaAaaa(aaa==aaaaaaa?aaaa[0]:aaaa[1],aaaa[0]); - qqq = 39; - ppPppp(&P,P->p); -} - - diff --git a/1992/ant/.gitignore b/1992/ant/.gitignore new file mode 100644 index 000000000..67f925559 --- /dev/null +++ b/1992/ant/.gitignore @@ -0,0 +1,3 @@ +am +am.safe +ant diff --git a/1992/ant/Makefile b/1992/ant/Makefile index 2eb115d13..395157b4e 100644 --- a/1992/ant/Makefile +++ b/1992/ant/Makefile @@ -1,244 +1,607 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1992 makefile +# IOCCC 1992 winning entry - ant + +################################################################################ # -# Copyright (c) 1992, Landon Curt Noll & Larry Bassel. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll and Larry Bassel. - - -SHELL=/bin/sh -CHMOD=chmod -CP=cp -RM=rm -SED=sed -LN=ln -UNIQ=uniq -CB=cb -GREP=grep -# set this to where your C Processor resides +# An Historical Makefile NOTE: # -# On some systems: -# CPP=/lib/cpp +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. # -CPP=/usr/ccs/lib/acpp - -# flags for ansi compiles +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. # -# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, -# others such as gcc may want -ansi, others may want nothing -# at all. Adjust the CFLAGS line as needed. +# Regarding individual entries: # -# NOTE: Some compilers cannot optimize, or optimize some entries -# entries incorrectly. You might want need to turn on -O -# to see if your compiler can handle them. +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. # -#CFLAGS=-O -Xa -CFLAGS=-Xa -CC=cc - -# misc shell babble +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. # -NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/' -SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g' -CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*' - -# winners that compile under ANSI C +# GitHub pull requests are welcome: # -WINNERS= adrian albert ant buzzard.1 buzzard.2 gson kivinen imc \ - lush marangon nathan vern westley -ALT_NAMES= adgrep am babble first ag whereami - -all: $(WINNERS) $(ALT_NAMES) - -adrian: adrian.c - $(CC) $(CFLAGS) adrian.c -o adrian - $(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c - $(SED) '1s/\..*\./. wc ./' adrian.c > ad.temp - -./adrian ad.temp adwc.c - $(CC) -o adwc adwc.c - $(SED) '1s/\..*\./. basename ./' adrian.c > ad.temp - -./adrian ad.temp adbasename.c - $(CC) -o adbasename adbasename.c - $(SED) '1s/\..*\./. echo| ./' adrian.c > ad.temp - -./adrian ad.temp adecho.c - $(CC) -o adecho adecho.c - $(SED) '1s/\..*\./. head; ./' adrian.c > ad.temp - -./adrian ad.temp adhead.c - $(CC) -o adhead adhead.c - $(SED) '1s/\..*\./. sleep ./' adrian.c > ad.temp - -./adrian ad.temp adsleep.c - $(CC) -o adsleep adsleep.c - $(RM) -f ad.temp - -# NOTE: this is the original source that won +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judges to +# consider. # -adrian.orig: adrian.orig.c - $(CC) $(CFLAGS) adrian.orig.c -o adrian.orig - -albert: albert.c - $(CC) $(CFLAGS) albert.c -o albert - -# NOTE: this is the original source that won +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: # -albert.orig: albert.orig.c - $(CC) $(CFLAGS) albert.orig.c -o albert.orig - -ant: ant.c - $(CC) $(CFLAGS) ant.c -o ant - -buzzard.1: buzzard.1.c - $(CC) $(CFLAGS) buzzard.1.c -o buzzard.1 - -babble.cppcb: buzzard.1.c - $(NOINCLUDE) buzzard.1.c | \ - $(CPP) $(CPPFLAGS) | \ - $(CPPCLEAN) | \ - $(CB) $(CBFLAGS) | \ - $(UNIQ) | \ - $(SPACECLEAN) > babble.cppcb 2>&1 - -buzzard.2: buzzard.2.c - $(CC) $(CFLAGS) buzzard.2.c -o buzzard.2 - -# NOTE: this is the original source that won +# https://github.com/ioccc-src/winner # -buzzard.2.orig: buzzard.2.orig.c - $(CC) $(CFLAGS) buzzard.2.orig.c -o buzzard.2.orig +################################################################################ -gson: gson.c - $(CC) $(CFLAGS) gson.c -o gson - -# NOTE: some systems may only need: +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: # -# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 +# Creative Commons Attribution-ShareAlike 3.0 Unported License. # -kivinen: kivinen.c - $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -lsocket -lresolv -lnsl +# See: http://creativecommons.org/licenses/by-sa/3.0/ -# NOTE: this is the original program that won + +############################# +# shell used by this Makefile +############################# # -# NOTE: some systems may only need: +SHELL= bash + +####################### +# common tool locations +####################### # -# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 +A2P= a2p +AR= ar +ASA= asa +AT= at +ATQ= atq +ATRM= atrm +AWK= awk +BANNER= banner +BASE64= base64 +BASENAME= basename +BATCH= batch +BC= bc +BINHEX= binhex +BISON= bison +BUNZIP2= bunzip2 +BZCAT= bzcat +BZCMP= bzcmp +BZDIFF= bzdiff +BZEGREP= bzegrep +BZFGREP= bzfgrep +BZGREP= bzgrep +BZIP2= bzip2 +BZLESS= bzless +BZMORE= bzmore +C2PH= c2ph +C89= c89 +C99= c99 +CAL= cal +CALC= calc +CAT= cat +CD= cd +CHFLAGS= chflags +CHGRP= chgrp +CHMOD= chmod +CKSUM= cksum +CLANG= clang +CLANG_PLUSPLUS= clang++ +CLEAR= clear +CMP= cmp +COL= col +COLLDEF= colldef +COLRM= colrm +COLUMN= column +COMPRESS= compress +CP= cp +CPIO= cpio +CPP= cpp +CRC32= crc32 +CSH= csh +CSPLIT= csplit +CURL= curl +CUT= cut +C_PLUSPLUS= c++ +C_PLUSPLUS_FILT= c++filt +DATE= date +DC= dc +DD= dd +DF= df +DIFF3= diff3 +DIFF= diff +DIG= dig +DIRNAME= dirname +ED= ed +EGREP= egrep +ENV= env +EQN= eqn +ETAGS= etags +EXPECT= expect +EXPR= expr +FALSE= false +FGREP= fgrep +FILE= file +FIND2PERL= find2perl +FIND= find +FLEX= flex +FLEX_PLUSPLUS= flex++ +FMT= fmt +FOLD= fold +FS_USAGE= fs_usage +FUNZIP= funzip +FUSER= fuser +GCC= gcc +GDIFFMK= gdiffmk +GENCAT= gencat +GENSTRINGS= genstrings +GETOPT= getopt +GETOPTS= getopts +GINDENT= gindent +GNUMAKE= gnumake +GREP= grep +GROFF= groff +GROFFER= groffer +GROG= grog +GROPS= grops +GROTTY= grotty +GUNZIP= gunzip +GVIM= gvim +GZCAT= gzcat +GZEXE= gzexe +GZIP_PROG= gzip +G_PLUSPLUS= g++ +H2PH= h2ph +H2XS= h2xs +HASH= hash +HEAD= head +HOSTNAME_PROG= hostname +ICONV= iconv +ID= id +INDENT= indent +INFO= info +JOT= jot +KILL= kill +KSH= ksh +LAST= last +LD= ld +LESSECHO= lessecho +LEX= len +LINK= link +LN= ln +LS= ls +M4= m4 +MAKE= make +MAN= man +MKDIR= mkdir +MKFIFO= mkfifo +MKTEMP= mktemp +MV= mv +NANO= nano +NASM= nasm +NEQN= neqn +NICE= nice +NL= nl +NM= nm +NOHUP= nohup +NROFF= nroff +NSLOOKUP= nslookup +OD= od +OPENSSL= openssl +PASTE= paste +PATCH= patch +PATHCHK= pathchk +PAX= pax +PERL= perl +PICO= pico +PR= pr +PRINTENV= printenv +PS= ps +PTAR= ptar +PTARDIFF= ptardiff +PTARGREP= ptargrep +PWD= pwd +PYDOC= pydoc +PYTHON= python +PYTHONW= pythonw +READLINK= readlink +RENICE= renice +RESET= reset +REV= rev +RI= ri +RM= rm +RMDIR= rmdir +RSYNC= rsync +RUBY= ruby +RVIM= rvim +SAY= say +SCP= scp +SCREEN= screen +SCRIPT= script +SDIFF= sdiff +SED= sed +SEQ= seq +SFTP= sftp +SH= sh +SHA1= sha1 +SHA= sha +SHAR= shar +SHASUM5_18= shasum5.18 +SHASUM= shasum +SIZE= size +SLEEP= sleep +SORT= sort +SSH= ssh +STAT= stat +STRIP= strip +STTY= stty +SUM= sum +SYNC= sync +TABS= tabs +TAIL= tail +TAR= tar +TEE= tee +TEST= test +TFTP= tftp +TIDY= tidy +TIME= time +TOP= top +TOUCH= touch +TPUT= tout +TPUT= tput +TR= tr +TROFF= troff +TRUE= true +TSET= tset +TSORT= tsort +UL= ul +UNAME= uname +UNCOMPRESS= uncompress +UNEXPAND= unexpand +UNIFDEF= unifdef +UNIFDEFALL= unifdefall +UNIQ= uniq +UNITS= units +UNLINK= unlink +UNZIP= unzip +UNZIPSFX= unzipsfx +UPTIME= uptime +UUDECODE= uudecode +UUENCODE= uuencode +UUIDGEN= uuidgen +VI= vi +VIEW= view +VIM= vim +VIMDIFF= vimdiff +W= w +WAIT4PATH= wait4path +WAIT= wait +WC= wc +WGET= wget +WHAT= what +WHATIS= whatis +WHICH= which +WHO= who +WHOAMI= whoami +WHOIS= whois +WRTIE= write +XAR= xar +XARGS= xargs +XATTR= xattr +XXD= xxd +YACC= yacc +YES= yes +ZCAT= zcat +ZCMP= zcmp +ZDIFF= zdiff +ZEGREP= zegrep +ZFGREP= zfgrep +ZFORCE= zforce +ZGREP= zgrep +ZIP= zip +ZIPCLOAK= zipcloak +ZIPGREp= zipgrep +ZIPINFo= zipinfo +ZIPNOTE= zipnote +ZIPSPLIT= zipsplit +ZLESS= zless +ZMORE= zmore +ZNEW= znew +ZPRINT= zprint +ZSH= zsh + +# Set X11_LIBDIR to the directory where the X11 library resides # -kivinen.orig: kivinen.orig.c - $(CC) $(CFLAGS) kivinen.orig.c -o kivinen.orig -lX11 \ - -lsocket -lresolv -lnsl +#X11_LIBDIR= /usr/X11R6/lib +#X11_LIBDIR= /usr/X11/lib +X11_LIBDIR= /opt/X11/lib -imc: imc.c - $(CC) $(CFLAGS) imc.c -o imc - -# NOTE: this is the original program that won +# Set X11_INCLUDEDIR to the directory where the X11 include files reside # -imc.orig: imc.orig.c - $(CC) $(CFLAGS) imc.orig.c -o imc.orig +#X11_INCDIR= /usr/X11R6/include +#X11_INCDIR= /usr/X11/include +X11_INCDIR= /opt/X11/include -lush: lush.c - $(CC) $(CFLAGS) lush.c -o lush - -lush.again: lush.c - $(CC) $(CFLAGS) lush.c -o lush.again - $(RM) -f lush.again - -# NOTE: this is the original program that won +# Common C compiler warnings to silence # -lush.orig: lush.orig.c - $(CC) $(CFLAGS) lush.orig.c -o lush.orig +#CSILENCE= +CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-unsequenced -# NOTE: some systems may need: +# Common C compiler warning flags # -# $(CC) $(CFLAGS) marangon.c -o marangon -lcurses -ltermcap +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +#CWARN= -Wall -Wextra ${CSILENCE} +CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # -marangon: marangon.c - $(CC) $(CFLAGS) marangon.c -o marangon -lcurses +#CSTD= +#CSTD= -ansi +CSTD= -std=gnu90 -# NOTE: this is the original program that won +# Compiler bit architecture # -# NOTE: some systems may need: +# Some entries require 32-bitness: +# ARCH= -m32 # -# $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses -ltermcap +# Some entries require 64-bitness: +# ARCH= -m64 # -marangon.orig: marangon.orig.c - $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses - -nathan: nathan.c - $(CC) $(CFLAGS) nathan.c -o nathan - -# NOTE: this is the original program that won +# By default we assume nothing: # -nathan.orig: nathan.orig.c - $(CC) $(CFLAGS) nathan.orig.c -o nathan.orig +ARCH= -vern: vern.tmp.c - $(CC) $(CFLAGS) vern.tmp.c -o vern - -vern.tmp.c: vern.c - $(RM) -f vern.tmp.c - $(SED) vern.tmp.c - -# NOTE: this is the original program that won +# Defines that are needed to compile # -vern.orig: vern.orig.tmp.c - $(CC) $(CFLAGS) vern.orig.tmp.c -o vern.orig +CDEFINE= +#CDEFINE= -DIOCCC -vern.orig.tmp.c: vern.orig.c - $(RM) -f vern.orig.tmp.c - $(SED) vern.orig.tmp.c - -westley: westley.c - $(CC) $(CFLAGS) westley.c -o westley - -# alternate names for selected entries +# Include files that are needed to compile # -adgrep: adrian - $(RM) -f adgrep - $(LN) adrian adgrep -am: ant - $(RM) -f am - $(LN) ant am -babble: buzzard.1 - $(RM) -f babble - $(LN) buzzard.1 babble -first: buzzard.2 - $(RM) -f first - $(LN) buzzard.2 first -ag: gson - $(RM) -f ag - $(LN) gson ag -whereami: westley - $(RM) -f whereami - $(LN) westley whereami +CINCLUDE= +#CINCLUDE= -include stdlib.h +#CINCLUDE= -include stdio.h +#CINCLUDE= -include stdlib.h -include stdio.h +#CINCLUDE= -I ${X11_INCDIR} +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 +# Optimization +# +# Most compiles will safely use -O2. Some can use only -O1 or -O. +# A few compilers have broken optimizers or this entry make break +# under those buggy optimizers and thus you may not want anything. +# Reasonable compilers will allow for -O3. +# +#OPT= +#OPT= -O +#OPT= -O1 +#OPT= -O2 +OPT= -O3 + +# Default flags for ANSI C compilation +# +CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} + +# Libraries needed to build +# +LIBS= +#LIBS= -lm +#LIBS= -L ${X11_LIBDIR} -lX11 +#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL + +# C compiler to use +# +CC= cc +#CC=clang +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-conditional-uninitialized -Wno-implicit-int-conversion \ + -Wno-missing-prototypes -Wno-missing-variable-declarations \ + -Wno-poison-system-directories -Wno-shadow -Wno-shorten-64-to-32 \ + -Wno-sign-conversion -Wno-strict-prototypes +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif + + +############################## +# Special flags for this entry +############################## +# +ENTRY= ant +PROG= ${ENTRY} +# +OBJ= ${PROG}.o +DATA= +TARGET= ${PROG} +# +ALT_OBJ= +ALT_TARGET= + + +################# +# build the entry +################# +# +all: data ${TARGET} + @${TRUE} + +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + am am_clobber \ + supernova deep_magic magic charon pluto + +${PROG}: ${PROG}.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + +am: ${PROG} + ${RM} -f $@ + ${LN} $< $@ + +# alternative executable +# +alt: data ${ALT_TARGET} + @${TRUE} + +# data files +# +data: ${DATA} + @${TRUE} + +# both all and alt +# +everything: all alt + + +############### +# utility rules +############### +# clean: - $(RM) -f *.o a.out core - $(RM) -f vern.tmp.c lush.again babble.cppcb vern.orig.tmp.c - $(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c + ${RM} -f ${OBJ} ${ALT_OBJ} + @-if [ -f indent.c ]; then \ + echo ${RM} -f indent.c; \ + ${RM} -f indent.c; \ + fi clobber: clean - $(RM) -f $(WINNERS) a.out - $(RM) -f $(ALT_NAMES) - $(RM) -f adwc adbasename adecho adhead adsleep - $(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig - $(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig + ${RM} -f ${TARGET} ${ALT_TARGET} + @-if [ -e sandwich ]; then \ + ${RM} -f sandwich; \ + echo 'ate sandwich'; \ + fi am_clobber: clean am - $(RM) -f am.safe - $(CP) am am.safe - $(RM) -f $(WINNERS) a.out - $(RM) -f $(ALT_NAMES) - $(RM) -f adwc adbasename adecho adhead adsleep - $(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig - $(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig - $(CP) am.safe am - $(RM) -f am.safe + ${RM} -f am.safe + ${CP} am am.safe + ${CP} am.safe am + ${RM} -f am.safe -nuke: clobber - @true +install: + @echo "Dr. Spock says that is not logical!" + @${TRUE} -install: all - cat $(WINNERS) > /dev/null +# you may be able to misunderstand the source by reading indent.c +# +indent.c: ${PROG}.c + @if which "${GINDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${GINDENT} < $< > $@"; \ + ${GINDENT} < $< > $@; \ + elif which "${INDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${INDENT} < $< > $@"; \ + ${INDENT} < $< > $@; \ + else \ + echo "no intent tool found, ident $< yourself, sorry"; \ + echo "exit 1"; \ + exit 1; \ + fi + + +################## +# 133t hacker rulz +################## +# +love: + @echo 'not war?' + @${TRUE} + +haste: + $(MAKE) waste + @${TRUE} + +waste: + @echo 'haste' + @${TRUE} + +maker: + @echo 'Participate in a maker faire' + @${TRUE} + +easter_egg: + @echo "you expected to often misunderstand this $${RANDOM} magic" + @echo "chongo '' /\\oo/\\" + @echo "Eggy" + +sandwich: easter_egg + @if [ `id -u` -eq 0 ]; then \ + echo 'Okay.'; \ + echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ + else \ + echo 'What? Make it yourself.'; \ + exit 1; \ + fi + +# Understand the history of the Homebrew Computer Club +# as well as the West Coast Computer Faire and +# you might be confused different. :-) +# +supernova: sandwich + @-if [ -r .code_anal ]; then \ + ${RM} -f .code_anal_v6; \ + else \ + echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ + fi + @echo "A $@ helps ${MAKE} the elements that help form planets" + @${TRUE} + +deep_magic: supernova + @-if [ -r .code_anal ]; then \ + ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ + --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + fi + @${TRUE} + +magic: deep_magic + @-if [ -r .code_anal ]; then \ + ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "If you don't eat yer meat, you can't have any pudding!"; \ + echo "How can you have any pudding if you don't eat yer meat?!"; \ + fi + @${TRUE} + +# The IOCCC resident astronomer states +# +charon: magic + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore IAU, $@ is a planet" + +pluto: charon + ${MAKE} charon + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore, $@ is a planet" + @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" diff --git a/1992/ant/README.md b/1992/ant/README.md index 9123d2b9f..51291de9f 100644 --- a/1992/ant/README.md +++ b/1992/ant/README.md @@ -9,16 +9,12 @@ ## To build: - make all - ### To run - ./am ant.test.mk - ## Judges' comments diff --git a/1992/buzzard.1/.gitignore b/1992/buzzard.1/.gitignore new file mode 100644 index 000000000..e5ab81324 --- /dev/null +++ b/1992/buzzard.1/.gitignore @@ -0,0 +1,4 @@ +babble +babble.cppcb +buzzard.1 +tmp diff --git a/1992/buzzard.1/Makefile b/1992/buzzard.1/Makefile index 2eb115d13..3a0072612 100644 --- a/1992/buzzard.1/Makefile +++ b/1992/buzzard.1/Makefile @@ -1,244 +1,629 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1992 makefile +# IOCCC 1992 winning entry - buzzard.1 + +################################################################################ # -# Copyright (c) 1992, Landon Curt Noll & Larry Bassel. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll and Larry Bassel. - - -SHELL=/bin/sh -CHMOD=chmod -CP=cp -RM=rm -SED=sed -LN=ln -UNIQ=uniq -CB=cb -GREP=grep -# set this to where your C Processor resides +# An Historical Makefile NOTE: # -# On some systems: -# CPP=/lib/cpp +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. # -CPP=/usr/ccs/lib/acpp - -# flags for ansi compiles +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. # -# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, -# others such as gcc may want -ansi, others may want nothing -# at all. Adjust the CFLAGS line as needed. +# Regarding individual entries: # -# NOTE: Some compilers cannot optimize, or optimize some entries -# entries incorrectly. You might want need to turn on -O -# to see if your compiler can handle them. +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. # -#CFLAGS=-O -Xa -CFLAGS=-Xa -CC=cc - -# misc shell babble +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. # -NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/' -SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g' -CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*' - -# winners that compile under ANSI C +# GitHub pull requests are welcome: # -WINNERS= adrian albert ant buzzard.1 buzzard.2 gson kivinen imc \ - lush marangon nathan vern westley -ALT_NAMES= adgrep am babble first ag whereami - -all: $(WINNERS) $(ALT_NAMES) - -adrian: adrian.c - $(CC) $(CFLAGS) adrian.c -o adrian - $(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c - $(SED) '1s/\..*\./. wc ./' adrian.c > ad.temp - -./adrian ad.temp adwc.c - $(CC) -o adwc adwc.c - $(SED) '1s/\..*\./. basename ./' adrian.c > ad.temp - -./adrian ad.temp adbasename.c - $(CC) -o adbasename adbasename.c - $(SED) '1s/\..*\./. echo| ./' adrian.c > ad.temp - -./adrian ad.temp adecho.c - $(CC) -o adecho adecho.c - $(SED) '1s/\..*\./. head; ./' adrian.c > ad.temp - -./adrian ad.temp adhead.c - $(CC) -o adhead adhead.c - $(SED) '1s/\..*\./. sleep ./' adrian.c > ad.temp - -./adrian ad.temp adsleep.c - $(CC) -o adsleep adsleep.c - $(RM) -f ad.temp - -# NOTE: this is the original source that won +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judges to +# consider. # -adrian.orig: adrian.orig.c - $(CC) $(CFLAGS) adrian.orig.c -o adrian.orig - -albert: albert.c - $(CC) $(CFLAGS) albert.c -o albert - -# NOTE: this is the original source that won +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: # -albert.orig: albert.orig.c - $(CC) $(CFLAGS) albert.orig.c -o albert.orig - -ant: ant.c - $(CC) $(CFLAGS) ant.c -o ant - -buzzard.1: buzzard.1.c - $(CC) $(CFLAGS) buzzard.1.c -o buzzard.1 - -babble.cppcb: buzzard.1.c - $(NOINCLUDE) buzzard.1.c | \ - $(CPP) $(CPPFLAGS) | \ - $(CPPCLEAN) | \ - $(CB) $(CBFLAGS) | \ - $(UNIQ) | \ - $(SPACECLEAN) > babble.cppcb 2>&1 - -buzzard.2: buzzard.2.c - $(CC) $(CFLAGS) buzzard.2.c -o buzzard.2 - -# NOTE: this is the original source that won +# https://github.com/ioccc-src/winner # -buzzard.2.orig: buzzard.2.orig.c - $(CC) $(CFLAGS) buzzard.2.orig.c -o buzzard.2.orig +################################################################################ -gson: gson.c - $(CC) $(CFLAGS) gson.c -o gson - -# NOTE: some systems may only need: +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: # -# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 +# Creative Commons Attribution-ShareAlike 3.0 Unported License. # -kivinen: kivinen.c - $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -lsocket -lresolv -lnsl +# See: http://creativecommons.org/licenses/by-sa/3.0/ -# NOTE: this is the original program that won + +############################# +# shell used by this Makefile +############################# # -# NOTE: some systems may only need: +SHELL= bash + +####################### +# common tool locations +####################### # -# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 +A2P= a2p +AR= ar +ASA= asa +AT= at +ATQ= atq +ATRM= atrm +AWK= awk +BANNER= banner +BASE64= base64 +BASENAME= basename +BATCH= batch +BC= bc +BINHEX= binhex +BISON= bison +BUNZIP2= bunzip2 +BZCAT= bzcat +BZCMP= bzcmp +BZDIFF= bzdiff +BZEGREP= bzegrep +BZFGREP= bzfgrep +BZGREP= bzgrep +BZIP2= bzip2 +BZLESS= bzless +BZMORE= bzmore +C2PH= c2ph +C89= c89 +C99= c99 +CAL= cal +CALC= calc +CAT= cat +CD= cd +CHFLAGS= chflags +CHGRP= chgrp +CHMOD= chmod +CKSUM= cksum +CLANG= clang +CLANG_PLUSPLUS= clang++ +CLEAR= clear +CMP= cmp +COL= col +COLLDEF= colldef +COLRM= colrm +COLUMN= column +COMPRESS= compress +CP= cp +CPIO= cpio +CPP= cpp +CRC32= crc32 +CSH= csh +CSPLIT= csplit +CURL= curl +CUT= cut +C_PLUSPLUS= c++ +C_PLUSPLUS_FILT= c++filt +DATE= date +DC= dc +DD= dd +DF= df +DIFF3= diff3 +DIFF= diff +DIG= dig +DIRNAME= dirname +ED= ed +EGREP= egrep +ENV= env +EQN= eqn +ETAGS= etags +EXPECT= expect +EXPR= expr +FALSE= false +FGREP= fgrep +FILE= file +FIND2PERL= find2perl +FIND= find +FLEX= flex +FLEX_PLUSPLUS= flex++ +FMT= fmt +FOLD= fold +FS_USAGE= fs_usage +FUNZIP= funzip +FUSER= fuser +GCC= gcc +GDIFFMK= gdiffmk +GENCAT= gencat +GENSTRINGS= genstrings +GETOPT= getopt +GETOPTS= getopts +GINDENT= gindent +GNUMAKE= gnumake +GREP= grep +GROFF= groff +GROFFER= groffer +GROG= grog +GROPS= grops +GROTTY= grotty +GUNZIP= gunzip +GVIM= gvim +GZCAT= gzcat +GZEXE= gzexe +GZIP_PROG= gzip +G_PLUSPLUS= g++ +H2PH= h2ph +H2XS= h2xs +HASH= hash +HEAD= head +HOSTNAME_PROG= hostname +ICONV= iconv +ID= id +INDENT= indent +INFO= info +JOT= jot +KILL= kill +KSH= ksh +LAST= last +LD= ld +LESSECHO= lessecho +LEX= len +LINK= link +LN= ln +LS= ls +M4= m4 +MAKE= make +MAN= man +MKDIR= mkdir +MKFIFO= mkfifo +MKTEMP= mktemp +MV= mv +NANO= nano +NASM= nasm +NEQN= neqn +NICE= nice +NL= nl +NM= nm +NOHUP= nohup +NROFF= nroff +NSLOOKUP= nslookup +OD= od +OPENSSL= openssl +PASTE= paste +PATCH= patch +PATHCHK= pathchk +PAX= pax +PERL= perl +PICO= pico +PR= pr +PRINTENV= printenv +PS= ps +PTAR= ptar +PTARDIFF= ptardiff +PTARGREP= ptargrep +PWD= pwd +PYDOC= pydoc +PYTHON= python +PYTHONW= pythonw +READLINK= readlink +RENICE= renice +RESET= reset +REV= rev +RI= ri +RM= rm +RMDIR= rmdir +RSYNC= rsync +RUBY= ruby +RVIM= rvim +SAY= say +SCP= scp +SCREEN= screen +SCRIPT= script +SDIFF= sdiff +SED= sed +SEQ= seq +SFTP= sftp +SH= sh +SHA1= sha1 +SHA= sha +SHAR= shar +SHASUM5_18= shasum5.18 +SHASUM= shasum +SIZE= size +SLEEP= sleep +SORT= sort +SSH= ssh +STAT= stat +STRIP= strip +STTY= stty +SUM= sum +SYNC= sync +TABS= tabs +TAIL= tail +TAR= tar +TEE= tee +TEST= test +TFTP= tftp +TIDY= tidy +TIME= time +TOP= top +TOUCH= touch +TPUT= tout +TPUT= tput +TR= tr +TROFF= troff +TRUE= true +TSET= tset +TSORT= tsort +UL= ul +UNAME= uname +UNCOMPRESS= uncompress +UNEXPAND= unexpand +UNIFDEF= unifdef +UNIFDEFALL= unifdefall +UNIQ= uniq +UNITS= units +UNLINK= unlink +UNZIP= unzip +UNZIPSFX= unzipsfx +UPTIME= uptime +UUDECODE= uudecode +UUENCODE= uuencode +UUIDGEN= uuidgen +VI= vi +VIEW= view +VIM= vim +VIMDIFF= vimdiff +W= w +WAIT4PATH= wait4path +WAIT= wait +WC= wc +WGET= wget +WHAT= what +WHATIS= whatis +WHICH= which +WHO= who +WHOAMI= whoami +WHOIS= whois +WRTIE= write +XAR= xar +XARGS= xargs +XATTR= xattr +XXD= xxd +YACC= yacc +YES= yes +ZCAT= zcat +ZCMP= zcmp +ZDIFF= zdiff +ZEGREP= zegrep +ZFGREP= zfgrep +ZFORCE= zforce +ZGREP= zgrep +ZIP= zip +ZIPCLOAK= zipcloak +ZIPGREp= zipgrep +ZIPINFo= zipinfo +ZIPNOTE= zipnote +ZIPSPLIT= zipsplit +ZLESS= zless +ZMORE= zmore +ZNEW= znew +ZPRINT= zprint +ZSH= zsh + +# Set X11_LIBDIR to the directory where the X11 library resides # -kivinen.orig: kivinen.orig.c - $(CC) $(CFLAGS) kivinen.orig.c -o kivinen.orig -lX11 \ - -lsocket -lresolv -lnsl +#X11_LIBDIR= /usr/X11R6/lib +#X11_LIBDIR= /usr/X11/lib +X11_LIBDIR= /opt/X11/lib -imc: imc.c - $(CC) $(CFLAGS) imc.c -o imc - -# NOTE: this is the original program that won +# Set X11_INCLUDEDIR to the directory where the X11 include files reside # -imc.orig: imc.orig.c - $(CC) $(CFLAGS) imc.orig.c -o imc.orig +#X11_INCDIR= /usr/X11R6/include +#X11_INCDIR= /usr/X11/include +X11_INCDIR= /opt/X11/include -lush: lush.c - $(CC) $(CFLAGS) lush.c -o lush - -lush.again: lush.c - $(CC) $(CFLAGS) lush.c -o lush.again - $(RM) -f lush.again - -# NOTE: this is the original program that won +# Common C compiler warnings to silence # -lush.orig: lush.orig.c - $(CC) $(CFLAGS) lush.orig.c -o lush.orig +#CSILENCE= +CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-pedantic \ + -Wno-unused-parameter -# NOTE: some systems may need: +# Common C compiler warning flags # -# $(CC) $(CFLAGS) marangon.c -o marangon -lcurses -ltermcap +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +CWARN= -Wall -Wextra ${CSILENCE} +#CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # -marangon: marangon.c - $(CC) $(CFLAGS) marangon.c -o marangon -lcurses +#CSTD= +#CSTD= -ansi +CSTD= -std=gnu90 -# NOTE: this is the original program that won +# Compiler bit architecture # -# NOTE: some systems may need: +# Some entries require 32-bitness: +# ARCH= -m32 # -# $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses -ltermcap +# Some entries require 64-bitness: +# ARCH= -m64 # -marangon.orig: marangon.orig.c - $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses - -nathan: nathan.c - $(CC) $(CFLAGS) nathan.c -o nathan - -# NOTE: this is the original program that won +# By default we assume nothing: # -nathan.orig: nathan.orig.c - $(CC) $(CFLAGS) nathan.orig.c -o nathan.orig +ARCH= -vern: vern.tmp.c - $(CC) $(CFLAGS) vern.tmp.c -o vern - -vern.tmp.c: vern.c - $(RM) -f vern.tmp.c - $(SED) vern.tmp.c - -# NOTE: this is the original program that won +# Defines that are needed to compile # -vern.orig: vern.orig.tmp.c - $(CC) $(CFLAGS) vern.orig.tmp.c -o vern.orig +CDEFINE= +#CDEFINE= -DIOCCC -vern.orig.tmp.c: vern.orig.c - $(RM) -f vern.orig.tmp.c - $(SED) vern.orig.tmp.c - -westley: westley.c - $(CC) $(CFLAGS) westley.c -o westley - -# alternate names for selected entries +# Include files that are needed to compile # -adgrep: adrian - $(RM) -f adgrep - $(LN) adrian adgrep -am: ant - $(RM) -f am - $(LN) ant am -babble: buzzard.1 - $(RM) -f babble - $(LN) buzzard.1 babble -first: buzzard.2 - $(RM) -f first - $(LN) buzzard.2 first -ag: gson - $(RM) -f ag - $(LN) gson ag -whereami: westley - $(RM) -f whereami - $(LN) westley whereami +CINCLUDE= +#CINCLUDE= -include stdlib.h +#CINCLUDE= -include stdio.h +#CINCLUDE= -include stdlib.h -include stdio.h +#CINCLUDE= -I ${X11_INCDIR} +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 +# Optimization +# +# Most compiles will safely use -O2. Some can use only -O1 or -O. +# A few compilers have broken optimizers or this entry make break +# under those buggy optimizers and thus you may not want anything. +# Reasonable compilers will allow for -O3. +# +#OPT= +#OPT= -O +#OPT= -O1 +#OPT= -O2 +OPT= -O3 + +# Default flags for ANSI C compilation +# +CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} + +# Libraries needed to build +# +LIBS= +#LIBS= -lm +#LIBS= -L ${X11_LIBDIR} -lX11 +#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL + +# C compiler to use +# +CC= cc +#CC=clang +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-missing-variable-declarations -Wno-poison-system-directories \ + -Wno-unused-macros +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif + + +############################## +# Special flags for this entry +############################## +# +ENTRY= buzzard.1 +PROG= ${ENTRY} +# +OBJ= ${PROG}.o +DATA= +TARGET= ${PROG} +# +ALT_OBJ= +ALT_TARGET= + +NOINCLUDE= ${SED} -e 's/^.\([ ]*\)include/%include/' +SPACECLEAN= ${SED} -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g' +CPPCLEAN= ${GREP} -v '^. [0-9][0-9]*' + + +################# +# build the entry +################# +# +all: data ${TARGET} + @${TRUE} + +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto + +${PROG}: ${PROG}.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + +# alternative executable +# +alt: data ${ALT_TARGET} + @${TRUE} + +babble.cppcb: ${PROG}.c + ${RM} -f tmp + ${NOINCLUDE} ${PROG}.c | \ + ${CPP} ${CPPFLAGS} | \ + ${CPPCLEAN} | \ + ${UNIQ} | \ + ${SPACECLEAN} > tmp 2>&1 + @if which "${GINDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${GINDENT} < tmp > $@"; \ + ${GINDENT} < tmp > $@; \ + elif which "${INDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${INDENT} < $< > $@"; \ + ${INDENT} < tmp > $@; \ + else \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${MV} -f tmpbabble.cppcb $@"; \ + ${MV} -f tmp $@; \ + fi + ${RM} -f tmp + +babble: ${PROG} + ${RM} -f $@ + ${LN} $< $@ + +# data files +# +data: ${DATA} + @${TRUE} + +# both all and alt +# +everything: all alt + + +############### +# utility rules +############### +# clean: - $(RM) -f *.o a.out core - $(RM) -f vern.tmp.c lush.again babble.cppcb vern.orig.tmp.c - $(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c + ${RM} -f ${OBJ} ${ALT_OBJ} + @-if [ -f indent.c ]; then \ + echo ${RM} -f indent.c; \ + ${RM} -f indent.c; \ + fi clobber: clean - $(RM) -f $(WINNERS) a.out - $(RM) -f $(ALT_NAMES) - $(RM) -f adwc adbasename adecho adhead adsleep - $(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig - $(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig + ${RM} -f ${TARGET} ${ALT_TARGET} + ${RM} -f babble.cppcb babble + @-if [ -e sandwich ]; then \ + ${RM} -f sandwich; \ + echo 'ate sandwich'; \ + fi -am_clobber: clean am - $(RM) -f am.safe - $(CP) am am.safe - $(RM) -f $(WINNERS) a.out - $(RM) -f $(ALT_NAMES) - $(RM) -f adwc adbasename adecho adhead adsleep - $(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig - $(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig - $(CP) am.safe am - $(RM) -f am.safe +install: + @echo "Dr. Spock says that is not logical!" + @${TRUE} -nuke: clobber - @true +# you may be able to misunderstand the source by reading indent.c +# +indent.c: ${PROG}.c + @if which "${GINDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${GINDENT} < $< > $@"; \ + ${GINDENT} < $< > $@; \ + elif which "${INDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${INDENT} < $< > $@"; \ + ${INDENT} < $< > $@; \ + else \ + echo "no intent tool found, ident $< yourself, sorry"; \ + echo "exit 1"; \ + exit 1; \ + fi -install: all - cat $(WINNERS) > /dev/null + +################## +# 133t hacker rulz +################## +# +love: + @echo 'not war?' + @${TRUE} + +haste: + $(MAKE) waste + @${TRUE} + +waste: + @echo 'haste' + @${TRUE} + +maker: + @echo 'Participate in a maker faire' + @${TRUE} + +easter_egg: + @echo "you expected to often misunderstand this $${RANDOM} magic" + @echo "chongo '' /\\oo/\\" + @echo "Eggy" + +sandwich: easter_egg + @if [ `id -u` -eq 0 ]; then \ + echo 'Okay.'; \ + echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ + else \ + echo 'What? Make it yourself.'; \ + exit 1; \ + fi + +# Understand the history of the Homebrew Computer Club +# as well as the West Coast Computer Faire and +# you might be confused different. :-) +# +supernova: sandwich + @-if [ -r .code_anal ]; then \ + ${RM} -f .code_anal_v6; \ + else \ + echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ + fi + @echo "A $@ helps ${MAKE} the elements that help form planets" + @${TRUE} + +deep_magic: supernova + @-if [ -r .code_anal ]; then \ + ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ + --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + fi + @${TRUE} + +magic: deep_magic + @-if [ -r .code_anal ]; then \ + ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "If you don't eat yer meat, you can't have any pudding!"; \ + echo "How can you have any pudding if you don't eat yer meat?!"; \ + fi + @${TRUE} + +# The IOCCC resident astronomer states +# +charon: magic + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore IAU, $@ is a planet" + +pluto: charon + ${MAKE} charon + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore, $@ is a planet" + @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" diff --git a/1992/buzzard.1/README.md b/1992/buzzard.1/README.md index 89be6daf6..456f92f57 100644 --- a/1992/buzzard.1/README.md +++ b/1992/buzzard.1/README.md @@ -7,24 +7,26 @@ Most Obfuscated Algorithm: USA -Judges' comments: +## To build: + + make all + +### To run + + ./babble 0 10 + ./babble 56 720 + ./babble 1 521 + +## Judges' comments - To see clearly why this won an award: - make babble - - Try: - babble 0 10 - babble 56 720 - babble 1 521 - To see good C Preprocessor babble, try: + make babble.cppcb cat babble.cppcb Notice how many statements it takes to do anything useful? - -Selected notes from the author: +## Author's comments What you shouldn't think about babble: diff --git a/1992/buzzard.2/.gitignore b/1992/buzzard.2/.gitignore new file mode 100644 index 000000000..4daf52b2f --- /dev/null +++ b/1992/buzzard.2/.gitignore @@ -0,0 +1,2 @@ +buzzard.2 +first diff --git a/1992/buzzard.2/Makefile b/1992/buzzard.2/Makefile index 2eb115d13..a56f27b6b 100644 --- a/1992/buzzard.2/Makefile +++ b/1992/buzzard.2/Makefile @@ -1,244 +1,600 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1992 makefile +# IOCCC 1992 winning entry - buzzard.2 + +################################################################################ # -# Copyright (c) 1992, Landon Curt Noll & Larry Bassel. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll and Larry Bassel. - - -SHELL=/bin/sh -CHMOD=chmod -CP=cp -RM=rm -SED=sed -LN=ln -UNIQ=uniq -CB=cb -GREP=grep -# set this to where your C Processor resides +# An Historical Makefile NOTE: # -# On some systems: -# CPP=/lib/cpp +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. # -CPP=/usr/ccs/lib/acpp - -# flags for ansi compiles +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. # -# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, -# others such as gcc may want -ansi, others may want nothing -# at all. Adjust the CFLAGS line as needed. +# Regarding individual entries: # -# NOTE: Some compilers cannot optimize, or optimize some entries -# entries incorrectly. You might want need to turn on -O -# to see if your compiler can handle them. +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. # -#CFLAGS=-O -Xa -CFLAGS=-Xa -CC=cc - -# misc shell babble +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. # -NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/' -SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g' -CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*' - -# winners that compile under ANSI C +# GitHub pull requests are welcome: # -WINNERS= adrian albert ant buzzard.1 buzzard.2 gson kivinen imc \ - lush marangon nathan vern westley -ALT_NAMES= adgrep am babble first ag whereami - -all: $(WINNERS) $(ALT_NAMES) - -adrian: adrian.c - $(CC) $(CFLAGS) adrian.c -o adrian - $(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c - $(SED) '1s/\..*\./. wc ./' adrian.c > ad.temp - -./adrian ad.temp adwc.c - $(CC) -o adwc adwc.c - $(SED) '1s/\..*\./. basename ./' adrian.c > ad.temp - -./adrian ad.temp adbasename.c - $(CC) -o adbasename adbasename.c - $(SED) '1s/\..*\./. echo| ./' adrian.c > ad.temp - -./adrian ad.temp adecho.c - $(CC) -o adecho adecho.c - $(SED) '1s/\..*\./. head; ./' adrian.c > ad.temp - -./adrian ad.temp adhead.c - $(CC) -o adhead adhead.c - $(SED) '1s/\..*\./. sleep ./' adrian.c > ad.temp - -./adrian ad.temp adsleep.c - $(CC) -o adsleep adsleep.c - $(RM) -f ad.temp - -# NOTE: this is the original source that won +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judges to +# consider. # -adrian.orig: adrian.orig.c - $(CC) $(CFLAGS) adrian.orig.c -o adrian.orig - -albert: albert.c - $(CC) $(CFLAGS) albert.c -o albert - -# NOTE: this is the original source that won +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: # -albert.orig: albert.orig.c - $(CC) $(CFLAGS) albert.orig.c -o albert.orig - -ant: ant.c - $(CC) $(CFLAGS) ant.c -o ant - -buzzard.1: buzzard.1.c - $(CC) $(CFLAGS) buzzard.1.c -o buzzard.1 - -babble.cppcb: buzzard.1.c - $(NOINCLUDE) buzzard.1.c | \ - $(CPP) $(CPPFLAGS) | \ - $(CPPCLEAN) | \ - $(CB) $(CBFLAGS) | \ - $(UNIQ) | \ - $(SPACECLEAN) > babble.cppcb 2>&1 - -buzzard.2: buzzard.2.c - $(CC) $(CFLAGS) buzzard.2.c -o buzzard.2 - -# NOTE: this is the original source that won +# https://github.com/ioccc-src/winner # -buzzard.2.orig: buzzard.2.orig.c - $(CC) $(CFLAGS) buzzard.2.orig.c -o buzzard.2.orig +################################################################################ -gson: gson.c - $(CC) $(CFLAGS) gson.c -o gson - -# NOTE: some systems may only need: +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: # -# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 +# Creative Commons Attribution-ShareAlike 3.0 Unported License. # -kivinen: kivinen.c - $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -lsocket -lresolv -lnsl +# See: http://creativecommons.org/licenses/by-sa/3.0/ -# NOTE: this is the original program that won + +############################# +# shell used by this Makefile +############################# # -# NOTE: some systems may only need: +SHELL= bash + +####################### +# common tool locations +####################### # -# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 +A2P= a2p +AR= ar +ASA= asa +AT= at +ATQ= atq +ATRM= atrm +AWK= awk +BANNER= banner +BASE64= base64 +BASENAME= basename +BATCH= batch +BC= bc +BINHEX= binhex +BISON= bison +BUNZIP2= bunzip2 +BZCAT= bzcat +BZCMP= bzcmp +BZDIFF= bzdiff +BZEGREP= bzegrep +BZFGREP= bzfgrep +BZGREP= bzgrep +BZIP2= bzip2 +BZLESS= bzless +BZMORE= bzmore +C2PH= c2ph +C89= c89 +C99= c99 +CAL= cal +CALC= calc +CAT= cat +CD= cd +CHFLAGS= chflags +CHGRP= chgrp +CHMOD= chmod +CKSUM= cksum +CLANG= clang +CLANG_PLUSPLUS= clang++ +CLEAR= clear +CMP= cmp +COL= col +COLLDEF= colldef +COLRM= colrm +COLUMN= column +COMPRESS= compress +CP= cp +CPIO= cpio +CPP= cpp +CRC32= crc32 +CSH= csh +CSPLIT= csplit +CURL= curl +CUT= cut +C_PLUSPLUS= c++ +C_PLUSPLUS_FILT= c++filt +DATE= date +DC= dc +DD= dd +DF= df +DIFF3= diff3 +DIFF= diff +DIG= dig +DIRNAME= dirname +ED= ed +EGREP= egrep +ENV= env +EQN= eqn +ETAGS= etags +EXPECT= expect +EXPR= expr +FALSE= false +FGREP= fgrep +FILE= file +FIND2PERL= find2perl +FIND= find +FLEX= flex +FLEX_PLUSPLUS= flex++ +FMT= fmt +FOLD= fold +FS_USAGE= fs_usage +FUNZIP= funzip +FUSER= fuser +GCC= gcc +GDIFFMK= gdiffmk +GENCAT= gencat +GENSTRINGS= genstrings +GETOPT= getopt +GETOPTS= getopts +GINDENT= gindent +GNUMAKE= gnumake +GREP= grep +GROFF= groff +GROFFER= groffer +GROG= grog +GROPS= grops +GROTTY= grotty +GUNZIP= gunzip +GVIM= gvim +GZCAT= gzcat +GZEXE= gzexe +GZIP_PROG= gzip +G_PLUSPLUS= g++ +H2PH= h2ph +H2XS= h2xs +HASH= hash +HEAD= head +HOSTNAME_PROG= hostname +ICONV= iconv +ID= id +INDENT= indent +INFO= info +JOT= jot +KILL= kill +KSH= ksh +LAST= last +LD= ld +LESSECHO= lessecho +LEX= len +LINK= link +LN= ln +LS= ls +M4= m4 +MAKE= make +MAN= man +MKDIR= mkdir +MKFIFO= mkfifo +MKTEMP= mktemp +MV= mv +NANO= nano +NASM= nasm +NEQN= neqn +NICE= nice +NL= nl +NM= nm +NOHUP= nohup +NROFF= nroff +NSLOOKUP= nslookup +OD= od +OPENSSL= openssl +PASTE= paste +PATCH= patch +PATHCHK= pathchk +PAX= pax +PERL= perl +PICO= pico +PR= pr +PRINTENV= printenv +PS= ps +PTAR= ptar +PTARDIFF= ptardiff +PTARGREP= ptargrep +PWD= pwd +PYDOC= pydoc +PYTHON= python +PYTHONW= pythonw +READLINK= readlink +RENICE= renice +RESET= reset +REV= rev +RI= ri +RM= rm +RMDIR= rmdir +RSYNC= rsync +RUBY= ruby +RVIM= rvim +SAY= say +SCP= scp +SCREEN= screen +SCRIPT= script +SDIFF= sdiff +SED= sed +SEQ= seq +SFTP= sftp +SH= sh +SHA1= sha1 +SHA= sha +SHAR= shar +SHASUM5_18= shasum5.18 +SHASUM= shasum +SIZE= size +SLEEP= sleep +SORT= sort +SSH= ssh +STAT= stat +STRIP= strip +STTY= stty +SUM= sum +SYNC= sync +TABS= tabs +TAIL= tail +TAR= tar +TEE= tee +TEST= test +TFTP= tftp +TIDY= tidy +TIME= time +TOP= top +TOUCH= touch +TPUT= tout +TPUT= tput +TR= tr +TROFF= troff +TRUE= true +TSET= tset +TSORT= tsort +UL= ul +UNAME= uname +UNCOMPRESS= uncompress +UNEXPAND= unexpand +UNIFDEF= unifdef +UNIFDEFALL= unifdefall +UNIQ= uniq +UNITS= units +UNLINK= unlink +UNZIP= unzip +UNZIPSFX= unzipsfx +UPTIME= uptime +UUDECODE= uudecode +UUENCODE= uuencode +UUIDGEN= uuidgen +VI= vi +VIEW= view +VIM= vim +VIMDIFF= vimdiff +W= w +WAIT4PATH= wait4path +WAIT= wait +WC= wc +WGET= wget +WHAT= what +WHATIS= whatis +WHICH= which +WHO= who +WHOAMI= whoami +WHOIS= whois +WRTIE= write +XAR= xar +XARGS= xargs +XATTR= xattr +XXD= xxd +YACC= yacc +YES= yes +ZCAT= zcat +ZCMP= zcmp +ZDIFF= zdiff +ZEGREP= zegrep +ZFGREP= zfgrep +ZFORCE= zforce +ZGREP= zgrep +ZIP= zip +ZIPCLOAK= zipcloak +ZIPGREp= zipgrep +ZIPINFo= zipinfo +ZIPNOTE= zipnote +ZIPSPLIT= zipsplit +ZLESS= zless +ZMORE= zmore +ZNEW= znew +ZPRINT= zprint +ZSH= zsh + +# Set X11_LIBDIR to the directory where the X11 library resides # -kivinen.orig: kivinen.orig.c - $(CC) $(CFLAGS) kivinen.orig.c -o kivinen.orig -lX11 \ - -lsocket -lresolv -lnsl +#X11_LIBDIR= /usr/X11R6/lib +#X11_LIBDIR= /usr/X11/lib +X11_LIBDIR= /opt/X11/lib -imc: imc.c - $(CC) $(CFLAGS) imc.c -o imc - -# NOTE: this is the original program that won +# Set X11_INCLUDEDIR to the directory where the X11 include files reside # -imc.orig: imc.orig.c - $(CC) $(CFLAGS) imc.orig.c -o imc.orig +#X11_INCDIR= /usr/X11R6/include +#X11_INCDIR= /usr/X11/include +X11_INCDIR= /opt/X11/include -lush: lush.c - $(CC) $(CFLAGS) lush.c -o lush - -lush.again: lush.c - $(CC) $(CFLAGS) lush.c -o lush.again - $(RM) -f lush.again - -# NOTE: this is the original program that won +# Common C compiler warnings to silence # -lush.orig: lush.orig.c - $(CC) $(CFLAGS) lush.orig.c -o lush.orig +#CSILENCE= +CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-pedantic \ + -Wno-return-type -# NOTE: some systems may need: +# Common C compiler warning flags # -# $(CC) $(CFLAGS) marangon.c -o marangon -lcurses -ltermcap +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +#CWARN= -Wall -Wextra ${CSILENCE} +CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # -marangon: marangon.c - $(CC) $(CFLAGS) marangon.c -o marangon -lcurses +#CSTD= +#CSTD= -ansi +CSTD= -std=gnu90 -# NOTE: this is the original program that won +# Compiler bit architecture # -# NOTE: some systems may need: +# Some entries require 32-bitness: +# ARCH= -m32 # -# $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses -ltermcap +# Some entries require 64-bitness: +# ARCH= -m64 # -marangon.orig: marangon.orig.c - $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses - -nathan: nathan.c - $(CC) $(CFLAGS) nathan.c -o nathan - -# NOTE: this is the original program that won +# By default we assume nothing: # -nathan.orig: nathan.orig.c - $(CC) $(CFLAGS) nathan.orig.c -o nathan.orig +ARCH= -vern: vern.tmp.c - $(CC) $(CFLAGS) vern.tmp.c -o vern - -vern.tmp.c: vern.c - $(RM) -f vern.tmp.c - $(SED) vern.tmp.c - -# NOTE: this is the original program that won +# Defines that are needed to compile # -vern.orig: vern.orig.tmp.c - $(CC) $(CFLAGS) vern.orig.tmp.c -o vern.orig +CDEFINE= +#CDEFINE= -DIOCCC -vern.orig.tmp.c: vern.orig.c - $(RM) -f vern.orig.tmp.c - $(SED) vern.orig.tmp.c - -westley: westley.c - $(CC) $(CFLAGS) westley.c -o westley - -# alternate names for selected entries +# Include files that are needed to compile # -adgrep: adrian - $(RM) -f adgrep - $(LN) adrian adgrep -am: ant - $(RM) -f am - $(LN) ant am -babble: buzzard.1 - $(RM) -f babble - $(LN) buzzard.1 babble -first: buzzard.2 - $(RM) -f first - $(LN) buzzard.2 first -ag: gson - $(RM) -f ag - $(LN) gson ag -whereami: westley - $(RM) -f whereami - $(LN) westley whereami +CINCLUDE= +#CINCLUDE= -include stdlib.h +#CINCLUDE= -include stdio.h +#CINCLUDE= -include stdlib.h -include stdio.h +#CINCLUDE= -I ${X11_INCDIR} +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 +# Optimization +# +# Most compiles will safely use -O2. Some can use only -O1 or -O. +# A few compilers have broken optimizers or this entry make break +# under those buggy optimizers and thus you may not want anything. +# Reasonable compilers will allow for -O3. +# +#OPT= +#OPT= -O +#OPT= -O1 +#OPT= -O2 +OPT= -O3 + +# Default flags for ANSI C compilation +# +CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} + +# Libraries needed to build +# +LIBS= +#LIBS= -lm +#LIBS= -L ${X11_LIBDIR} -lX11 +#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL + +# C compiler to use +# +CC= cc +#CC=clang +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-comma -Wno-missing-prototypes -Wno-missing-variable-declarations \ + -Wno-poison-system-directories -Wno-strict-prototypes -Wno-unreachable-code +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif + + +############################## +# Special flags for this entry +############################## +# +ENTRY= buzzard.2 +PROG= ${ENTRY} +# +OBJ= ${PROG}.o +DATA= +TARGET= ${PROG} +# +ALT_OBJ= +ALT_TARGET= + + +################# +# build the entry +################# +# +all: data ${TARGET} + @${TRUE} + +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto + +${PROG}: ${PROG}.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + +first: ${PROG} + ${RM} -f $@ + ${LN} $< $@ + +# alternative executable +# +alt: data ${ALT_TARGET} + @${TRUE} + +# data files +# +data: ${DATA} + @${TRUE} + +# both all and alt +# +everything: all alt + + +############### +# utility rules +############### +# clean: - $(RM) -f *.o a.out core - $(RM) -f vern.tmp.c lush.again babble.cppcb vern.orig.tmp.c - $(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c + ${RM} -f ${OBJ} ${ALT_OBJ} + @-if [ -f indent.c ]; then \ + echo ${RM} -f indent.c; \ + ${RM} -f indent.c; \ + fi clobber: clean - $(RM) -f $(WINNERS) a.out - $(RM) -f $(ALT_NAMES) - $(RM) -f adwc adbasename adecho adhead adsleep - $(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig - $(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig + ${RM} -f ${TARGET} ${ALT_TARGET} + ${RM} -f first + @-if [ -e sandwich ]; then \ + ${RM} -f sandwich; \ + echo 'ate sandwich'; \ + fi -am_clobber: clean am - $(RM) -f am.safe - $(CP) am am.safe - $(RM) -f $(WINNERS) a.out - $(RM) -f $(ALT_NAMES) - $(RM) -f adwc adbasename adecho adhead adsleep - $(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig - $(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig - $(CP) am.safe am - $(RM) -f am.safe +install: + @echo "Dr. Spock says that is not logical!" + @${TRUE} -nuke: clobber - @true +# you may be able to misunderstand the source by reading indent.c +# +indent.c: ${PROG}.c + @if which "${GINDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${GINDENT} < $< > $@"; \ + ${GINDENT} < $< > $@; \ + elif which "${INDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${INDENT} < $< > $@"; \ + ${INDENT} < $< > $@; \ + else \ + echo "no intent tool found, ident $< yourself, sorry"; \ + echo "exit 1"; \ + exit 1; \ + fi -install: all - cat $(WINNERS) > /dev/null + +################## +# 133t hacker rulz +################## +# +love: + @echo 'not war?' + @${TRUE} + +haste: + $(MAKE) waste + @${TRUE} + +waste: + @echo 'haste' + @${TRUE} + +maker: + @echo 'Participate in a maker faire' + @${TRUE} + +easter_egg: + @echo "you expected to often misunderstand this $${RANDOM} magic" + @echo "chongo '' /\\oo/\\" + @echo "Eggy" + +sandwich: easter_egg + @if [ `id -u` -eq 0 ]; then \ + echo 'Okay.'; \ + echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ + else \ + echo 'What? Make it yourself.'; \ + exit 1; \ + fi + +# Understand the history of the Homebrew Computer Club +# as well as the West Coast Computer Faire and +# you might be confused different. :-) +# +supernova: sandwich + @-if [ -r .code_anal ]; then \ + ${RM} -f .code_anal_v6; \ + else \ + echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ + fi + @echo "A $@ helps ${MAKE} the elements that help form planets" + @${TRUE} + +deep_magic: supernova + @-if [ -r .code_anal ]; then \ + ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ + --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + fi + @${TRUE} + +magic: deep_magic + @-if [ -r .code_anal ]; then \ + ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "If you don't eat yer meat, you can't have any pudding!"; \ + echo "How can you have any pudding if you don't eat yer meat?!"; \ + fi + @${TRUE} + +# The IOCCC resident astronomer states +# +charon: magic + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore IAU, $@ is a planet" + +pluto: charon + ${MAKE} charon + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore, $@ is a planet" + @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" diff --git a/1992/buzzard.2/README.md b/1992/buzzard.2/README.md index b0fe22b04..8fb6cf9f3 100644 --- a/1992/buzzard.2/README.md +++ b/1992/buzzard.2/README.md @@ -1,4 +1,4 @@ -Best Language Tool: +# Best Language Tool: Sean Barrett Software Construction Company @@ -6,27 +6,37 @@ Best Language Tool: College Station, TX 77840 USA +## To build: -Judges' comments: + make all + +### To run First: - make first - - Second: - echo help | cat third help.th - | first - cat third demo5.th | first - - Third: - cat third help.th - | first - Wait until Ok is printed and the type: + make first + + Second: + + echo help | cat third help.th - | ./first + cat third demo5.th | ./first + + Third: + + cat third help.th - | ./first + + NOTE: Wait until Ok is printed and the type: 2 3 + . cr <-- yes you should really type the 2 letters: cr Forth: + Sorry, this is third! +## Judges' comments -Selected notes from the author: + Have fun! + +## Author's comments What it does: @@ -116,7 +126,7 @@ Selected notes from the author: it also obfuscates the code. (Unfortunately, the top of stack is a global variable and neither gcc nor most bundled compilers seem to register allocate it.) - + More significant are the design obfuscations. m[0] is the "dictionary pointer", used when compiling words, and m[1] is the return stack index. Both are used as integer offsets into diff --git a/1992/gson/.gitignore b/1992/gson/.gitignore new file mode 100644 index 000000000..0c62d5021 --- /dev/null +++ b/1992/gson/.gitignore @@ -0,0 +1,2 @@ +gson +og diff --git a/1992/gson/Makefile b/1992/gson/Makefile index 2eb115d13..794e49dbc 100644 --- a/1992/gson/Makefile +++ b/1992/gson/Makefile @@ -1,244 +1,603 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1992 makefile +# IOCCC 1992 winning entry - gson + +################################################################################ # -# Copyright (c) 1992, Landon Curt Noll & Larry Bassel. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll and Larry Bassel. - - -SHELL=/bin/sh -CHMOD=chmod -CP=cp -RM=rm -SED=sed -LN=ln -UNIQ=uniq -CB=cb -GREP=grep -# set this to where your C Processor resides +# An Historical Makefile NOTE: # -# On some systems: -# CPP=/lib/cpp +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. # -CPP=/usr/ccs/lib/acpp - -# flags for ansi compiles +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. # -# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, -# others such as gcc may want -ansi, others may want nothing -# at all. Adjust the CFLAGS line as needed. +# Regarding individual entries: # -# NOTE: Some compilers cannot optimize, or optimize some entries -# entries incorrectly. You might want need to turn on -O -# to see if your compiler can handle them. +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. # -#CFLAGS=-O -Xa -CFLAGS=-Xa -CC=cc - -# misc shell babble +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. # -NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/' -SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g' -CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*' - -# winners that compile under ANSI C +# GitHub pull requests are welcome: # -WINNERS= adrian albert ant buzzard.1 buzzard.2 gson kivinen imc \ - lush marangon nathan vern westley -ALT_NAMES= adgrep am babble first ag whereami - -all: $(WINNERS) $(ALT_NAMES) - -adrian: adrian.c - $(CC) $(CFLAGS) adrian.c -o adrian - $(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c - $(SED) '1s/\..*\./. wc ./' adrian.c > ad.temp - -./adrian ad.temp adwc.c - $(CC) -o adwc adwc.c - $(SED) '1s/\..*\./. basename ./' adrian.c > ad.temp - -./adrian ad.temp adbasename.c - $(CC) -o adbasename adbasename.c - $(SED) '1s/\..*\./. echo| ./' adrian.c > ad.temp - -./adrian ad.temp adecho.c - $(CC) -o adecho adecho.c - $(SED) '1s/\..*\./. head; ./' adrian.c > ad.temp - -./adrian ad.temp adhead.c - $(CC) -o adhead adhead.c - $(SED) '1s/\..*\./. sleep ./' adrian.c > ad.temp - -./adrian ad.temp adsleep.c - $(CC) -o adsleep adsleep.c - $(RM) -f ad.temp - -# NOTE: this is the original source that won +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judges to +# consider. # -adrian.orig: adrian.orig.c - $(CC) $(CFLAGS) adrian.orig.c -o adrian.orig - -albert: albert.c - $(CC) $(CFLAGS) albert.c -o albert - -# NOTE: this is the original source that won +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: # -albert.orig: albert.orig.c - $(CC) $(CFLAGS) albert.orig.c -o albert.orig - -ant: ant.c - $(CC) $(CFLAGS) ant.c -o ant - -buzzard.1: buzzard.1.c - $(CC) $(CFLAGS) buzzard.1.c -o buzzard.1 - -babble.cppcb: buzzard.1.c - $(NOINCLUDE) buzzard.1.c | \ - $(CPP) $(CPPFLAGS) | \ - $(CPPCLEAN) | \ - $(CB) $(CBFLAGS) | \ - $(UNIQ) | \ - $(SPACECLEAN) > babble.cppcb 2>&1 - -buzzard.2: buzzard.2.c - $(CC) $(CFLAGS) buzzard.2.c -o buzzard.2 - -# NOTE: this is the original source that won +# https://github.com/ioccc-src/winner # -buzzard.2.orig: buzzard.2.orig.c - $(CC) $(CFLAGS) buzzard.2.orig.c -o buzzard.2.orig +################################################################################ -gson: gson.c - $(CC) $(CFLAGS) gson.c -o gson - -# NOTE: some systems may only need: +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: # -# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 +# Creative Commons Attribution-ShareAlike 3.0 Unported License. # -kivinen: kivinen.c - $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -lsocket -lresolv -lnsl +# See: http://creativecommons.org/licenses/by-sa/3.0/ -# NOTE: this is the original program that won + +############################# +# shell used by this Makefile +############################# # -# NOTE: some systems may only need: +SHELL= bash + +####################### +# common tool locations +####################### # -# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 +A2P= a2p +AR= ar +ASA= asa +AT= at +ATQ= atq +ATRM= atrm +AWK= awk +BANNER= banner +BASE64= base64 +BASENAME= basename +BATCH= batch +BC= bc +BINHEX= binhex +BISON= bison +BUNZIP2= bunzip2 +BZCAT= bzcat +BZCMP= bzcmp +BZDIFF= bzdiff +BZEGREP= bzegrep +BZFGREP= bzfgrep +BZGREP= bzgrep +BZIP2= bzip2 +BZLESS= bzless +BZMORE= bzmore +C2PH= c2ph +C89= c89 +C99= c99 +CAL= cal +CALC= calc +CAT= cat +CD= cd +CHFLAGS= chflags +CHGRP= chgrp +CHMOD= chmod +CKSUM= cksum +CLANG= clang +CLANG_PLUSPLUS= clang++ +CLEAR= clear +CMP= cmp +COL= col +COLLDEF= colldef +COLRM= colrm +COLUMN= column +COMPRESS= compress +CP= cp +CPIO= cpio +CPP= cpp +CRC32= crc32 +CSH= csh +CSPLIT= csplit +CURL= curl +CUT= cut +C_PLUSPLUS= c++ +C_PLUSPLUS_FILT= c++filt +DATE= date +DC= dc +DD= dd +DF= df +DIFF3= diff3 +DIFF= diff +DIG= dig +DIRNAME= dirname +ED= ed +EGREP= egrep +ENV= env +EQN= eqn +ETAGS= etags +EXPECT= expect +EXPR= expr +FALSE= false +FGREP= fgrep +FILE= file +FIND2PERL= find2perl +FIND= find +FLEX= flex +FLEX_PLUSPLUS= flex++ +FMT= fmt +FOLD= fold +FS_USAGE= fs_usage +FUNZIP= funzip +FUSER= fuser +GCC= gcc +GDIFFMK= gdiffmk +GENCAT= gencat +GENSTRINGS= genstrings +GETOPT= getopt +GETOPTS= getopts +GINDENT= gindent +GNUMAKE= gnumake +GREP= grep +GROFF= groff +GROFFER= groffer +GROG= grog +GROPS= grops +GROTTY= grotty +GUNZIP= gunzip +GVIM= gvim +GZCAT= gzcat +GZEXE= gzexe +GZIP_PROG= gzip +G_PLUSPLUS= g++ +H2PH= h2ph +H2XS= h2xs +HASH= hash +HEAD= head +HOSTNAME_PROG= hostname +ICONV= iconv +ID= id +INDENT= indent +INFO= info +JOT= jot +KILL= kill +KSH= ksh +LAST= last +LD= ld +LESSECHO= lessecho +LEX= len +LINK= link +LN= ln +LS= ls +M4= m4 +MAKE= make +MAN= man +MKDIR= mkdir +MKFIFO= mkfifo +MKTEMP= mktemp +MV= mv +NANO= nano +NASM= nasm +NEQN= neqn +NICE= nice +NL= nl +NM= nm +NOHUP= nohup +NROFF= nroff +NSLOOKUP= nslookup +OD= od +OPENSSL= openssl +PASTE= paste +PATCH= patch +PATHCHK= pathchk +PAX= pax +PERL= perl +PICO= pico +PR= pr +PRINTENV= printenv +PS= ps +PTAR= ptar +PTARDIFF= ptardiff +PTARGREP= ptargrep +PWD= pwd +PYDOC= pydoc +PYTHON= python +PYTHONW= pythonw +READLINK= readlink +RENICE= renice +RESET= reset +REV= rev +RI= ri +RM= rm +RMDIR= rmdir +RSYNC= rsync +RUBY= ruby +RVIM= rvim +SAY= say +SCP= scp +SCREEN= screen +SCRIPT= script +SDIFF= sdiff +SED= sed +SEQ= seq +SFTP= sftp +SH= sh +SHA1= sha1 +SHA= sha +SHAR= shar +SHASUM5_18= shasum5.18 +SHASUM= shasum +SIZE= size +SLEEP= sleep +SORT= sort +SSH= ssh +STAT= stat +STRIP= strip +STTY= stty +SUM= sum +SYNC= sync +TABS= tabs +TAIL= tail +TAR= tar +TEE= tee +TEST= test +TFTP= tftp +TIDY= tidy +TIME= time +TOP= top +TOUCH= touch +TPUT= tout +TPUT= tput +TR= tr +TROFF= troff +TRUE= true +TSET= tset +TSORT= tsort +UL= ul +UNAME= uname +UNCOMPRESS= uncompress +UNEXPAND= unexpand +UNIFDEF= unifdef +UNIFDEFALL= unifdefall +UNIQ= uniq +UNITS= units +UNLINK= unlink +UNZIP= unzip +UNZIPSFX= unzipsfx +UPTIME= uptime +UUDECODE= uudecode +UUENCODE= uuencode +UUIDGEN= uuidgen +VI= vi +VIEW= view +VIM= vim +VIMDIFF= vimdiff +W= w +WAIT4PATH= wait4path +WAIT= wait +WC= wc +WGET= wget +WHAT= what +WHATIS= whatis +WHICH= which +WHO= who +WHOAMI= whoami +WHOIS= whois +WRTIE= write +XAR= xar +XARGS= xargs +XATTR= xattr +XXD= xxd +YACC= yacc +YES= yes +ZCAT= zcat +ZCMP= zcmp +ZDIFF= zdiff +ZEGREP= zegrep +ZFGREP= zfgrep +ZFORCE= zforce +ZGREP= zgrep +ZIP= zip +ZIPCLOAK= zipcloak +ZIPGREp= zipgrep +ZIPINFo= zipinfo +ZIPNOTE= zipnote +ZIPSPLIT= zipsplit +ZLESS= zless +ZMORE= zmore +ZNEW= znew +ZPRINT= zprint +ZSH= zsh + +# Set X11_LIBDIR to the directory where the X11 library resides # -kivinen.orig: kivinen.orig.c - $(CC) $(CFLAGS) kivinen.orig.c -o kivinen.orig -lX11 \ - -lsocket -lresolv -lnsl +#X11_LIBDIR= /usr/X11R6/lib +#X11_LIBDIR= /usr/X11/lib +X11_LIBDIR= /opt/X11/lib -imc: imc.c - $(CC) $(CFLAGS) imc.c -o imc - -# NOTE: this is the original program that won +# Set X11_INCLUDEDIR to the directory where the X11 include files reside # -imc.orig: imc.orig.c - $(CC) $(CFLAGS) imc.orig.c -o imc.orig +#X11_INCDIR= /usr/X11R6/include +#X11_INCDIR= /usr/X11/include +X11_INCDIR= /opt/X11/include -lush: lush.c - $(CC) $(CFLAGS) lush.c -o lush - -lush.again: lush.c - $(CC) $(CFLAGS) lush.c -o lush.again - $(RM) -f lush.again - -# NOTE: this is the original program that won +# Common C compiler warnings to silence # -lush.orig: lush.orig.c - $(CC) $(CFLAGS) lush.orig.c -o lush.orig +#CSILENCE= +CSILENCE= -Wno-bitwise-op-parentheses -Wno-char-subscripts \ + -Wno-deprecated-declarations -Wno-empty-body -Wno-error \ + -Wno-implicit-function-declaration -Wno-parentheses -Wno-pedantic \ + -Wno-return-type -Wno-unused-parameter -Wno-unused-value -# NOTE: some systems may need: +# Common C compiler warning flags # -# $(CC) $(CFLAGS) marangon.c -o marangon -lcurses -ltermcap +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +#CWARN= -Wall -Wextra ${CSILENCE} +CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # -marangon: marangon.c - $(CC) $(CFLAGS) marangon.c -o marangon -lcurses +#CSTD= +#CSTD= -ansi +CSTD= -std=gnu90 -# NOTE: this is the original program that won +# Compiler bit architecture # -# NOTE: some systems may need: +# Some entries require 32-bitness: +# ARCH= -m32 # -# $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses -ltermcap +# Some entries require 64-bitness: +# ARCH= -m64 # -marangon.orig: marangon.orig.c - $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses - -nathan: nathan.c - $(CC) $(CFLAGS) nathan.c -o nathan - -# NOTE: this is the original program that won +# By default we assume nothing: # -nathan.orig: nathan.orig.c - $(CC) $(CFLAGS) nathan.orig.c -o nathan.orig +ARCH= -vern: vern.tmp.c - $(CC) $(CFLAGS) vern.tmp.c -o vern - -vern.tmp.c: vern.c - $(RM) -f vern.tmp.c - $(SED) vern.tmp.c - -# NOTE: this is the original program that won +# Defines that are needed to compile # -vern.orig: vern.orig.tmp.c - $(CC) $(CFLAGS) vern.orig.tmp.c -o vern.orig +CDEFINE= +#CDEFINE= -DIOCCC -vern.orig.tmp.c: vern.orig.c - $(RM) -f vern.orig.tmp.c - $(SED) vern.orig.tmp.c - -westley: westley.c - $(CC) $(CFLAGS) westley.c -o westley - -# alternate names for selected entries +# Include files that are needed to compile # -adgrep: adrian - $(RM) -f adgrep - $(LN) adrian adgrep -am: ant - $(RM) -f am - $(LN) ant am -babble: buzzard.1 - $(RM) -f babble - $(LN) buzzard.1 babble -first: buzzard.2 - $(RM) -f first - $(LN) buzzard.2 first -ag: gson - $(RM) -f ag - $(LN) gson ag -whereami: westley - $(RM) -f whereami - $(LN) westley whereami +CINCLUDE= +#CINCLUDE= -include stdlib.h +#CINCLUDE= -include stdio.h +#CINCLUDE= -include stdlib.h -include stdio.h +#CINCLUDE= -I ${X11_INCDIR} +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 +# Optimization +# +# Most compiles will safely use -O2. Some can use only -O1 or -O. +# A few compilers have broken optimizers or this entry make break +# under those buggy optimizers and thus you may not want anything. +# Reasonable compilers will allow for -O3. +# +#OPT= +#OPT= -O +#OPT= -O1 +#OPT= -O2 +OPT= -O3 + +# Default flags for ANSI C compilation +# +CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} + +# Libraries needed to build +# +LIBS= +#LIBS= -lm +#LIBS= -L ${X11_LIBDIR} -lX11 +#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL + +# C compiler to use +# +CC= cc +#CC=clang +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-comma -Wno-implicit-int-conversion -Wno-missing-prototypes \ + -Wno-missing-variable-declarations -Wno-poison-system-directories \ + -Wno-shorten-64-to-32 -Wno-strict-prototypes +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif + + +############################## +# Special flags for this entry +############################## +# +ENTRY= gson +PROG= ${ENTRY} +# +OBJ= ${PROG}.o +DATA= +TARGET= ${PROG} og +# +ALT_OBJ= +ALT_TARGET= + + +################# +# build the entry +################# +# +all: data ${TARGET} + @${TRUE} + +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto + +${PROG}: ${PROG}.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + +og: ${PROG} + ${RM} -f $@ + ${LN} $< $@ + +# alternative executable +# +alt: data ${ALT_TARGET} + @${TRUE} + +# data files +# +data: ${DATA} + @${TRUE} + +# both all and alt +# +everything: all alt + + +############### +# utility rules +############### +# clean: - $(RM) -f *.o a.out core - $(RM) -f vern.tmp.c lush.again babble.cppcb vern.orig.tmp.c - $(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c + ${RM} -f ${OBJ} ${ALT_OBJ} + @-if [ -f indent.c ]; then \ + echo ${RM} -f indent.c; \ + ${RM} -f indent.c; \ + fi clobber: clean - $(RM) -f $(WINNERS) a.out - $(RM) -f $(ALT_NAMES) - $(RM) -f adwc adbasename adecho adhead adsleep - $(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig - $(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig + ${RM} -f ${TARGET} ${ALT_TARGET} + ${RM} -f og + @-if [ -e sandwich ]; then \ + ${RM} -f sandwich; \ + echo 'ate sandwich'; \ + fi -am_clobber: clean am - $(RM) -f am.safe - $(CP) am am.safe - $(RM) -f $(WINNERS) a.out - $(RM) -f $(ALT_NAMES) - $(RM) -f adwc adbasename adecho adhead adsleep - $(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig - $(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig - $(CP) am.safe am - $(RM) -f am.safe +install: + @echo "Dr. Spock says that is not logical!" + @${TRUE} -nuke: clobber - @true +# you may be able to misunderstand the source by reading indent.c +# +indent.c: ${PROG}.c + @if which "${GINDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${GINDENT} < $< > $@"; \ + ${GINDENT} < $< > $@; \ + elif which "${INDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${INDENT} < $< > $@"; \ + ${INDENT} < $< > $@; \ + else \ + echo "no intent tool found, ident $< yourself, sorry"; \ + echo "exit 1"; \ + exit 1; \ + fi -install: all - cat $(WINNERS) > /dev/null + +################## +# 133t hacker rulz +################## +# +love: + @echo 'not war?' + @${TRUE} + +haste: + $(MAKE) waste + @${TRUE} + +waste: + @echo 'haste' + @${TRUE} + +maker: + @echo 'Participate in a maker faire' + @${TRUE} + +easter_egg: + @echo "you expected to often misunderstand this $${RANDOM} magic" + @echo "chongo '' /\\oo/\\" + @echo "Eggy" + +sandwich: easter_egg + @if [ `id -u` -eq 0 ]; then \ + echo 'Okay.'; \ + echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ + else \ + echo 'What? Make it yourself.'; \ + exit 1; \ + fi + +# Understand the history of the Homebrew Computer Club +# as well as the West Coast Computer Faire and +# you might be confused different. :-) +# +supernova: sandwich + @-if [ -r .code_anal ]; then \ + ${RM} -f .code_anal_v6; \ + else \ + echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ + fi + @echo "A $@ helps ${MAKE} the elements that help form planets" + @${TRUE} + +deep_magic: supernova + @-if [ -r .code_anal ]; then \ + ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ + --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + fi + @${TRUE} + +magic: deep_magic + @-if [ -r .code_anal ]; then \ + ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "If you don't eat yer meat, you can't have any pudding!"; \ + echo "How can you have any pudding if you don't eat yer meat?!"; \ + fi + @${TRUE} + +# The IOCCC resident astronomer states +# +charon: magic + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore IAU, $@ is a planet" + +pluto: charon + ${MAKE} charon + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore, $@ is a planet" + @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" diff --git a/1992/gson/README.md b/1992/gson/README.md index 5063e39c8..5a4084b41 100644 --- a/1992/gson/README.md +++ b/1992/gson/README.md @@ -1,4 +1,4 @@ -Most Humorous Output: +# Most Humorous Output: Andreas Gustafsson Helsinki University of Technology @@ -6,36 +6,39 @@ Most Humorous Output: 00410 Helsinki FINLAND +## To build: -Judges' comments: + make all + +### To run + + ./og word word2 word3 < /path/to/dictionary + +## Judges' comment - To make: - make ag - Determine where your system dictionary is located. You may find it located in one of the following places: - /usr/dict/words - /usr/share/lib/spell/words - /usr/ucblib/dict/words - /dev/null <-- for machines with nothing to say + /usr/share/dict/words + /usr/share/lib/spell/words + /usr/ucblib/dict/words + /dev/null # <-- for machines with nothing to say Then using the proper dictionary: - ag free software foundation < /usr/dict/words - ag obfuscated c contest < /usr/dict/words - ag unix international < /usr/dict/words - ag george bush < /usr/dict/words - ag bill clinton < /usr/dict/words - ag ross perot < /usr/dict/words - ag paul e tsongas < /usr/dict/words + ./ag free software foundation < /usr/share/dict/words + ./ag obfuscated c contest < /usr/share/dict/words + ./ag unix international < /usr/share/dict/words + ./ag george bush < /usr/share/dict/words + ./ag bill clinton < /usr/share/dict/words + ./ag ross perot < /usr/share/dict/words + ./ag paul e tsongas < /usr/share/dict/words Recently some newspapers printed amusing anagrams of one of the names listed above. Run this program to find the anagrams they weren't allowed to print! - -Selected notes from the author: +## Author's comments The name of the game: diff --git a/1992/imc/.gitignore b/1992/imc/.gitignore new file mode 100644 index 000000000..eb3fb586e --- /dev/null +++ b/1992/imc/.gitignore @@ -0,0 +1 @@ +imc diff --git a/1992/imc/Makefile b/1992/imc/Makefile index 2eb115d13..050e42f06 100644 --- a/1992/imc/Makefile +++ b/1992/imc/Makefile @@ -1,244 +1,595 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1992 makefile +# IOCCC 1992 winning entry - imc + +################################################################################ # -# Copyright (c) 1992, Landon Curt Noll & Larry Bassel. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll and Larry Bassel. - - -SHELL=/bin/sh -CHMOD=chmod -CP=cp -RM=rm -SED=sed -LN=ln -UNIQ=uniq -CB=cb -GREP=grep -# set this to where your C Processor resides +# An Historical Makefile NOTE: # -# On some systems: -# CPP=/lib/cpp +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. # -CPP=/usr/ccs/lib/acpp - -# flags for ansi compiles +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. # -# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, -# others such as gcc may want -ansi, others may want nothing -# at all. Adjust the CFLAGS line as needed. +# Regarding individual entries: # -# NOTE: Some compilers cannot optimize, or optimize some entries -# entries incorrectly. You might want need to turn on -O -# to see if your compiler can handle them. +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. # -#CFLAGS=-O -Xa -CFLAGS=-Xa -CC=cc - -# misc shell babble +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. # -NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/' -SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g' -CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*' - -# winners that compile under ANSI C +# GitHub pull requests are welcome: # -WINNERS= adrian albert ant buzzard.1 buzzard.2 gson kivinen imc \ - lush marangon nathan vern westley -ALT_NAMES= adgrep am babble first ag whereami - -all: $(WINNERS) $(ALT_NAMES) - -adrian: adrian.c - $(CC) $(CFLAGS) adrian.c -o adrian - $(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c - $(SED) '1s/\..*\./. wc ./' adrian.c > ad.temp - -./adrian ad.temp adwc.c - $(CC) -o adwc adwc.c - $(SED) '1s/\..*\./. basename ./' adrian.c > ad.temp - -./adrian ad.temp adbasename.c - $(CC) -o adbasename adbasename.c - $(SED) '1s/\..*\./. echo| ./' adrian.c > ad.temp - -./adrian ad.temp adecho.c - $(CC) -o adecho adecho.c - $(SED) '1s/\..*\./. head; ./' adrian.c > ad.temp - -./adrian ad.temp adhead.c - $(CC) -o adhead adhead.c - $(SED) '1s/\..*\./. sleep ./' adrian.c > ad.temp - -./adrian ad.temp adsleep.c - $(CC) -o adsleep adsleep.c - $(RM) -f ad.temp - -# NOTE: this is the original source that won +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judges to +# consider. # -adrian.orig: adrian.orig.c - $(CC) $(CFLAGS) adrian.orig.c -o adrian.orig - -albert: albert.c - $(CC) $(CFLAGS) albert.c -o albert - -# NOTE: this is the original source that won +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: # -albert.orig: albert.orig.c - $(CC) $(CFLAGS) albert.orig.c -o albert.orig - -ant: ant.c - $(CC) $(CFLAGS) ant.c -o ant - -buzzard.1: buzzard.1.c - $(CC) $(CFLAGS) buzzard.1.c -o buzzard.1 - -babble.cppcb: buzzard.1.c - $(NOINCLUDE) buzzard.1.c | \ - $(CPP) $(CPPFLAGS) | \ - $(CPPCLEAN) | \ - $(CB) $(CBFLAGS) | \ - $(UNIQ) | \ - $(SPACECLEAN) > babble.cppcb 2>&1 - -buzzard.2: buzzard.2.c - $(CC) $(CFLAGS) buzzard.2.c -o buzzard.2 - -# NOTE: this is the original source that won +# https://github.com/ioccc-src/winner # -buzzard.2.orig: buzzard.2.orig.c - $(CC) $(CFLAGS) buzzard.2.orig.c -o buzzard.2.orig +################################################################################ -gson: gson.c - $(CC) $(CFLAGS) gson.c -o gson - -# NOTE: some systems may only need: +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: # -# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 +# Creative Commons Attribution-ShareAlike 3.0 Unported License. # -kivinen: kivinen.c - $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -lsocket -lresolv -lnsl +# See: http://creativecommons.org/licenses/by-sa/3.0/ -# NOTE: this is the original program that won + +############################# +# shell used by this Makefile +############################# # -# NOTE: some systems may only need: +SHELL= bash + +####################### +# common tool locations +####################### # -# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 +A2P= a2p +AR= ar +ASA= asa +AT= at +ATQ= atq +ATRM= atrm +AWK= awk +BANNER= banner +BASE64= base64 +BASENAME= basename +BATCH= batch +BC= bc +BINHEX= binhex +BISON= bison +BUNZIP2= bunzip2 +BZCAT= bzcat +BZCMP= bzcmp +BZDIFF= bzdiff +BZEGREP= bzegrep +BZFGREP= bzfgrep +BZGREP= bzgrep +BZIP2= bzip2 +BZLESS= bzless +BZMORE= bzmore +C2PH= c2ph +C89= c89 +C99= c99 +CAL= cal +CALC= calc +CAT= cat +CD= cd +CHFLAGS= chflags +CHGRP= chgrp +CHMOD= chmod +CKSUM= cksum +CLANG= clang +CLANG_PLUSPLUS= clang++ +CLEAR= clear +CMP= cmp +COL= col +COLLDEF= colldef +COLRM= colrm +COLUMN= column +COMPRESS= compress +CP= cp +CPIO= cpio +CPP= cpp +CRC32= crc32 +CSH= csh +CSPLIT= csplit +CURL= curl +CUT= cut +C_PLUSPLUS= c++ +C_PLUSPLUS_FILT= c++filt +DATE= date +DC= dc +DD= dd +DF= df +DIFF3= diff3 +DIFF= diff +DIG= dig +DIRNAME= dirname +ED= ed +EGREP= egrep +ENV= env +EQN= eqn +ETAGS= etags +EXPECT= expect +EXPR= expr +FALSE= false +FGREP= fgrep +FILE= file +FIND2PERL= find2perl +FIND= find +FLEX= flex +FLEX_PLUSPLUS= flex++ +FMT= fmt +FOLD= fold +FS_USAGE= fs_usage +FUNZIP= funzip +FUSER= fuser +GCC= gcc +GDIFFMK= gdiffmk +GENCAT= gencat +GENSTRINGS= genstrings +GETOPT= getopt +GETOPTS= getopts +GINDENT= gindent +GNUMAKE= gnumake +GREP= grep +GROFF= groff +GROFFER= groffer +GROG= grog +GROPS= grops +GROTTY= grotty +GUNZIP= gunzip +GVIM= gvim +GZCAT= gzcat +GZEXE= gzexe +GZIP_PROG= gzip +G_PLUSPLUS= g++ +H2PH= h2ph +H2XS= h2xs +HASH= hash +HEAD= head +HOSTNAME_PROG= hostname +ICONV= iconv +ID= id +INDENT= indent +INFO= info +JOT= jot +KILL= kill +KSH= ksh +LAST= last +LD= ld +LESSECHO= lessecho +LEX= len +LINK= link +LN= ln +LS= ls +M4= m4 +MAKE= make +MAN= man +MKDIR= mkdir +MKFIFO= mkfifo +MKTEMP= mktemp +MV= mv +NANO= nano +NASM= nasm +NEQN= neqn +NICE= nice +NL= nl +NM= nm +NOHUP= nohup +NROFF= nroff +NSLOOKUP= nslookup +OD= od +OPENSSL= openssl +PASTE= paste +PATCH= patch +PATHCHK= pathchk +PAX= pax +PERL= perl +PICO= pico +PR= pr +PRINTENV= printenv +PS= ps +PTAR= ptar +PTARDIFF= ptardiff +PTARGREP= ptargrep +PWD= pwd +PYDOC= pydoc +PYTHON= python +PYTHONW= pythonw +READLINK= readlink +RENICE= renice +RESET= reset +REV= rev +RI= ri +RM= rm +RMDIR= rmdir +RSYNC= rsync +RUBY= ruby +RVIM= rvim +SAY= say +SCP= scp +SCREEN= screen +SCRIPT= script +SDIFF= sdiff +SED= sed +SEQ= seq +SFTP= sftp +SH= sh +SHA1= sha1 +SHA= sha +SHAR= shar +SHASUM5_18= shasum5.18 +SHASUM= shasum +SIZE= size +SLEEP= sleep +SORT= sort +SSH= ssh +STAT= stat +STRIP= strip +STTY= stty +SUM= sum +SYNC= sync +TABS= tabs +TAIL= tail +TAR= tar +TEE= tee +TEST= test +TFTP= tftp +TIDY= tidy +TIME= time +TOP= top +TOUCH= touch +TPUT= tout +TPUT= tput +TR= tr +TROFF= troff +TRUE= true +TSET= tset +TSORT= tsort +UL= ul +UNAME= uname +UNCOMPRESS= uncompress +UNEXPAND= unexpand +UNIFDEF= unifdef +UNIFDEFALL= unifdefall +UNIQ= uniq +UNITS= units +UNLINK= unlink +UNZIP= unzip +UNZIPSFX= unzipsfx +UPTIME= uptime +UUDECODE= uudecode +UUENCODE= uuencode +UUIDGEN= uuidgen +VI= vi +VIEW= view +VIM= vim +VIMDIFF= vimdiff +W= w +WAIT4PATH= wait4path +WAIT= wait +WC= wc +WGET= wget +WHAT= what +WHATIS= whatis +WHICH= which +WHO= who +WHOAMI= whoami +WHOIS= whois +WRTIE= write +XAR= xar +XARGS= xargs +XATTR= xattr +XXD= xxd +YACC= yacc +YES= yes +ZCAT= zcat +ZCMP= zcmp +ZDIFF= zdiff +ZEGREP= zegrep +ZFGREP= zfgrep +ZFORCE= zforce +ZGREP= zgrep +ZIP= zip +ZIPCLOAK= zipcloak +ZIPGREp= zipgrep +ZIPINFo= zipinfo +ZIPNOTE= zipnote +ZIPSPLIT= zipsplit +ZLESS= zless +ZMORE= zmore +ZNEW= znew +ZPRINT= zprint +ZSH= zsh + +# Set X11_LIBDIR to the directory where the X11 library resides # -kivinen.orig: kivinen.orig.c - $(CC) $(CFLAGS) kivinen.orig.c -o kivinen.orig -lX11 \ - -lsocket -lresolv -lnsl +#X11_LIBDIR= /usr/X11R6/lib +#X11_LIBDIR= /usr/X11/lib +X11_LIBDIR= /opt/X11/lib -imc: imc.c - $(CC) $(CFLAGS) imc.c -o imc - -# NOTE: this is the original program that won +# Set X11_INCLUDEDIR to the directory where the X11 include files reside # -imc.orig: imc.orig.c - $(CC) $(CFLAGS) imc.orig.c -o imc.orig +#X11_INCDIR= /usr/X11R6/include +#X11_INCDIR= /usr/X11/include +X11_INCDIR= /opt/X11/include -lush: lush.c - $(CC) $(CFLAGS) lush.c -o lush - -lush.again: lush.c - $(CC) $(CFLAGS) lush.c -o lush.again - $(RM) -f lush.again - -# NOTE: this is the original program that won +# Common C compiler warnings to silence # -lush.orig: lush.orig.c - $(CC) $(CFLAGS) lush.orig.c -o lush.orig +#CSILENCE= +CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-format -# NOTE: some systems may need: +# Common C compiler warning flags # -# $(CC) $(CFLAGS) marangon.c -o marangon -lcurses -ltermcap +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +#CWARN= -Wall -Wextra ${CSILENCE} +CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # -marangon: marangon.c - $(CC) $(CFLAGS) marangon.c -o marangon -lcurses +#CSTD= +#CSTD= -ansi +CSTD= -std=gnu90 -# NOTE: this is the original program that won +# Compiler bit architecture # -# NOTE: some systems may need: +# Some entries require 32-bitness: +# ARCH= -m32 # -# $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses -ltermcap +# Some entries require 64-bitness: +# ARCH= -m64 # -marangon.orig: marangon.orig.c - $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses - -nathan: nathan.c - $(CC) $(CFLAGS) nathan.c -o nathan - -# NOTE: this is the original program that won +# By default we assume nothing: # -nathan.orig: nathan.orig.c - $(CC) $(CFLAGS) nathan.orig.c -o nathan.orig +ARCH= -vern: vern.tmp.c - $(CC) $(CFLAGS) vern.tmp.c -o vern - -vern.tmp.c: vern.c - $(RM) -f vern.tmp.c - $(SED) vern.tmp.c - -# NOTE: this is the original program that won +# Defines that are needed to compile # -vern.orig: vern.orig.tmp.c - $(CC) $(CFLAGS) vern.orig.tmp.c -o vern.orig +CDEFINE= +#CDEFINE= -DIOCCC -vern.orig.tmp.c: vern.orig.c - $(RM) -f vern.orig.tmp.c - $(SED) vern.orig.tmp.c - -westley: westley.c - $(CC) $(CFLAGS) westley.c -o westley - -# alternate names for selected entries +# Include files that are needed to compile # -adgrep: adrian - $(RM) -f adgrep - $(LN) adrian adgrep -am: ant - $(RM) -f am - $(LN) ant am -babble: buzzard.1 - $(RM) -f babble - $(LN) buzzard.1 babble -first: buzzard.2 - $(RM) -f first - $(LN) buzzard.2 first -ag: gson - $(RM) -f ag - $(LN) gson ag -whereami: westley - $(RM) -f whereami - $(LN) westley whereami +CINCLUDE= +#CINCLUDE= -include stdlib.h +#CINCLUDE= -include stdio.h +#CINCLUDE= -include stdlib.h -include stdio.h +#CINCLUDE= -I ${X11_INCDIR} +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 +# Optimization +# +# Most compiles will safely use -O2. Some can use only -O1 or -O. +# A few compilers have broken optimizers or this entry make break +# under those buggy optimizers and thus you may not want anything. +# Reasonable compilers will allow for -O3. +# +#OPT= +#OPT= -O +#OPT= -O1 +#OPT= -O2 +OPT= -O3 + +# Default flags for ANSI C compilation +# +CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} + +# Libraries needed to build +# +LIBS= +#LIBS= -lm +#LIBS= -L ${X11_LIBDIR} -lX11 +#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL + +# C compiler to use +# +CC= cc +#CC=clang +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-error -Wno-implicit-function-declaration -Wno-format \ + -Wno-missing-variable-declarations -Wno-poison-system-directorie \ + -Wno-poison-system-directories -Wno-unknown-warning-option +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif + + +############################## +# Special flags for this entry +############################## +# +ENTRY= imc +PROG= ${ENTRY} +# +OBJ= ${PROG}.o +DATA= +TARGET= ${PROG} +# +ALT_OBJ= +ALT_TARGET= + + +################# +# build the entry +################# +# +all: data ${TARGET} + @${TRUE} + +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto + +${PROG}: ${PROG}.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + +# alternative executable +# +alt: data ${ALT_TARGET} + @${TRUE} + +# data files +# +data: ${DATA} + @${TRUE} + +# both all and alt +# +everything: all alt + + +############### +# utility rules +############### +# clean: - $(RM) -f *.o a.out core - $(RM) -f vern.tmp.c lush.again babble.cppcb vern.orig.tmp.c - $(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c + ${RM} -f ${OBJ} ${ALT_OBJ} + @-if [ -f indent.c ]; then \ + echo ${RM} -f indent.c; \ + ${RM} -f indent.c; \ + fi clobber: clean - $(RM) -f $(WINNERS) a.out - $(RM) -f $(ALT_NAMES) - $(RM) -f adwc adbasename adecho adhead adsleep - $(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig - $(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig + ${RM} -f ${TARGET} ${ALT_TARGET} + @-if [ -e sandwich ]; then \ + ${RM} -f sandwich; \ + echo 'ate sandwich'; \ + fi -am_clobber: clean am - $(RM) -f am.safe - $(CP) am am.safe - $(RM) -f $(WINNERS) a.out - $(RM) -f $(ALT_NAMES) - $(RM) -f adwc adbasename adecho adhead adsleep - $(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig - $(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig - $(CP) am.safe am - $(RM) -f am.safe +install: + @echo "Dr. Spock says that is not logical!" + @${TRUE} -nuke: clobber - @true +# you may be able to misunderstand the source by reading indent.c +# +indent.c: ${PROG}.c + @if which "${GINDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${GINDENT} < $< > $@"; \ + ${GINDENT} < $< > $@; \ + elif which "${INDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${INDENT} < $< > $@"; \ + ${INDENT} < $< > $@; \ + else \ + echo "no intent tool found, ident $< yourself, sorry"; \ + echo "exit 1"; \ + exit 1; \ + fi -install: all - cat $(WINNERS) > /dev/null + +################## +# 133t hacker rulz +################## +# +love: + @echo 'not war?' + @${TRUE} + +haste: + $(MAKE) waste + @${TRUE} + +waste: + @echo 'haste' + @${TRUE} + +maker: + @echo 'Participate in a maker faire' + @${TRUE} + +easter_egg: + @echo "you expected to often misunderstand this $${RANDOM} magic" + @echo "chongo '' /\\oo/\\" + @echo "Eggy" + +sandwich: easter_egg + @if [ `id -u` -eq 0 ]; then \ + echo 'Okay.'; \ + echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ + else \ + echo 'What? Make it yourself.'; \ + exit 1; \ + fi + +# Understand the history of the Homebrew Computer Club +# as well as the West Coast Computer Faire and +# you might be confused different. :-) +# +supernova: sandwich + @-if [ -r .code_anal ]; then \ + ${RM} -f .code_anal_v6; \ + else \ + echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ + fi + @echo "A $@ helps ${MAKE} the elements that help form planets" + @${TRUE} + +deep_magic: supernova + @-if [ -r .code_anal ]; then \ + ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ + --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + fi + @${TRUE} + +magic: deep_magic + @-if [ -r .code_anal ]; then \ + ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "If you don't eat yer meat, you can't have any pudding!"; \ + echo "How can you have any pudding if you don't eat yer meat?!"; \ + fi + @${TRUE} + +# The IOCCC resident astronomer states +# +charon: magic + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore IAU, $@ is a planet" + +pluto: charon + ${MAKE} charon + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore, $@ is a planet" + @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" diff --git a/1992/imc/README.md b/1992/imc/README.md index 23f5b4ab7..c4a534ccd 100644 --- a/1992/imc/README.md +++ b/1992/imc/README.md @@ -1,4 +1,4 @@ -Best Output: +$ Best Output: Ian Collier Oxford University @@ -8,10 +8,13 @@ Best Output: OX1 4AW ENGLAND +## To build: -Judges' comments: + make all - Make and run. +### To run + +## Judges' comments The program is more interesting to run on workstations that can make use of a Sun raster file. Others can make use of the -text @@ -19,13 +22,12 @@ Judges' comments: Of course, the source (layout) is self-documenting! :-) - NOTE: The original winning source imc.orig.c assumed that + NOTE: The original winning source assumed that exit returned a value which cause problems for some systems where exit returned a void. The file imc.c - avoids this problem. + has been modified to avoid this problem. - -Selected notes from the author: +## Author's comments Portability diff --git a/1992/imc/imc.c b/1992/imc/imc.c index b049f2c5a..078c3416e 100644 --- a/1992/imc/imc.c +++ b/1992/imc/imc.c @@ -1,5 +1,4 @@ #include -#include #define ext(a) (exit(a),0) #define I " .:\';+0x074)?( fprintf(i,a,v[q]),r):_>0152?(_/4>27?(_&1?( diff --git a/1992/imc/imc.orig.c b/1992/imc/imc.orig.c deleted file mode 100644 index f85f23212..000000000 --- a/1992/imc/imc.orig.c +++ /dev/null @@ -1,54 +0,0 @@ -#include -#include -#define I " .:\';+++q&&L(v[q],O,&B)!=1&&--q -#define F(U,S,C,A) t=0,*++J&&(t=L(J,U,&C,&A)),(!t&&c>++q&&!(t=L(v[q],U,\ - &C,&A)))?--q:(t<2&&c>++q&&!(t=L(v[q],S,&A))&&--q -#define T(E) (s("%d",E),E||(fputs(n,i),r)) -#define d(C,c) (F("%lg,%lg","%lg",C,c))) -#define O (F("%d,%d","%d",N,U),(N&&U)||(fputs(n,i),r))) -#define D (s("%lg",f)) -#define E putc - C - G=0, - R - =0,Q,H - ,M,P,z,S - =0,x=0 - , f=0;l b,j=0, k - =128,K=1,V,B=0,Y,m=128,p=0,N - =768,U=768,h[]={0x59A66A95,256 - ,192,1,6912,1,0,0},t,A=0,W=0,Z=63,X=23 - ;o*J,_;main(c,v)l c;o**v;{l q=1;for(;;q< - c ?(((J=v[q])[0]&&J[0]<48&&J++,((_= *J)<99|| - _/2== '2'||(_-1)/3=='\"'||_==107||_/05*2==','||_ - >0x074)?( fprintf(i,a,v[q]),r):_>0152?(_/4>27?(_&1?( - O,Z=N,X=U): (W++,N=Z,U=X)):_&1?T(K):T(k)):_>103?(d(G, - R ),j=1):_&1? d(S,x):D,q++),q--,main(c-q,v+q)):A==0?(A= - 1,f||(f=N/4.),b=(((N-1)&017)<8),q=(((N+7)>>3)+b)*U,(J=malloc(q) - )||(perror("malloc"),r),S-=(N/2)/f,x+=(U/2)/f):A==1?(B>=1)||/*/ - (m=128,u--),A==6?exit(1):B ad.temp - -./adrian ad.temp adwc.c - $(CC) -o adwc adwc.c - $(SED) '1s/\..*\./. basename ./' adrian.c > ad.temp - -./adrian ad.temp adbasename.c - $(CC) -o adbasename adbasename.c - $(SED) '1s/\..*\./. echo| ./' adrian.c > ad.temp - -./adrian ad.temp adecho.c - $(CC) -o adecho adecho.c - $(SED) '1s/\..*\./. head; ./' adrian.c > ad.temp - -./adrian ad.temp adhead.c - $(CC) -o adhead adhead.c - $(SED) '1s/\..*\./. sleep ./' adrian.c > ad.temp - -./adrian ad.temp adsleep.c - $(CC) -o adsleep adsleep.c - $(RM) -f ad.temp - -# NOTE: this is the original source that won +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judges to +# consider. # -adrian.orig: adrian.orig.c - $(CC) $(CFLAGS) adrian.orig.c -o adrian.orig - -albert: albert.c - $(CC) $(CFLAGS) albert.c -o albert - -# NOTE: this is the original source that won +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: # -albert.orig: albert.orig.c - $(CC) $(CFLAGS) albert.orig.c -o albert.orig - -ant: ant.c - $(CC) $(CFLAGS) ant.c -o ant - -buzzard.1: buzzard.1.c - $(CC) $(CFLAGS) buzzard.1.c -o buzzard.1 - -babble.cppcb: buzzard.1.c - $(NOINCLUDE) buzzard.1.c | \ - $(CPP) $(CPPFLAGS) | \ - $(CPPCLEAN) | \ - $(CB) $(CBFLAGS) | \ - $(UNIQ) | \ - $(SPACECLEAN) > babble.cppcb 2>&1 - -buzzard.2: buzzard.2.c - $(CC) $(CFLAGS) buzzard.2.c -o buzzard.2 - -# NOTE: this is the original source that won +# https://github.com/ioccc-src/winner # -buzzard.2.orig: buzzard.2.orig.c - $(CC) $(CFLAGS) buzzard.2.orig.c -o buzzard.2.orig +################################################################################ -gson: gson.c - $(CC) $(CFLAGS) gson.c -o gson - -# NOTE: some systems may only need: +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: # -# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 +# Creative Commons Attribution-ShareAlike 3.0 Unported License. # -kivinen: kivinen.c - $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -lsocket -lresolv -lnsl +# See: http://creativecommons.org/licenses/by-sa/3.0/ -# NOTE: this is the original program that won + +############################# +# shell used by this Makefile +############################# # -# NOTE: some systems may only need: +SHELL= bash + +####################### +# common tool locations +####################### # -# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 +A2P= a2p +AR= ar +ASA= asa +AT= at +ATQ= atq +ATRM= atrm +AWK= awk +BANNER= banner +BASE64= base64 +BASENAME= basename +BATCH= batch +BC= bc +BINHEX= binhex +BISON= bison +BUNZIP2= bunzip2 +BZCAT= bzcat +BZCMP= bzcmp +BZDIFF= bzdiff +BZEGREP= bzegrep +BZFGREP= bzfgrep +BZGREP= bzgrep +BZIP2= bzip2 +BZLESS= bzless +BZMORE= bzmore +C2PH= c2ph +C89= c89 +C99= c99 +CAL= cal +CALC= calc +CAT= cat +CD= cd +CHFLAGS= chflags +CHGRP= chgrp +CHMOD= chmod +CKSUM= cksum +CLANG= clang +CLANG_PLUSPLUS= clang++ +CLEAR= clear +CMP= cmp +COL= col +COLLDEF= colldef +COLRM= colrm +COLUMN= column +COMPRESS= compress +CP= cp +CPIO= cpio +CPP= cpp +CRC32= crc32 +CSH= csh +CSPLIT= csplit +CURL= curl +CUT= cut +C_PLUSPLUS= c++ +C_PLUSPLUS_FILT= c++filt +DATE= date +DC= dc +DD= dd +DF= df +DIFF3= diff3 +DIFF= diff +DIG= dig +DIRNAME= dirname +ED= ed +EGREP= egrep +ENV= env +EQN= eqn +ETAGS= etags +EXPECT= expect +EXPR= expr +FALSE= false +FGREP= fgrep +FILE= file +FIND2PERL= find2perl +FIND= find +FLEX= flex +FLEX_PLUSPLUS= flex++ +FMT= fmt +FOLD= fold +FS_USAGE= fs_usage +FUNZIP= funzip +FUSER= fuser +GCC= gcc +GDIFFMK= gdiffmk +GENCAT= gencat +GENSTRINGS= genstrings +GETOPT= getopt +GETOPTS= getopts +GINDENT= gindent +GNUMAKE= gnumake +GREP= grep +GROFF= groff +GROFFER= groffer +GROG= grog +GROPS= grops +GROTTY= grotty +GUNZIP= gunzip +GVIM= gvim +GZCAT= gzcat +GZEXE= gzexe +GZIP_PROG= gzip +G_PLUSPLUS= g++ +H2PH= h2ph +H2XS= h2xs +HASH= hash +HEAD= head +HOSTNAME_PROG= hostname +ICONV= iconv +ID= id +INDENT= indent +INFO= info +JOT= jot +KILL= kill +KSH= ksh +LAST= last +LD= ld +LESSECHO= lessecho +LEX= len +LINK= link +LN= ln +LS= ls +M4= m4 +MAKE= make +MAN= man +MKDIR= mkdir +MKFIFO= mkfifo +MKTEMP= mktemp +MV= mv +NANO= nano +NASM= nasm +NEQN= neqn +NICE= nice +NL= nl +NM= nm +NOHUP= nohup +NROFF= nroff +NSLOOKUP= nslookup +OD= od +OPENSSL= openssl +PASTE= paste +PATCH= patch +PATHCHK= pathchk +PAX= pax +PERL= perl +PICO= pico +PR= pr +PRINTENV= printenv +PS= ps +PTAR= ptar +PTARDIFF= ptardiff +PTARGREP= ptargrep +PWD= pwd +PYDOC= pydoc +PYTHON= python +PYTHONW= pythonw +READLINK= readlink +RENICE= renice +RESET= reset +REV= rev +RI= ri +RM= rm +RMDIR= rmdir +RSYNC= rsync +RUBY= ruby +RVIM= rvim +SAY= say +SCP= scp +SCREEN= screen +SCRIPT= script +SDIFF= sdiff +SED= sed +SEQ= seq +SFTP= sftp +SH= sh +SHA1= sha1 +SHA= sha +SHAR= shar +SHASUM5_18= shasum5.18 +SHASUM= shasum +SIZE= size +SLEEP= sleep +SORT= sort +SSH= ssh +STAT= stat +STRIP= strip +STTY= stty +SUM= sum +SYNC= sync +TABS= tabs +TAIL= tail +TAR= tar +TEE= tee +TEST= test +TFTP= tftp +TIDY= tidy +TIME= time +TOP= top +TOUCH= touch +TPUT= tout +TPUT= tput +TR= tr +TROFF= troff +TRUE= true +TSET= tset +TSORT= tsort +UL= ul +UNAME= uname +UNCOMPRESS= uncompress +UNEXPAND= unexpand +UNIFDEF= unifdef +UNIFDEFALL= unifdefall +UNIQ= uniq +UNITS= units +UNLINK= unlink +UNZIP= unzip +UNZIPSFX= unzipsfx +UPTIME= uptime +UUDECODE= uudecode +UUENCODE= uuencode +UUIDGEN= uuidgen +VI= vi +VIEW= view +VIM= vim +VIMDIFF= vimdiff +W= w +WAIT4PATH= wait4path +WAIT= wait +WC= wc +WGET= wget +WHAT= what +WHATIS= whatis +WHICH= which +WHO= who +WHOAMI= whoami +WHOIS= whois +WRTIE= write +XAR= xar +XARGS= xargs +XATTR= xattr +XXD= xxd +YACC= yacc +YES= yes +ZCAT= zcat +ZCMP= zcmp +ZDIFF= zdiff +ZEGREP= zegrep +ZFGREP= zfgrep +ZFORCE= zforce +ZGREP= zgrep +ZIP= zip +ZIPCLOAK= zipcloak +ZIPGREp= zipgrep +ZIPINFo= zipinfo +ZIPNOTE= zipnote +ZIPSPLIT= zipsplit +ZLESS= zless +ZMORE= zmore +ZNEW= znew +ZPRINT= zprint +ZSH= zsh + +# Set X11_LIBDIR to the directory where the X11 library resides # -kivinen.orig: kivinen.orig.c - $(CC) $(CFLAGS) kivinen.orig.c -o kivinen.orig -lX11 \ - -lsocket -lresolv -lnsl +#X11_LIBDIR= /usr/X11R6/lib +#X11_LIBDIR= /usr/X11/lib +X11_LIBDIR= /opt/X11/lib -imc: imc.c - $(CC) $(CFLAGS) imc.c -o imc - -# NOTE: this is the original program that won +# Set X11_INCLUDEDIR to the directory where the X11 include files reside # -imc.orig: imc.orig.c - $(CC) $(CFLAGS) imc.orig.c -o imc.orig +#X11_INCDIR= /usr/X11R6/include +#X11_INCDIR= /usr/X11/include +X11_INCDIR= /opt/X11/include -lush: lush.c - $(CC) $(CFLAGS) lush.c -o lush - -lush.again: lush.c - $(CC) $(CFLAGS) lush.c -o lush.again - $(RM) -f lush.again - -# NOTE: this is the original program that won +# Common C compiler warnings to silence # -lush.orig: lush.orig.c - $(CC) $(CFLAGS) lush.orig.c -o lush.orig +#CSILENCE= +CSILENCE= -Wno-bitwise-op-parentheses -Wno-error -Wno-implicit-function-declaration \ + -Wno-logical-op-parentheses -Wno-main -Wno-variadic-macros -# NOTE: some systems may need: +# Common C compiler warning flags # -# $(CC) $(CFLAGS) marangon.c -o marangon -lcurses -ltermcap +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +#CWARN= -Wall -Wextra ${CSILENCE} +CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # -marangon: marangon.c - $(CC) $(CFLAGS) marangon.c -o marangon -lcurses +#CSTD= +#CSTD= -ansi +CSTD= -std=gnu90 -# NOTE: this is the original program that won +# Compiler bit architecture # -# NOTE: some systems may need: +# Some entries require 32-bitness: +# ARCH= -m32 # -# $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses -ltermcap +# Some entries require 64-bitness: +# ARCH= -m64 # -marangon.orig: marangon.orig.c - $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses - -nathan: nathan.c - $(CC) $(CFLAGS) nathan.c -o nathan - -# NOTE: this is the original program that won +# By default we assume nothing: # -nathan.orig: nathan.orig.c - $(CC) $(CFLAGS) nathan.orig.c -o nathan.orig +ARCH= -vern: vern.tmp.c - $(CC) $(CFLAGS) vern.tmp.c -o vern - -vern.tmp.c: vern.c - $(RM) -f vern.tmp.c - $(SED) vern.tmp.c - -# NOTE: this is the original program that won +# Defines that are needed to compile # -vern.orig: vern.orig.tmp.c - $(CC) $(CFLAGS) vern.orig.tmp.c -o vern.orig +CDEFINE= +#CDEFINE= -DIOCCC -vern.orig.tmp.c: vern.orig.c - $(RM) -f vern.orig.tmp.c - $(SED) vern.orig.tmp.c - -westley: westley.c - $(CC) $(CFLAGS) westley.c -o westley - -# alternate names for selected entries +# Include files that are needed to compile # -adgrep: adrian - $(RM) -f adgrep - $(LN) adrian adgrep -am: ant - $(RM) -f am - $(LN) ant am -babble: buzzard.1 - $(RM) -f babble - $(LN) buzzard.1 babble -first: buzzard.2 - $(RM) -f first - $(LN) buzzard.2 first -ag: gson - $(RM) -f ag - $(LN) gson ag -whereami: westley - $(RM) -f whereami - $(LN) westley whereami +#CINCLUDE= +#CINCLUDE= -include stdlib.h +#CINCLUDE= -include stdio.h +#CINCLUDE= -include stdlib.h -include stdio.h +#CINCLUDE= -I ${X11_INCDIR} +CINCLUDE= -I ${HOMEBREW_PREFIX}/include +# Optimization +# +# Most compiles will safely use -O2. Some can use only -O1 or -O. +# A few compilers have broken optimizers or this entry make break +# under those buggy optimizers and thus you may not want anything. +# Reasonable compilers will allow for -O3. +# +#OPT= +#OPT= -O +#OPT= -O1 +#OPT= -O2 +OPT= -O3 + +# Default flags for ANSI C compilation +# +CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} + +# Libraries needed to build +# +#LIBS= +#LIBS= -lm +#LIBS= -L ${X11_LIBDIR} -lX11 -lresolv +LIBS= -L ${HOMEBREW_PREFIX}/lib -lX11 -lresolv + +# C compiler to use +# +CC= cc +#CC=clang +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-poison-system-directories -Wno-comma \ + -Wno-conditional-uninitialized -Wno-sign-conversion +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif + + +############################## +# Special flags for this entry +############################## +# +ENTRY= kivinen +PROG= ${ENTRY} +# +OBJ= ${PROG}.o +DATA= +TARGET= ${PROG} +# +ALT_OBJ= +ALT_TARGET= + + +################# +# build the entry +################# +# +all: data ${TARGET} + @${TRUE} + +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto + +${PROG}: ${PROG}.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + +# alternative executable +# +alt: data ${ALT_TARGET} + @${TRUE} + +# data files +# +data: ${DATA} + @${TRUE} + +# both all and alt +# +everything: all alt + + +############### +# utility rules +############### +# clean: - $(RM) -f *.o a.out core - $(RM) -f vern.tmp.c lush.again babble.cppcb vern.orig.tmp.c - $(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c + ${RM} -f ${OBJ} ${ALT_OBJ} + @-if [ -f indent.c ]; then \ + echo ${RM} -f indent.c; \ + ${RM} -f indent.c; \ + fi clobber: clean - $(RM) -f $(WINNERS) a.out - $(RM) -f $(ALT_NAMES) - $(RM) -f adwc adbasename adecho adhead adsleep - $(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig - $(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig + ${RM} -f ${TARGET} ${ALT_TARGET} + @-if [ -e sandwich ]; then \ + ${RM} -f sandwich; \ + echo 'ate sandwich'; \ + fi -am_clobber: clean am - $(RM) -f am.safe - $(CP) am am.safe - $(RM) -f $(WINNERS) a.out - $(RM) -f $(ALT_NAMES) - $(RM) -f adwc adbasename adecho adhead adsleep - $(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig - $(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig - $(CP) am.safe am - $(RM) -f am.safe +install: + @echo "Dr. Spock says that is not logical!" + @${TRUE} -nuke: clobber - @true +# you may be able to misunderstand the source by reading indent.c +# +indent.c: ${PROG}.c + @if which "${GINDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${GINDENT} < $< > $@"; \ + ${GINDENT} < $< > $@; \ + elif which "${INDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${INDENT} < $< > $@"; \ + ${INDENT} < $< > $@; \ + else \ + echo "no intent tool found, ident $< yourself, sorry"; \ + echo "exit 1"; \ + exit 1; \ + fi -install: all - cat $(WINNERS) > /dev/null + +################## +# 133t hacker rulz +################## +# +love: + @echo 'not war?' + @${TRUE} + +haste: + $(MAKE) waste + @${TRUE} + +waste: + @echo 'haste' + @${TRUE} + +maker: + @echo 'Participate in a maker faire' + @${TRUE} + +easter_egg: + @echo "you expected to often misunderstand this $${RANDOM} magic" + @echo "chongo '' /\\oo/\\" + @echo "Eggy" + +sandwich: easter_egg + @if [ `id -u` -eq 0 ]; then \ + echo 'Okay.'; \ + echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ + else \ + echo 'What? Make it yourself.'; \ + exit 1; \ + fi + +# Understand the history of the Homebrew Computer Club +# as well as the West Coast Computer Faire and +# you might be confused different. :-) +# +supernova: sandwich + @-if [ -r .code_anal ]; then \ + ${RM} -f .code_anal_v6; \ + else \ + echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ + fi + @echo "A $@ helps ${MAKE} the elements that help form planets" + @${TRUE} + +deep_magic: supernova + @-if [ -r .code_anal ]; then \ + ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ + --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + fi + @${TRUE} + +magic: deep_magic + @-if [ -r .code_anal ]; then \ + ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "If you don't eat yer meat, you can't have any pudding!"; \ + echo "How can you have any pudding if you don't eat yer meat?!"; \ + fi + @${TRUE} + +# The IOCCC resident astronomer states +# +charon: magic + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore IAU, $@ is a planet" + +pluto: charon + ${MAKE} charon + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore, $@ is a planet" + @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" diff --git a/1992/kivinen/kivinen.orig.c b/1992/kivinen/kivinen.orig.c deleted file mode 100644 index 4d48dac3f..000000000 --- a/1992/kivinen/kivinen.orig.c +++ /dev/null @@ -1,38 +0,0 @@ -#include -# define X( x,v,y) XMoveWindow(d,s[x],(v)*z,(y)*z) -# define _ ButtonPressMask|ButtonReleaseMask -# define I( x,y) XSelectInput(d,s[x],y) -# define N( v) (XMapWindow(d,s[v]),v) -# define V VisibilityChangeMask -# define A XCreateSimpleWindow -# define D DefaultScreen(d) -# define E r.xbutton.button -# define R BlackPixel(d,D) -# define S r.xvisibility - - int main(a)int a;{Window s[53];int w,u,i,c,y,l=0 - ,q,e=32,t,k,j=~0,z=(a+1)/2,x=a&1,v=z&1;XEvent r;Display* - d=XOpenDisplay("");s[0]=A(d,DefaultRootWindow(d),200,200,(x& - v?330:120)*z,215*z,2,R,R);I(N(c=0),_);for(;c<(x?32:52);c++){s[ - c+1]=A(d,s[0],x ?c*20*z:(c-1)%10 *12*z,x?-20*z:( - c-1)/10*12*z,x ?z*(c^31?10: 2):z*10*(c?1:2 - ), x& v?z*10: (c &&!x?10:1+ x) *z,k =q=1, R, - WhitePixel(d ,D));I (N(c+1), V);}X( N(1),y=(x&v) - *115+50,x*70+ 60 ); X(N(c-- )+ 1,x?-10:(i=y) - ,u=!x*130-20); while(c &&e< 160){if(x){if( - v){l=!(e &32)*9; for(w=30; w--;){ if(s[w+2]){ k=w% - 10;l=e&32?k>l?k:l:k300?e++:0)):(q--,q+l<10?e++:0); } u>140? - exit(c):u>-20?X(32,i,u-=(v?5:-1)):(!v?(u =5,srandom(time(0)),i= - random()%88+6):0); } else{k>0?i+=(i>105?k= -k:k):(i+=(i<1?k= -k: - k)); j>0?u +=(u>140?exit(++c):j):(u+=(u <1?j= -j:j - )); X( 52,i,u);}XSync(d,0); while( - XCheckMaskEvent(d ,_|V,&r))if(!(r. type==ButtonPress - ?(E&1||!x||!v?t=E*4-8 :u<0?i=y+4,u=122:1):r - .type==ButtonRelease&&E?t=0,1:r.type^VisibilityNotify|S.state^1) - )for(x&v?(u= -15),w++:(w=0);++w <52-x*20;)if - (s[w] ==S.window)x&&v|| w ^1? - XUnmapWindow (d,s[w]) ,s[w]=0,c--: - 0,l=1; if(!x&&l)j= -j,l=0; if(l&x&&!v - )u=~19,c--,l=0;t=(!x||!v) &&(y<5&&t<0||y>95&&t>0)?0 - :t;s[1]?X(1,y+=x&v?t:t/(x+1),130):exit(++c);};return(c);} diff --git a/1992/lush/.gitignore b/1992/lush/.gitignore new file mode 100644 index 000000000..be0910751 --- /dev/null +++ b/1992/lush/.gitignore @@ -0,0 +1 @@ +lush diff --git a/1992/lush/Makefile b/1992/lush/Makefile index 2eb115d13..500572ff5 100644 --- a/1992/lush/Makefile +++ b/1992/lush/Makefile @@ -1,244 +1,600 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1992 makefile +# IOCCC 1992 winning entry - lush + +################################################################################ # -# Copyright (c) 1992, Landon Curt Noll & Larry Bassel. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll and Larry Bassel. - - -SHELL=/bin/sh -CHMOD=chmod -CP=cp -RM=rm -SED=sed -LN=ln -UNIQ=uniq -CB=cb -GREP=grep -# set this to where your C Processor resides +# An Historical Makefile NOTE: # -# On some systems: -# CPP=/lib/cpp +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. # -CPP=/usr/ccs/lib/acpp - -# flags for ansi compiles +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. # -# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, -# others such as gcc may want -ansi, others may want nothing -# at all. Adjust the CFLAGS line as needed. +# Regarding individual entries: # -# NOTE: Some compilers cannot optimize, or optimize some entries -# entries incorrectly. You might want need to turn on -O -# to see if your compiler can handle them. +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. # -#CFLAGS=-O -Xa -CFLAGS=-Xa -CC=cc - -# misc shell babble +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. # -NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/' -SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g' -CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*' - -# winners that compile under ANSI C +# GitHub pull requests are welcome: # -WINNERS= adrian albert ant buzzard.1 buzzard.2 gson kivinen imc \ - lush marangon nathan vern westley -ALT_NAMES= adgrep am babble first ag whereami - -all: $(WINNERS) $(ALT_NAMES) - -adrian: adrian.c - $(CC) $(CFLAGS) adrian.c -o adrian - $(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c - $(SED) '1s/\..*\./. wc ./' adrian.c > ad.temp - -./adrian ad.temp adwc.c - $(CC) -o adwc adwc.c - $(SED) '1s/\..*\./. basename ./' adrian.c > ad.temp - -./adrian ad.temp adbasename.c - $(CC) -o adbasename adbasename.c - $(SED) '1s/\..*\./. echo| ./' adrian.c > ad.temp - -./adrian ad.temp adecho.c - $(CC) -o adecho adecho.c - $(SED) '1s/\..*\./. head; ./' adrian.c > ad.temp - -./adrian ad.temp adhead.c - $(CC) -o adhead adhead.c - $(SED) '1s/\..*\./. sleep ./' adrian.c > ad.temp - -./adrian ad.temp adsleep.c - $(CC) -o adsleep adsleep.c - $(RM) -f ad.temp - -# NOTE: this is the original source that won +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judges to +# consider. # -adrian.orig: adrian.orig.c - $(CC) $(CFLAGS) adrian.orig.c -o adrian.orig - -albert: albert.c - $(CC) $(CFLAGS) albert.c -o albert - -# NOTE: this is the original source that won +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: # -albert.orig: albert.orig.c - $(CC) $(CFLAGS) albert.orig.c -o albert.orig - -ant: ant.c - $(CC) $(CFLAGS) ant.c -o ant - -buzzard.1: buzzard.1.c - $(CC) $(CFLAGS) buzzard.1.c -o buzzard.1 - -babble.cppcb: buzzard.1.c - $(NOINCLUDE) buzzard.1.c | \ - $(CPP) $(CPPFLAGS) | \ - $(CPPCLEAN) | \ - $(CB) $(CBFLAGS) | \ - $(UNIQ) | \ - $(SPACECLEAN) > babble.cppcb 2>&1 - -buzzard.2: buzzard.2.c - $(CC) $(CFLAGS) buzzard.2.c -o buzzard.2 - -# NOTE: this is the original source that won +# https://github.com/ioccc-src/winner # -buzzard.2.orig: buzzard.2.orig.c - $(CC) $(CFLAGS) buzzard.2.orig.c -o buzzard.2.orig +################################################################################ -gson: gson.c - $(CC) $(CFLAGS) gson.c -o gson - -# NOTE: some systems may only need: +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: # -# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 +# Creative Commons Attribution-ShareAlike 3.0 Unported License. # -kivinen: kivinen.c - $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -lsocket -lresolv -lnsl +# See: http://creativecommons.org/licenses/by-sa/3.0/ -# NOTE: this is the original program that won + +############################# +# shell used by this Makefile +############################# # -# NOTE: some systems may only need: +SHELL= bash + +####################### +# common tool locations +####################### # -# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 +A2P= a2p +AR= ar +ASA= asa +AT= at +ATQ= atq +ATRM= atrm +AWK= awk +BANNER= banner +BASE64= base64 +BASENAME= basename +BATCH= batch +BC= bc +BINHEX= binhex +BISON= bison +BUNZIP2= bunzip2 +BZCAT= bzcat +BZCMP= bzcmp +BZDIFF= bzdiff +BZEGREP= bzegrep +BZFGREP= bzfgrep +BZGREP= bzgrep +BZIP2= bzip2 +BZLESS= bzless +BZMORE= bzmore +C2PH= c2ph +C89= c89 +C99= c99 +CAL= cal +CALC= calc +CAT= cat +CD= cd +CHFLAGS= chflags +CHGRP= chgrp +CHMOD= chmod +CKSUM= cksum +CLANG= clang +CLANG_PLUSPLUS= clang++ +CLEAR= clear +CMP= cmp +COL= col +COLLDEF= colldef +COLRM= colrm +COLUMN= column +COMPRESS= compress +CP= cp +CPIO= cpio +CPP= cpp +CRC32= crc32 +CSH= csh +CSPLIT= csplit +CURL= curl +CUT= cut +C_PLUSPLUS= c++ +C_PLUSPLUS_FILT= c++filt +DATE= date +DC= dc +DD= dd +DF= df +DIFF3= diff3 +DIFF= diff +DIG= dig +DIRNAME= dirname +ED= ed +EGREP= egrep +ENV= env +EQN= eqn +ETAGS= etags +EXPECT= expect +EXPR= expr +FALSE= false +FGREP= fgrep +FILE= file +FIND2PERL= find2perl +FIND= find +FLEX= flex +FLEX_PLUSPLUS= flex++ +FMT= fmt +FOLD= fold +FS_USAGE= fs_usage +FUNZIP= funzip +FUSER= fuser +GCC= gcc +GDIFFMK= gdiffmk +GENCAT= gencat +GENSTRINGS= genstrings +GETOPT= getopt +GETOPTS= getopts +GINDENT= gindent +GNUMAKE= gnumake +GREP= grep +GROFF= groff +GROFFER= groffer +GROG= grog +GROPS= grops +GROTTY= grotty +GUNZIP= gunzip +GVIM= gvim +GZCAT= gzcat +GZEXE= gzexe +GZIP_PROG= gzip +G_PLUSPLUS= g++ +H2PH= h2ph +H2XS= h2xs +HASH= hash +HEAD= head +HOSTNAME_PROG= hostname +ICONV= iconv +ID= id +INDENT= indent +INFO= info +JOT= jot +KILL= kill +KSH= ksh +LAST= last +LD= ld +LESSECHO= lessecho +LEX= len +LINK= link +LN= ln +LS= ls +M4= m4 +MAKE= make +MAN= man +MKDIR= mkdir +MKFIFO= mkfifo +MKTEMP= mktemp +MV= mv +NANO= nano +NASM= nasm +NEQN= neqn +NICE= nice +NL= nl +NM= nm +NOHUP= nohup +NROFF= nroff +NSLOOKUP= nslookup +OD= od +OPENSSL= openssl +PASTE= paste +PATCH= patch +PATHCHK= pathchk +PAX= pax +PERL= perl +PICO= pico +PR= pr +PRINTENV= printenv +PS= ps +PTAR= ptar +PTARDIFF= ptardiff +PTARGREP= ptargrep +PWD= pwd +PYDOC= pydoc +PYTHON= python +PYTHONW= pythonw +READLINK= readlink +RENICE= renice +RESET= reset +REV= rev +RI= ri +RM= rm +RMDIR= rmdir +RSYNC= rsync +RUBY= ruby +RVIM= rvim +SAY= say +SCP= scp +SCREEN= screen +SCRIPT= script +SDIFF= sdiff +SED= sed +SEQ= seq +SFTP= sftp +SH= sh +SHA1= sha1 +SHA= sha +SHAR= shar +SHASUM5_18= shasum5.18 +SHASUM= shasum +SIZE= size +SLEEP= sleep +SORT= sort +SSH= ssh +STAT= stat +STRIP= strip +STTY= stty +SUM= sum +SYNC= sync +TABS= tabs +TAIL= tail +TAR= tar +TEE= tee +TEST= test +TFTP= tftp +TIDY= tidy +TIME= time +TOP= top +TOUCH= touch +TPUT= tout +TPUT= tput +TR= tr +TROFF= troff +TRUE= true +TSET= tset +TSORT= tsort +UL= ul +UNAME= uname +UNCOMPRESS= uncompress +UNEXPAND= unexpand +UNIFDEF= unifdef +UNIFDEFALL= unifdefall +UNIQ= uniq +UNITS= units +UNLINK= unlink +UNZIP= unzip +UNZIPSFX= unzipsfx +UPTIME= uptime +UUDECODE= uudecode +UUENCODE= uuencode +UUIDGEN= uuidgen +VI= vi +VIEW= view +VIM= vim +VIMDIFF= vimdiff +W= w +WAIT4PATH= wait4path +WAIT= wait +WC= wc +WGET= wget +WHAT= what +WHATIS= whatis +WHICH= which +WHO= who +WHOAMI= whoami +WHOIS= whois +WRTIE= write +XAR= xar +XARGS= xargs +XATTR= xattr +XXD= xxd +YACC= yacc +YES= yes +ZCAT= zcat +ZCMP= zcmp +ZDIFF= zdiff +ZEGREP= zegrep +ZFGREP= zfgrep +ZFORCE= zforce +ZGREP= zgrep +ZIP= zip +ZIPCLOAK= zipcloak +ZIPGREp= zipgrep +ZIPINFo= zipinfo +ZIPNOTE= zipnote +ZIPSPLIT= zipsplit +ZLESS= zless +ZMORE= zmore +ZNEW= znew +ZPRINT= zprint +ZSH= zsh + +# Set X11_LIBDIR to the directory where the X11 library resides # -kivinen.orig: kivinen.orig.c - $(CC) $(CFLAGS) kivinen.orig.c -o kivinen.orig -lX11 \ - -lsocket -lresolv -lnsl +#X11_LIBDIR= /usr/X11R6/lib +#X11_LIBDIR= /usr/X11/lib +X11_LIBDIR= /opt/X11/lib -imc: imc.c - $(CC) $(CFLAGS) imc.c -o imc - -# NOTE: this is the original program that won +# Set X11_INCLUDEDIR to the directory where the X11 include files reside # -imc.orig: imc.orig.c - $(CC) $(CFLAGS) imc.orig.c -o imc.orig +#X11_INCDIR= /usr/X11R6/include +#X11_INCDIR= /usr/X11/include +X11_INCDIR= /opt/X11/include -lush: lush.c - $(CC) $(CFLAGS) lush.c -o lush - -lush.again: lush.c - $(CC) $(CFLAGS) lush.c -o lush.again - $(RM) -f lush.again - -# NOTE: this is the original program that won +# Common C compiler warnings to silence # -lush.orig: lush.orig.c - $(CC) $(CFLAGS) lush.orig.c -o lush.orig +#CSILENCE= +CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-macro-redefined -# NOTE: some systems may need: +# Common C compiler warning flags # -# $(CC) $(CFLAGS) marangon.c -o marangon -lcurses -ltermcap +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +#CWARN= -Wall -Wextra ${CSILENCE} +CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # -marangon: marangon.c - $(CC) $(CFLAGS) marangon.c -o marangon -lcurses +#CSTD= +#CSTD= -ansi +CSTD= -std=gnu90 -# NOTE: this is the original program that won +# Compiler bit architecture # -# NOTE: some systems may need: +# Some entries require 32-bitness: +# ARCH= -m32 # -# $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses -ltermcap +# Some entries require 64-bitness: +# ARCH= -m64 # -marangon.orig: marangon.orig.c - $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses - -nathan: nathan.c - $(CC) $(CFLAGS) nathan.c -o nathan - -# NOTE: this is the original program that won +# By default we assume nothing: # -nathan.orig: nathan.orig.c - $(CC) $(CFLAGS) nathan.orig.c -o nathan.orig +ARCH= -vern: vern.tmp.c - $(CC) $(CFLAGS) vern.tmp.c -o vern - -vern.tmp.c: vern.c - $(RM) -f vern.tmp.c - $(SED) vern.tmp.c - -# NOTE: this is the original program that won +# Defines that are needed to compile # -vern.orig: vern.orig.tmp.c - $(CC) $(CFLAGS) vern.orig.tmp.c -o vern.orig +CDEFINE= +#CDEFINE= -DIOCCC -vern.orig.tmp.c: vern.orig.c - $(RM) -f vern.orig.tmp.c - $(SED) vern.orig.tmp.c - -westley: westley.c - $(CC) $(CFLAGS) westley.c -o westley - -# alternate names for selected entries +# Include files that are needed to compile # -adgrep: adrian - $(RM) -f adgrep - $(LN) adrian adgrep -am: ant - $(RM) -f am - $(LN) ant am -babble: buzzard.1 - $(RM) -f babble - $(LN) buzzard.1 babble -first: buzzard.2 - $(RM) -f first - $(LN) buzzard.2 first -ag: gson - $(RM) -f ag - $(LN) gson ag -whereami: westley - $(RM) -f whereami - $(LN) westley whereami +CINCLUDE= +#CINCLUDE= -include stdlib.h +#CINCLUDE= -include stdio.h +#CINCLUDE= -include stdlib.h -include stdio.h +#CINCLUDE= -I ${X11_INCDIR} +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 +# Optimization +# +# Most compiles will safely use -O2. Some can use only -O1 or -O. +# A few compilers have broken optimizers or this entry make break +# under those buggy optimizers and thus you may not want anything. +# Reasonable compilers will allow for -O3. +# +#OPT= +#OPT= -O +#OPT= -O1 +#OPT= -O2 +OPT= -O3 + +# Default flags for ANSI C compilation +# +CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} + +# Libraries needed to build +# +LIBS= +#LIBS= -lm +#LIBS= -L ${X11_LIBDIR} -lX11 +#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL + +# C compiler to use +# +CC= cc +#CC=clang +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-comma -Wno-missing-variable-declarations \ + -Wno-poison-system-directories -Wno-unused-macros +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif + + +############################## +# Special flags for this entry +############################## +# +ENTRY= lush +PROG= ${ENTRY} +# +OBJ= ${PROG}.o +DATA= +TARGET= ${PROG} +# +ALT_OBJ= +ALT_TARGET= + + +################# +# build the entry +################# +# +all: data ${TARGET} + @${TRUE} + +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto + +${PROG}: ${PROG}.c + @echo "NOTE: This entry requires a non-standard K&R C compiler to compile." + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + +lush.again: ${PROG}.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + ${RM} -f $@ + +# alternative executable +# +alt: data ${ALT_TARGET} + @${TRUE} + +# data files +# +data: ${DATA} + @${TRUE} + +# both all and alt +# +everything: all alt + + +############### +# utility rules +############### +# clean: - $(RM) -f *.o a.out core - $(RM) -f vern.tmp.c lush.again babble.cppcb vern.orig.tmp.c - $(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c + ${RM} -f ${OBJ} ${ALT_OBJ} + ${RM} -f lush.again + @-if [ -f indent.c ]; then \ + echo ${RM} -f indent.c; \ + ${RM} -f indent.c; \ + fi clobber: clean - $(RM) -f $(WINNERS) a.out - $(RM) -f $(ALT_NAMES) - $(RM) -f adwc adbasename adecho adhead adsleep - $(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig - $(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig + ${RM} -f ${TARGET} ${ALT_TARGET} + @-if [ -e sandwich ]; then \ + ${RM} -f sandwich; \ + echo 'ate sandwich'; \ + fi -am_clobber: clean am - $(RM) -f am.safe - $(CP) am am.safe - $(RM) -f $(WINNERS) a.out - $(RM) -f $(ALT_NAMES) - $(RM) -f adwc adbasename adecho adhead adsleep - $(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig - $(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig - $(CP) am.safe am - $(RM) -f am.safe +install: + @echo "Dr. Spock says that is not logical!" + @${TRUE} -nuke: clobber - @true +# you may be able to misunderstand the source by reading indent.c +# +indent.c: ${PROG}.c + @if which "${GINDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${GINDENT} < $< > $@"; \ + ${GINDENT} < $< > $@; \ + elif which "${INDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${INDENT} < $< > $@"; \ + ${INDENT} < $< > $@; \ + else \ + echo "no intent tool found, ident $< yourself, sorry"; \ + echo "exit 1"; \ + exit 1; \ + fi -install: all - cat $(WINNERS) > /dev/null + +################## +# 133t hacker rulz +################## +# +love: + @echo 'not war?' + @${TRUE} + +haste: + $(MAKE) waste + @${TRUE} + +waste: + @echo 'haste' + @${TRUE} + +maker: + @echo 'Participate in a maker faire' + @${TRUE} + +easter_egg: + @echo "you expected to often misunderstand this $${RANDOM} magic" + @echo "chongo '' /\\oo/\\" + @echo "Eggy" + +sandwich: easter_egg + @if [ `id -u` -eq 0 ]; then \ + echo 'Okay.'; \ + echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ + else \ + echo 'What? Make it yourself.'; \ + exit 1; \ + fi + +# Understand the history of the Homebrew Computer Club +# as well as the West Coast Computer Faire and +# you might be confused different. :-) +# +supernova: sandwich + @-if [ -r .code_anal ]; then \ + ${RM} -f .code_anal_v6; \ + else \ + echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ + fi + @echo "A $@ helps ${MAKE} the elements that help form planets" + @${TRUE} + +deep_magic: supernova + @-if [ -r .code_anal ]; then \ + ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ + --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + fi + @${TRUE} + +magic: deep_magic + @-if [ -r .code_anal ]; then \ + ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "If you don't eat yer meat, you can't have any pudding!"; \ + echo "How can you have any pudding if you don't eat yer meat?!"; \ + fi + @${TRUE} + +# The IOCCC resident astronomer states +# +charon: magic + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore IAU, $@ is a planet" + +pluto: charon + ${MAKE} charon + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore, $@ is a planet" + @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" diff --git a/1992/lush/README.md b/1992/lush/README.md index e85fcb723..f31d7d20c 100644 --- a/1992/lush/README.md +++ b/1992/lush/README.md @@ -1,27 +1,27 @@ -Worst Abuse of the C Preprocessor: +# Worst Abuse of the C Preprocessor: Ed Luke Mississippi State University P.O. Box 6176 Mississippi State, MS 39762, USA +## To build: -Judges' comments: + make all - To setup: - make lush - - Try: - make lush.again 2>&1 | lush (sh or ksh users) - or: - make lush.again |& lush (csh users) +### To run + + make lush.again 2>&1 | ./lush + + NOTE: This entry requires a non-standard K&R C compiler to compile. + +## Judges' comments The program uses error messages issued by the C Proproessor to generate its message to the world. One program's error is another program's data! - -Selected notes from the author: +## Author's comments This program is yet another "Hello World." program with a twist. The string Hello World has been encoded in the error messages the compiler diff --git a/1992/lush/lush.orig.c b/1992/lush/lush.orig.c deleted file mode 100644 index d88d71ce3..000000000 --- a/1992/lush/lush.orig.c +++ /dev/null @@ -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:: - ;;;} - diff --git a/1992/marangon/.gitignore b/1992/marangon/.gitignore new file mode 100644 index 000000000..d5d39567a --- /dev/null +++ b/1992/marangon/.gitignore @@ -0,0 +1 @@ +marangon diff --git a/1992/marangon/Makefile b/1992/marangon/Makefile index 2eb115d13..3b66bba1e 100644 --- a/1992/marangon/Makefile +++ b/1992/marangon/Makefile @@ -1,244 +1,597 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1992 makefile +# IOCCC 1992 winning entry - marangon + +################################################################################ # -# Copyright (c) 1992, Landon Curt Noll & Larry Bassel. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll and Larry Bassel. - - -SHELL=/bin/sh -CHMOD=chmod -CP=cp -RM=rm -SED=sed -LN=ln -UNIQ=uniq -CB=cb -GREP=grep -# set this to where your C Processor resides +# An Historical Makefile NOTE: # -# On some systems: -# CPP=/lib/cpp +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. # -CPP=/usr/ccs/lib/acpp - -# flags for ansi compiles +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. # -# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, -# others such as gcc may want -ansi, others may want nothing -# at all. Adjust the CFLAGS line as needed. +# Regarding individual entries: # -# NOTE: Some compilers cannot optimize, or optimize some entries -# entries incorrectly. You might want need to turn on -O -# to see if your compiler can handle them. +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. # -#CFLAGS=-O -Xa -CFLAGS=-Xa -CC=cc - -# misc shell babble +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. # -NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/' -SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g' -CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*' - -# winners that compile under ANSI C +# GitHub pull requests are welcome: # -WINNERS= adrian albert ant buzzard.1 buzzard.2 gson kivinen imc \ - lush marangon nathan vern westley -ALT_NAMES= adgrep am babble first ag whereami - -all: $(WINNERS) $(ALT_NAMES) - -adrian: adrian.c - $(CC) $(CFLAGS) adrian.c -o adrian - $(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c - $(SED) '1s/\..*\./. wc ./' adrian.c > ad.temp - -./adrian ad.temp adwc.c - $(CC) -o adwc adwc.c - $(SED) '1s/\..*\./. basename ./' adrian.c > ad.temp - -./adrian ad.temp adbasename.c - $(CC) -o adbasename adbasename.c - $(SED) '1s/\..*\./. echo| ./' adrian.c > ad.temp - -./adrian ad.temp adecho.c - $(CC) -o adecho adecho.c - $(SED) '1s/\..*\./. head; ./' adrian.c > ad.temp - -./adrian ad.temp adhead.c - $(CC) -o adhead adhead.c - $(SED) '1s/\..*\./. sleep ./' adrian.c > ad.temp - -./adrian ad.temp adsleep.c - $(CC) -o adsleep adsleep.c - $(RM) -f ad.temp - -# NOTE: this is the original source that won +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judges to +# consider. # -adrian.orig: adrian.orig.c - $(CC) $(CFLAGS) adrian.orig.c -o adrian.orig - -albert: albert.c - $(CC) $(CFLAGS) albert.c -o albert - -# NOTE: this is the original source that won +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: # -albert.orig: albert.orig.c - $(CC) $(CFLAGS) albert.orig.c -o albert.orig - -ant: ant.c - $(CC) $(CFLAGS) ant.c -o ant - -buzzard.1: buzzard.1.c - $(CC) $(CFLAGS) buzzard.1.c -o buzzard.1 - -babble.cppcb: buzzard.1.c - $(NOINCLUDE) buzzard.1.c | \ - $(CPP) $(CPPFLAGS) | \ - $(CPPCLEAN) | \ - $(CB) $(CBFLAGS) | \ - $(UNIQ) | \ - $(SPACECLEAN) > babble.cppcb 2>&1 - -buzzard.2: buzzard.2.c - $(CC) $(CFLAGS) buzzard.2.c -o buzzard.2 - -# NOTE: this is the original source that won +# https://github.com/ioccc-src/winner # -buzzard.2.orig: buzzard.2.orig.c - $(CC) $(CFLAGS) buzzard.2.orig.c -o buzzard.2.orig +################################################################################ -gson: gson.c - $(CC) $(CFLAGS) gson.c -o gson - -# NOTE: some systems may only need: +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: # -# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 +# Creative Commons Attribution-ShareAlike 3.0 Unported License. # -kivinen: kivinen.c - $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -lsocket -lresolv -lnsl +# See: http://creativecommons.org/licenses/by-sa/3.0/ -# NOTE: this is the original program that won + +############################# +# shell used by this Makefile +############################# # -# NOTE: some systems may only need: +SHELL= bash + +####################### +# common tool locations +####################### # -# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 +A2P= a2p +AR= ar +ASA= asa +AT= at +ATQ= atq +ATRM= atrm +AWK= awk +BANNER= banner +BASE64= base64 +BASENAME= basename +BATCH= batch +BC= bc +BINHEX= binhex +BISON= bison +BUNZIP2= bunzip2 +BZCAT= bzcat +BZCMP= bzcmp +BZDIFF= bzdiff +BZEGREP= bzegrep +BZFGREP= bzfgrep +BZGREP= bzgrep +BZIP2= bzip2 +BZLESS= bzless +BZMORE= bzmore +C2PH= c2ph +C89= c89 +C99= c99 +CAL= cal +CALC= calc +CAT= cat +CD= cd +CHFLAGS= chflags +CHGRP= chgrp +CHMOD= chmod +CKSUM= cksum +CLANG= clang +CLANG_PLUSPLUS= clang++ +CLEAR= clear +CMP= cmp +COL= col +COLLDEF= colldef +COLRM= colrm +COLUMN= column +COMPRESS= compress +CP= cp +CPIO= cpio +CPP= cpp +CRC32= crc32 +CSH= csh +CSPLIT= csplit +CURL= curl +CUT= cut +C_PLUSPLUS= c++ +C_PLUSPLUS_FILT= c++filt +DATE= date +DC= dc +DD= dd +DF= df +DIFF3= diff3 +DIFF= diff +DIG= dig +DIRNAME= dirname +ED= ed +EGREP= egrep +ENV= env +EQN= eqn +ETAGS= etags +EXPECT= expect +EXPR= expr +FALSE= false +FGREP= fgrep +FILE= file +FIND2PERL= find2perl +FIND= find +FLEX= flex +FLEX_PLUSPLUS= flex++ +FMT= fmt +FOLD= fold +FS_USAGE= fs_usage +FUNZIP= funzip +FUSER= fuser +GCC= gcc +GDIFFMK= gdiffmk +GENCAT= gencat +GENSTRINGS= genstrings +GETOPT= getopt +GETOPTS= getopts +GINDENT= gindent +GNUMAKE= gnumake +GREP= grep +GROFF= groff +GROFFER= groffer +GROG= grog +GROPS= grops +GROTTY= grotty +GUNZIP= gunzip +GVIM= gvim +GZCAT= gzcat +GZEXE= gzexe +GZIP_PROG= gzip +G_PLUSPLUS= g++ +H2PH= h2ph +H2XS= h2xs +HASH= hash +HEAD= head +HOSTNAME_PROG= hostname +ICONV= iconv +ID= id +INDENT= indent +INFO= info +JOT= jot +KILL= kill +KSH= ksh +LAST= last +LD= ld +LESSECHO= lessecho +LEX= len +LINK= link +LN= ln +LS= ls +M4= m4 +MAKE= make +MAN= man +MKDIR= mkdir +MKFIFO= mkfifo +MKTEMP= mktemp +MV= mv +NANO= nano +NASM= nasm +NEQN= neqn +NICE= nice +NL= nl +NM= nm +NOHUP= nohup +NROFF= nroff +NSLOOKUP= nslookup +OD= od +OPENSSL= openssl +PASTE= paste +PATCH= patch +PATHCHK= pathchk +PAX= pax +PERL= perl +PICO= pico +PR= pr +PRINTENV= printenv +PS= ps +PTAR= ptar +PTARDIFF= ptardiff +PTARGREP= ptargrep +PWD= pwd +PYDOC= pydoc +PYTHON= python +PYTHONW= pythonw +READLINK= readlink +RENICE= renice +RESET= reset +REV= rev +RI= ri +RM= rm +RMDIR= rmdir +RSYNC= rsync +RUBY= ruby +RVIM= rvim +SAY= say +SCP= scp +SCREEN= screen +SCRIPT= script +SDIFF= sdiff +SED= sed +SEQ= seq +SFTP= sftp +SH= sh +SHA1= sha1 +SHA= sha +SHAR= shar +SHASUM5_18= shasum5.18 +SHASUM= shasum +SIZE= size +SLEEP= sleep +SORT= sort +SSH= ssh +STAT= stat +STRIP= strip +STTY= stty +SUM= sum +SYNC= sync +TABS= tabs +TAIL= tail +TAR= tar +TEE= tee +TEST= test +TFTP= tftp +TIDY= tidy +TIME= time +TOP= top +TOUCH= touch +TPUT= tout +TPUT= tput +TR= tr +TROFF= troff +TRUE= true +TSET= tset +TSORT= tsort +UL= ul +UNAME= uname +UNCOMPRESS= uncompress +UNEXPAND= unexpand +UNIFDEF= unifdef +UNIFDEFALL= unifdefall +UNIQ= uniq +UNITS= units +UNLINK= unlink +UNZIP= unzip +UNZIPSFX= unzipsfx +UPTIME= uptime +UUDECODE= uudecode +UUENCODE= uuencode +UUIDGEN= uuidgen +VI= vi +VIEW= view +VIM= vim +VIMDIFF= vimdiff +W= w +WAIT4PATH= wait4path +WAIT= wait +WC= wc +WGET= wget +WHAT= what +WHATIS= whatis +WHICH= which +WHO= who +WHOAMI= whoami +WHOIS= whois +WRTIE= write +XAR= xar +XARGS= xargs +XATTR= xattr +XXD= xxd +YACC= yacc +YES= yes +ZCAT= zcat +ZCMP= zcmp +ZDIFF= zdiff +ZEGREP= zegrep +ZFGREP= zfgrep +ZFORCE= zforce +ZGREP= zgrep +ZIP= zip +ZIPCLOAK= zipcloak +ZIPGREp= zipgrep +ZIPINFo= zipinfo +ZIPNOTE= zipnote +ZIPSPLIT= zipsplit +ZLESS= zless +ZMORE= zmore +ZNEW= znew +ZPRINT= zprint +ZSH= zsh + +# Set X11_LIBDIR to the directory where the X11 library resides # -kivinen.orig: kivinen.orig.c - $(CC) $(CFLAGS) kivinen.orig.c -o kivinen.orig -lX11 \ - -lsocket -lresolv -lnsl +#X11_LIBDIR= /usr/X11R6/lib +#X11_LIBDIR= /usr/X11/lib +X11_LIBDIR= /opt/X11/lib -imc: imc.c - $(CC) $(CFLAGS) imc.c -o imc - -# NOTE: this is the original program that won +# Set X11_INCLUDEDIR to the directory where the X11 include files reside # -imc.orig: imc.orig.c - $(CC) $(CFLAGS) imc.orig.c -o imc.orig +#X11_INCDIR= /usr/X11R6/include +#X11_INCDIR= /usr/X11/include +X11_INCDIR= /opt/X11/include -lush: lush.c - $(CC) $(CFLAGS) lush.c -o lush - -lush.again: lush.c - $(CC) $(CFLAGS) lush.c -o lush.again - $(RM) -f lush.again - -# NOTE: this is the original program that won +# Common C compiler warnings to silence # -lush.orig: lush.orig.c - $(CC) $(CFLAGS) lush.orig.c -o lush.orig +#CSILENCE= +CSILENCE= -Wno-bitwise-op-parentheses -Wno-error -Wno-implicit-function-declaration \ + -Wno-logical-op-parentheses -Wno-main-return-type -Wno-missing-braces \ + -Wno-parentheses -Wno-return-type -Wno-tautological-bitwise-compare \ + -Wno-unsequenced -# NOTE: some systems may need: +# Common C compiler warning flags # -# $(CC) $(CFLAGS) marangon.c -o marangon -lcurses -ltermcap +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +#CWARN= -Wall -Wextra ${CSILENCE} +CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # -marangon: marangon.c - $(CC) $(CFLAGS) marangon.c -o marangon -lcurses +#CSTD= +#CSTD= -ansi +CSTD= -std=gnu90 -# NOTE: this is the original program that won +# Compiler bit architecture # -# NOTE: some systems may need: +# Some entries require 32-bitness: +# ARCH= -m32 # -# $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses -ltermcap +# Some entries require 64-bitness: +# ARCH= -m64 # -marangon.orig: marangon.orig.c - $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses - -nathan: nathan.c - $(CC) $(CFLAGS) nathan.c -o nathan - -# NOTE: this is the original program that won +# By default we assume nothing: # -nathan.orig: nathan.orig.c - $(CC) $(CFLAGS) nathan.orig.c -o nathan.orig +ARCH= -vern: vern.tmp.c - $(CC) $(CFLAGS) vern.tmp.c -o vern - -vern.tmp.c: vern.c - $(RM) -f vern.tmp.c - $(SED) vern.tmp.c - -# NOTE: this is the original program that won +# Defines that are needed to compile # -vern.orig: vern.orig.tmp.c - $(CC) $(CFLAGS) vern.orig.tmp.c -o vern.orig +CDEFINE= +#CDEFINE= -DIOCCC -vern.orig.tmp.c: vern.orig.c - $(RM) -f vern.orig.tmp.c - $(SED) vern.orig.tmp.c - -westley: westley.c - $(CC) $(CFLAGS) westley.c -o westley - -# alternate names for selected entries +# Include files that are needed to compile # -adgrep: adrian - $(RM) -f adgrep - $(LN) adrian adgrep -am: ant - $(RM) -f am - $(LN) ant am -babble: buzzard.1 - $(RM) -f babble - $(LN) buzzard.1 babble -first: buzzard.2 - $(RM) -f first - $(LN) buzzard.2 first -ag: gson - $(RM) -f ag - $(LN) gson ag -whereami: westley - $(RM) -f whereami - $(LN) westley whereami +CINCLUDE= +#CINCLUDE= -include stdlib.h +#CINCLUDE= -include stdio.h +#CINCLUDE= -include stdlib.h -include stdio.h +#CINCLUDE= -I ${X11_INCDIR} +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 +# Optimization +# +# Most compiles will safely use -O2. Some can use only -O1 or -O. +# A few compilers have broken optimizers or this entry make break +# under those buggy optimizers and thus you may not want anything. +# Reasonable compilers will allow for -O3. +# +#OPT= +#OPT= -O +#OPT= -O1 +#OPT= -O2 +OPT= -O3 + +# Default flags for ANSI C compilation +# +CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} + +# Libraries needed to build +# +#LIBS= +LIBS= -lcurses +#LIBS= -L ${X11_LIBDIR} -lX11 +#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL + +# C compiler to use +# +CC= cc +#CC=clang +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-comma -Wno-missing-prototypes -Wno-missing-variable-declarations \ + -Wno-poison-system-directories -Wno-strict-prototypes -Wno-unreachable-code +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif + + +############################## +# Special flags for this entry +############################## +# +ENTRY= marangon +PROG= ${ENTRY} +# +OBJ= ${PROG}.o +DATA= +TARGET= ${PROG} +# +ALT_OBJ= +ALT_TARGET= + + +################# +# build the entry +################# +# +all: data ${TARGET} + @${TRUE} + +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto + +${PROG}: ${PROG}.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + +# alternative executable +# +alt: data ${ALT_TARGET} + @${TRUE} + +# data files +# +data: ${DATA} + @${TRUE} + +# both all and alt +# +everything: all alt + + +############### +# utility rules +############### +# clean: - $(RM) -f *.o a.out core - $(RM) -f vern.tmp.c lush.again babble.cppcb vern.orig.tmp.c - $(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c + ${RM} -f ${OBJ} ${ALT_OBJ} + @-if [ -f indent.c ]; then \ + echo ${RM} -f indent.c; \ + ${RM} -f indent.c; \ + fi clobber: clean - $(RM) -f $(WINNERS) a.out - $(RM) -f $(ALT_NAMES) - $(RM) -f adwc adbasename adecho adhead adsleep - $(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig - $(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig + ${RM} -f ${TARGET} ${ALT_TARGET} + @-if [ -e sandwich ]; then \ + ${RM} -f sandwich; \ + echo 'ate sandwich'; \ + fi -am_clobber: clean am - $(RM) -f am.safe - $(CP) am am.safe - $(RM) -f $(WINNERS) a.out - $(RM) -f $(ALT_NAMES) - $(RM) -f adwc adbasename adecho adhead adsleep - $(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig - $(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig - $(CP) am.safe am - $(RM) -f am.safe +install: + @echo "Dr. Spock says that is not logical!" + @${TRUE} -nuke: clobber - @true +# you may be able to misunderstand the source by reading indent.c +# +indent.c: ${PROG}.c + @if which "${GINDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${GINDENT} < $< > $@"; \ + ${GINDENT} < $< > $@; \ + elif which "${INDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${INDENT} < $< > $@"; \ + ${INDENT} < $< > $@; \ + else \ + echo "no intent tool found, ident $< yourself, sorry"; \ + echo "exit 1"; \ + exit 1; \ + fi -install: all - cat $(WINNERS) > /dev/null + +################## +# 133t hacker rulz +################## +# +love: + @echo 'not war?' + @${TRUE} + +haste: + $(MAKE) waste + @${TRUE} + +waste: + @echo 'haste' + @${TRUE} + +maker: + @echo 'Participate in a maker faire' + @${TRUE} + +easter_egg: + @echo "you expected to often misunderstand this $${RANDOM} magic" + @echo "chongo '' /\\oo/\\" + @echo "Eggy" + +sandwich: easter_egg + @if [ `id -u` -eq 0 ]; then \ + echo 'Okay.'; \ + echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ + else \ + echo 'What? Make it yourself.'; \ + exit 1; \ + fi + +# Understand the history of the Homebrew Computer Club +# as well as the West Coast Computer Faire and +# you might be confused different. :-) +# +supernova: sandwich + @-if [ -r .code_anal ]; then \ + ${RM} -f .code_anal_v6; \ + else \ + echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ + fi + @echo "A $@ helps ${MAKE} the elements that help form planets" + @${TRUE} + +deep_magic: supernova + @-if [ -r .code_anal ]; then \ + ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ + --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + fi + @${TRUE} + +magic: deep_magic + @-if [ -r .code_anal ]; then \ + ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "If you don't eat yer meat, you can't have any pudding!"; \ + echo "How can you have any pudding if you don't eat yer meat?!"; \ + fi + @${TRUE} + +# The IOCCC resident astronomer states +# +charon: magic + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore IAU, $@ is a planet" + +pluto: charon + ${MAKE} charon + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore, $@ is a planet" + @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" diff --git a/1992/marangon/README.md b/1992/marangon/README.md index edd3cab06..b3a39ed4e 100644 --- a/1992/marangon/README.md +++ b/1992/marangon/README.md @@ -1,4 +1,4 @@ -Best Game: +# Best Game: Marangoni Andrea Department of Computer Science at Milano @@ -6,10 +6,15 @@ Best Game: 62014 Corridonia (MC) Italy +## To build: -Judges' comments: + make all - Make and run. +### To run + + ./marangon + +## Judges' comments The object is to refill the table with 5's, by incrementing or decrementing numbers as needed. It is the side effects @@ -25,8 +30,7 @@ Judges' comments: systems where exit returned a void. The file marangon.c avoids this problem. - -Selected notes from the author: +## Author's comments It starts off by creating a table with number 5 in all places. The CPU melts the numbers and you must return them in original state. diff --git a/1992/marangon/marangon.orig.c b/1992/marangon/marangon.orig.c deleted file mode 100644 index f40631a7a..000000000 --- a/1992/marangon/marangon.orig.c +++ /dev/null @@ -1,77 +0,0 @@ -#include -#include - -#define ST strchr -#define SRD srand48 -#define RD lrand48 - -#define Q return -#define W wrefresh(r) -typedef int i; - -#define Z(d,a) (RD()%((a)-(d)+1)+(d)) -i f[3][3] = {15,52,36,20,-39,48,60,0,-25}; - -char z[6][6]; -#define Y(x) (4*(x)+3) -#define X(x) (2*(x)+1) -#define I for -WINDOW *r=NULL; -#define K endwin() - -char *g ="\ -Use l-h-k-j for move.\nUse + for increment. Use - for decrement.\nUse Q to quit."; - -i (*d())(); -nt() -{ -long time(); -SRD(time((i *)0)); -memset(z,5,36); -initscr(); -cbreak(); -noecho(); -nonl(); -if (COLS<80||LINES<24) -K,exit(1); -if (!(r=newwin(X(6),Y(6), -(LINES-X(6))/2,(COLS-Y(6))/2))) -K,exit(1); -mvaddstr(LINES-5,0,g); -refresh(); -} -i ci() -{ -i x,y=0; -I (;y<6;++y) -I(x=0;x<6;++x) -mvwaddch(r,X(y),Y(x),z[x][y]+'0'); Q(0); -} -void main() -{ -char *ST(); -i a=0,b=0,c,q,t,s,x,sc=0; -i(*(*p)())()=(nt(),d); -I(x=0 ; x++<20; )d(Z(0,5),Z(0,5),Z(1,2)); -I(t=Z(0,2),q=s=0; q<3; s+=f[q][t]*f[q++][t]); -I(box(r,'|','-'),ci(),wmove(r,X(a),Y(b)), -W; (ST ("+-Qlkjh",(char)(c=wgetch(r))))&& -((i)((i)(q^=s%=Y(q),s/=2)!=(i)(s^=q)&&c&64&&(!(c&7|0)&&--b<0&& -(b=q^s)&0|| c&4&&++b==6&&c&4<(~b&23?q^=s,b^=b -:b&12?b=3:b|2)||c&2&&~c&1&&++a==++q/2+1&&c&16>( -!a|12?a=7,a&=~a:a|4?a=2:a&2)||~c&4&&c& -1&&--a<0&&(a+=6)&0)||~c&64&&(**p(b,a,~c))()|| -c&16)?K,exit(0):1)||c; sc==36?ci(),W,K,exit(0):wmove(r,X(a),Y(b)), -W) -I(t=Z(0,2),q=s=0; q<3; s+=f[q][t]*f[q++][t]) -I(sc=0; sc<36&&*((char *)z+sc++)==5; ); -} -i (*d(a,b,c))()i a,b,c; -{ -i x,y; -I(x=a>0?a-1:0; x<=(a<5?a+1:5); ++x) -I(y=b>0?b-1:0; y<=(b<5?b+1:5); ++y) -if(x==a&&y==b&&z[x][y]==(c&2?1:9)||z[x][y]==(c&2?9:1)&&(x!=a||y!=b))Q(ci); -I(x=a>0?a-1:0; x<=(a<5?a+1:5); x++) -I(y=b>0?b-1:0; y<=(b<5?b+1:5)&&(x==a&&y==b&&(z[x][y]+=(c&2?-1:1))||(z[x][y]+=(c&2?1:-1))); y++); Q(ci); -} diff --git a/1992/nathan/.gitignore b/1992/nathan/.gitignore new file mode 100644 index 000000000..2abfe6cf3 --- /dev/null +++ b/1992/nathan/.gitignore @@ -0,0 +1 @@ +nathan diff --git a/1992/nathan/Makefile b/1992/nathan/Makefile index 2eb115d13..cca692254 100644 --- a/1992/nathan/Makefile +++ b/1992/nathan/Makefile @@ -1,244 +1,593 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1992 makefile +# IOCCC 1992 winning entry - nathan + +################################################################################ # -# Copyright (c) 1992, Landon Curt Noll & Larry Bassel. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll and Larry Bassel. - - -SHELL=/bin/sh -CHMOD=chmod -CP=cp -RM=rm -SED=sed -LN=ln -UNIQ=uniq -CB=cb -GREP=grep -# set this to where your C Processor resides +# An Historical Makefile NOTE: # -# On some systems: -# CPP=/lib/cpp +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. # -CPP=/usr/ccs/lib/acpp - -# flags for ansi compiles +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. # -# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, -# others such as gcc may want -ansi, others may want nothing -# at all. Adjust the CFLAGS line as needed. +# Regarding individual entries: # -# NOTE: Some compilers cannot optimize, or optimize some entries -# entries incorrectly. You might want need to turn on -O -# to see if your compiler can handle them. +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. # -#CFLAGS=-O -Xa -CFLAGS=-Xa -CC=cc - -# misc shell babble +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. # -NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/' -SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g' -CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*' - -# winners that compile under ANSI C +# GitHub pull requests are welcome: # -WINNERS= adrian albert ant buzzard.1 buzzard.2 gson kivinen imc \ - lush marangon nathan vern westley -ALT_NAMES= adgrep am babble first ag whereami - -all: $(WINNERS) $(ALT_NAMES) - -adrian: adrian.c - $(CC) $(CFLAGS) adrian.c -o adrian - $(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c - $(SED) '1s/\..*\./. wc ./' adrian.c > ad.temp - -./adrian ad.temp adwc.c - $(CC) -o adwc adwc.c - $(SED) '1s/\..*\./. basename ./' adrian.c > ad.temp - -./adrian ad.temp adbasename.c - $(CC) -o adbasename adbasename.c - $(SED) '1s/\..*\./. echo| ./' adrian.c > ad.temp - -./adrian ad.temp adecho.c - $(CC) -o adecho adecho.c - $(SED) '1s/\..*\./. head; ./' adrian.c > ad.temp - -./adrian ad.temp adhead.c - $(CC) -o adhead adhead.c - $(SED) '1s/\..*\./. sleep ./' adrian.c > ad.temp - -./adrian ad.temp adsleep.c - $(CC) -o adsleep adsleep.c - $(RM) -f ad.temp - -# NOTE: this is the original source that won +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judges to +# consider. # -adrian.orig: adrian.orig.c - $(CC) $(CFLAGS) adrian.orig.c -o adrian.orig - -albert: albert.c - $(CC) $(CFLAGS) albert.c -o albert - -# NOTE: this is the original source that won +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: # -albert.orig: albert.orig.c - $(CC) $(CFLAGS) albert.orig.c -o albert.orig - -ant: ant.c - $(CC) $(CFLAGS) ant.c -o ant - -buzzard.1: buzzard.1.c - $(CC) $(CFLAGS) buzzard.1.c -o buzzard.1 - -babble.cppcb: buzzard.1.c - $(NOINCLUDE) buzzard.1.c | \ - $(CPP) $(CPPFLAGS) | \ - $(CPPCLEAN) | \ - $(CB) $(CBFLAGS) | \ - $(UNIQ) | \ - $(SPACECLEAN) > babble.cppcb 2>&1 - -buzzard.2: buzzard.2.c - $(CC) $(CFLAGS) buzzard.2.c -o buzzard.2 - -# NOTE: this is the original source that won +# https://github.com/ioccc-src/winner # -buzzard.2.orig: buzzard.2.orig.c - $(CC) $(CFLAGS) buzzard.2.orig.c -o buzzard.2.orig +################################################################################ -gson: gson.c - $(CC) $(CFLAGS) gson.c -o gson - -# NOTE: some systems may only need: +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: # -# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 +# Creative Commons Attribution-ShareAlike 3.0 Unported License. # -kivinen: kivinen.c - $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -lsocket -lresolv -lnsl +# See: http://creativecommons.org/licenses/by-sa/3.0/ -# NOTE: this is the original program that won + +############################# +# shell used by this Makefile +############################# # -# NOTE: some systems may only need: +SHELL= bash + +####################### +# common tool locations +####################### # -# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 +A2P= a2p +AR= ar +ASA= asa +AT= at +ATQ= atq +ATRM= atrm +AWK= awk +BANNER= banner +BASE64= base64 +BASENAME= basename +BATCH= batch +BC= bc +BINHEX= binhex +BISON= bison +BUNZIP2= bunzip2 +BZCAT= bzcat +BZCMP= bzcmp +BZDIFF= bzdiff +BZEGREP= bzegrep +BZFGREP= bzfgrep +BZGREP= bzgrep +BZIP2= bzip2 +BZLESS= bzless +BZMORE= bzmore +C2PH= c2ph +C89= c89 +C99= c99 +CAL= cal +CALC= calc +CAT= cat +CD= cd +CHFLAGS= chflags +CHGRP= chgrp +CHMOD= chmod +CKSUM= cksum +CLANG= clang +CLANG_PLUSPLUS= clang++ +CLEAR= clear +CMP= cmp +COL= col +COLLDEF= colldef +COLRM= colrm +COLUMN= column +COMPRESS= compress +CP= cp +CPIO= cpio +CPP= cpp +CRC32= crc32 +CSH= csh +CSPLIT= csplit +CURL= curl +CUT= cut +C_PLUSPLUS= c++ +C_PLUSPLUS_FILT= c++filt +DATE= date +DC= dc +DD= dd +DF= df +DIFF3= diff3 +DIFF= diff +DIG= dig +DIRNAME= dirname +ED= ed +EGREP= egrep +ENV= env +EQN= eqn +ETAGS= etags +EXPECT= expect +EXPR= expr +FALSE= false +FGREP= fgrep +FILE= file +FIND2PERL= find2perl +FIND= find +FLEX= flex +FLEX_PLUSPLUS= flex++ +FMT= fmt +FOLD= fold +FS_USAGE= fs_usage +FUNZIP= funzip +FUSER= fuser +GCC= gcc +GDIFFMK= gdiffmk +GENCAT= gencat +GENSTRINGS= genstrings +GETOPT= getopt +GETOPTS= getopts +GINDENT= gindent +GNUMAKE= gnumake +GREP= grep +GROFF= groff +GROFFER= groffer +GROG= grog +GROPS= grops +GROTTY= grotty +GUNZIP= gunzip +GVIM= gvim +GZCAT= gzcat +GZEXE= gzexe +GZIP_PROG= gzip +G_PLUSPLUS= g++ +H2PH= h2ph +H2XS= h2xs +HASH= hash +HEAD= head +HOSTNAME_PROG= hostname +ICONV= iconv +ID= id +INDENT= indent +INFO= info +JOT= jot +KILL= kill +KSH= ksh +LAST= last +LD= ld +LESSECHO= lessecho +LEX= len +LINK= link +LN= ln +LS= ls +M4= m4 +MAKE= make +MAN= man +MKDIR= mkdir +MKFIFO= mkfifo +MKTEMP= mktemp +MV= mv +NANO= nano +NASM= nasm +NEQN= neqn +NICE= nice +NL= nl +NM= nm +NOHUP= nohup +NROFF= nroff +NSLOOKUP= nslookup +OD= od +OPENSSL= openssl +PASTE= paste +PATCH= patch +PATHCHK= pathchk +PAX= pax +PERL= perl +PICO= pico +PR= pr +PRINTENV= printenv +PS= ps +PTAR= ptar +PTARDIFF= ptardiff +PTARGREP= ptargrep +PWD= pwd +PYDOC= pydoc +PYTHON= python +PYTHONW= pythonw +READLINK= readlink +RENICE= renice +RESET= reset +REV= rev +RI= ri +RM= rm +RMDIR= rmdir +RSYNC= rsync +RUBY= ruby +RVIM= rvim +SAY= say +SCP= scp +SCREEN= screen +SCRIPT= script +SDIFF= sdiff +SED= sed +SEQ= seq +SFTP= sftp +SH= sh +SHA1= sha1 +SHA= sha +SHAR= shar +SHASUM5_18= shasum5.18 +SHASUM= shasum +SIZE= size +SLEEP= sleep +SORT= sort +SSH= ssh +STAT= stat +STRIP= strip +STTY= stty +SUM= sum +SYNC= sync +TABS= tabs +TAIL= tail +TAR= tar +TEE= tee +TEST= test +TFTP= tftp +TIDY= tidy +TIME= time +TOP= top +TOUCH= touch +TPUT= tout +TPUT= tput +TR= tr +TROFF= troff +TRUE= true +TSET= tset +TSORT= tsort +UL= ul +UNAME= uname +UNCOMPRESS= uncompress +UNEXPAND= unexpand +UNIFDEF= unifdef +UNIFDEFALL= unifdefall +UNIQ= uniq +UNITS= units +UNLINK= unlink +UNZIP= unzip +UNZIPSFX= unzipsfx +UPTIME= uptime +UUDECODE= uudecode +UUENCODE= uuencode +UUIDGEN= uuidgen +VI= vi +VIEW= view +VIM= vim +VIMDIFF= vimdiff +W= w +WAIT4PATH= wait4path +WAIT= wait +WC= wc +WGET= wget +WHAT= what +WHATIS= whatis +WHICH= which +WHO= who +WHOAMI= whoami +WHOIS= whois +WRTIE= write +XAR= xar +XARGS= xargs +XATTR= xattr +XXD= xxd +YACC= yacc +YES= yes +ZCAT= zcat +ZCMP= zcmp +ZDIFF= zdiff +ZEGREP= zegrep +ZFGREP= zfgrep +ZFORCE= zforce +ZGREP= zgrep +ZIP= zip +ZIPCLOAK= zipcloak +ZIPGREp= zipgrep +ZIPINFo= zipinfo +ZIPNOTE= zipnote +ZIPSPLIT= zipsplit +ZLESS= zless +ZMORE= zmore +ZNEW= znew +ZPRINT= zprint +ZSH= zsh + +# Set X11_LIBDIR to the directory where the X11 library resides # -kivinen.orig: kivinen.orig.c - $(CC) $(CFLAGS) kivinen.orig.c -o kivinen.orig -lX11 \ - -lsocket -lresolv -lnsl +#X11_LIBDIR= /usr/X11R6/lib +#X11_LIBDIR= /usr/X11/lib +X11_LIBDIR= /opt/X11/lib -imc: imc.c - $(CC) $(CFLAGS) imc.c -o imc - -# NOTE: this is the original program that won +# Set X11_INCLUDEDIR to the directory where the X11 include files reside # -imc.orig: imc.orig.c - $(CC) $(CFLAGS) imc.orig.c -o imc.orig +#X11_INCDIR= /usr/X11R6/include +#X11_INCDIR= /usr/X11/include +X11_INCDIR= /opt/X11/include -lush: lush.c - $(CC) $(CFLAGS) lush.c -o lush - -lush.again: lush.c - $(CC) $(CFLAGS) lush.c -o lush.again - $(RM) -f lush.again - -# NOTE: this is the original program that won +# Common C compiler warnings to silence # -lush.orig: lush.orig.c - $(CC) $(CFLAGS) lush.orig.c -o lush.orig +CSILENCE= +#CSILENCE= -Wno-implicit-int -# NOTE: some systems may need: +# Common C compiler warning flags # -# $(CC) $(CFLAGS) marangon.c -o marangon -lcurses -ltermcap +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +#CWARN= -Wall -Wextra ${CSILENCE} +CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # -marangon: marangon.c - $(CC) $(CFLAGS) marangon.c -o marangon -lcurses +#CSTD= +#CSTD= -ansi +CSTD= -std=gnu90 -# NOTE: this is the original program that won +# Compiler bit architecture # -# NOTE: some systems may need: +# Some entries require 32-bitness: +# ARCH= -m32 # -# $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses -ltermcap +# Some entries require 64-bitness: +# ARCH= -m64 # -marangon.orig: marangon.orig.c - $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses - -nathan: nathan.c - $(CC) $(CFLAGS) nathan.c -o nathan - -# NOTE: this is the original program that won +# By default we assume nothing: # -nathan.orig: nathan.orig.c - $(CC) $(CFLAGS) nathan.orig.c -o nathan.orig +ARCH= -vern: vern.tmp.c - $(CC) $(CFLAGS) vern.tmp.c -o vern - -vern.tmp.c: vern.c - $(RM) -f vern.tmp.c - $(SED) vern.tmp.c - -# NOTE: this is the original program that won +# Defines that are needed to compile # -vern.orig: vern.orig.tmp.c - $(CC) $(CFLAGS) vern.orig.tmp.c -o vern.orig +CDEFINE= +#CDEFINE= -DIOCCC -vern.orig.tmp.c: vern.orig.c - $(RM) -f vern.orig.tmp.c - $(SED) vern.orig.tmp.c - -westley: westley.c - $(CC) $(CFLAGS) westley.c -o westley - -# alternate names for selected entries +# Include files that are needed to compile # -adgrep: adrian - $(RM) -f adgrep - $(LN) adrian adgrep -am: ant - $(RM) -f am - $(LN) ant am -babble: buzzard.1 - $(RM) -f babble - $(LN) buzzard.1 babble -first: buzzard.2 - $(RM) -f first - $(LN) buzzard.2 first -ag: gson - $(RM) -f ag - $(LN) gson ag -whereami: westley - $(RM) -f whereami - $(LN) westley whereami +CINCLUDE= +#CINCLUDE= -include stdlib.h +#CINCLUDE= -include stdio.h +#CINCLUDE= -include stdlib.h -include stdio.h +#CINCLUDE= -I ${X11_INCDIR} +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 +# Optimization +# +# Most compiles will safely use -O2. Some can use only -O1 or -O. +# A few compilers have broken optimizers or this entry make break +# under those buggy optimizers and thus you may not want anything. +# Reasonable compilers will allow for -O3. +# +#OPT= +#OPT= -O +#OPT= -O1 +#OPT= -O2 +OPT= -O3 + +# Default flags for ANSI C compilation +# +CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} + +# Libraries needed to build +# +LIBS= +#LIBS= -lm +#LIBS= -L ${X11_LIBDIR} -lX11 +#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL + +# C compiler to use +# +CC= cc +#CC=clang +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-poison-system-directories +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif + + +############################## +# Special flags for this entry +############################## +# +ENTRY= nathan +PROG= ${ENTRY} +# +OBJ= ${PROG}.o +DATA= +TARGET= ${PROG} +# +ALT_OBJ= +ALT_TARGET= + + +################# +# build the entry +################# +# +all: data ${TARGET} + @${TRUE} + +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto + +${PROG}: ${PROG}.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + +# alternative executable +# +alt: data ${ALT_TARGET} + @${TRUE} + +# data files +# +data: ${DATA} + @${TRUE} + +# both all and alt +# +everything: all alt + + +############### +# utility rules +############### +# clean: - $(RM) -f *.o a.out core - $(RM) -f vern.tmp.c lush.again babble.cppcb vern.orig.tmp.c - $(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c + ${RM} -f ${OBJ} ${ALT_OBJ} + @-if [ -f indent.c ]; then \ + echo ${RM} -f indent.c; \ + ${RM} -f indent.c; \ + fi clobber: clean - $(RM) -f $(WINNERS) a.out - $(RM) -f $(ALT_NAMES) - $(RM) -f adwc adbasename adecho adhead adsleep - $(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig - $(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig + ${RM} -f ${TARGET} ${ALT_TARGET} + @-if [ -e sandwich ]; then \ + ${RM} -f sandwich; \ + echo 'ate sandwich'; \ + fi -am_clobber: clean am - $(RM) -f am.safe - $(CP) am am.safe - $(RM) -f $(WINNERS) a.out - $(RM) -f $(ALT_NAMES) - $(RM) -f adwc adbasename adecho adhead adsleep - $(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig - $(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig - $(CP) am.safe am - $(RM) -f am.safe +install: + @echo "Dr. Spock says that is not logical!" + @${TRUE} -nuke: clobber - @true +# you may be able to misunderstand the source by reading indent.c +# +indent.c: ${PROG}.c + @if which "${GINDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${GINDENT} < $< > $@"; \ + ${GINDENT} < $< > $@; \ + elif which "${INDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${INDENT} < $< > $@"; \ + ${INDENT} < $< > $@; \ + else \ + echo "no intent tool found, ident $< yourself, sorry"; \ + echo "exit 1"; \ + exit 1; \ + fi -install: all - cat $(WINNERS) > /dev/null + +################## +# 133t hacker rulz +################## +# +love: + @echo 'not war?' + @${TRUE} + +haste: + $(MAKE) waste + @${TRUE} + +waste: + @echo 'haste' + @${TRUE} + +maker: + @echo 'Participate in a maker faire' + @${TRUE} + +easter_egg: + @echo "you expected to often misunderstand this $${RANDOM} magic" + @echo "chongo '' /\\oo/\\" + @echo "Eggy" + +sandwich: easter_egg + @if [ `id -u` -eq 0 ]; then \ + echo 'Okay.'; \ + echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ + else \ + echo 'What? Make it yourself.'; \ + exit 1; \ + fi + +# Understand the history of the Homebrew Computer Club +# as well as the West Coast Computer Faire and +# you might be confused different. :-) +# +supernova: sandwich + @-if [ -r .code_anal ]; then \ + ${RM} -f .code_anal_v6; \ + else \ + echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ + fi + @echo "A $@ helps ${MAKE} the elements that help form planets" + @${TRUE} + +deep_magic: supernova + @-if [ -r .code_anal ]; then \ + ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ + --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + fi + @${TRUE} + +magic: deep_magic + @-if [ -r .code_anal ]; then \ + ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "If you don't eat yer meat, you can't have any pudding!"; \ + echo "How can you have any pudding if you don't eat yer meat?!"; \ + fi + @${TRUE} + +# The IOCCC resident astronomer states +# +charon: magic + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore IAU, $@ is a planet" + +pluto: charon + ${MAKE} charon + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore, $@ is a planet" + @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" diff --git a/1992/nathan/README.md b/1992/nathan/README.md index 350180c85..af1545e92 100644 --- a/1992/nathan/README.md +++ b/1992/nathan/README.md @@ -1,4 +1,4 @@ -Worst Abuse of the Rules: +# Worst Abuse of the Rules: Nathan Sidwell Inmos UK @@ -7,8 +7,15 @@ Worst Abuse of the Rules: Bristol UK BS12 4SQ +## To build: -Judges' comments: + make all + +### To run + + ./nathan + +## Judges' comments The US International Traffic in Arms Regulations controls certain exportations going out of the United States. The U.S. Munitions @@ -54,8 +61,7 @@ Judges' comments: rules entries are ones that tend to 'streach' the limits and take the contest into unexpected territory. - -Personal note from chongo: +### Personal note from chongo: I think this situation shows just how ridiculous US crypto regulations really are. Certain US federal officials can get away @@ -63,8 +69,7 @@ Personal note from chongo: laws, but I personally can't re-distribute a program contest winner to the network! - -Selected notes from the author: +## Author's comments PROGRAM USE diff --git a/1992/vern/.gitignore b/1992/vern/.gitignore new file mode 100644 index 000000000..b287f41f9 --- /dev/null +++ b/1992/vern/.gitignore @@ -0,0 +1,2 @@ +vern +vern.tmp.c diff --git a/1992/vern/Makefile b/1992/vern/Makefile index 2eb115d13..e13c36320 100644 --- a/1992/vern/Makefile +++ b/1992/vern/Makefile @@ -1,244 +1,603 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1992 makefile +# IOCCC 1992 winning entry - vern + +################################################################################ # -# Copyright (c) 1992, Landon Curt Noll & Larry Bassel. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll and Larry Bassel. - - -SHELL=/bin/sh -CHMOD=chmod -CP=cp -RM=rm -SED=sed -LN=ln -UNIQ=uniq -CB=cb -GREP=grep -# set this to where your C Processor resides +# An Historical Makefile NOTE: # -# On some systems: -# CPP=/lib/cpp +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. # -CPP=/usr/ccs/lib/acpp - -# flags for ansi compiles +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. # -# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, -# others such as gcc may want -ansi, others may want nothing -# at all. Adjust the CFLAGS line as needed. +# Regarding individual entries: # -# NOTE: Some compilers cannot optimize, or optimize some entries -# entries incorrectly. You might want need to turn on -O -# to see if your compiler can handle them. +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. # -#CFLAGS=-O -Xa -CFLAGS=-Xa -CC=cc - -# misc shell babble +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. # -NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/' -SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g' -CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*' - -# winners that compile under ANSI C +# GitHub pull requests are welcome: # -WINNERS= adrian albert ant buzzard.1 buzzard.2 gson kivinen imc \ - lush marangon nathan vern westley -ALT_NAMES= adgrep am babble first ag whereami - -all: $(WINNERS) $(ALT_NAMES) - -adrian: adrian.c - $(CC) $(CFLAGS) adrian.c -o adrian - $(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c - $(SED) '1s/\..*\./. wc ./' adrian.c > ad.temp - -./adrian ad.temp adwc.c - $(CC) -o adwc adwc.c - $(SED) '1s/\..*\./. basename ./' adrian.c > ad.temp - -./adrian ad.temp adbasename.c - $(CC) -o adbasename adbasename.c - $(SED) '1s/\..*\./. echo| ./' adrian.c > ad.temp - -./adrian ad.temp adecho.c - $(CC) -o adecho adecho.c - $(SED) '1s/\..*\./. head; ./' adrian.c > ad.temp - -./adrian ad.temp adhead.c - $(CC) -o adhead adhead.c - $(SED) '1s/\..*\./. sleep ./' adrian.c > ad.temp - -./adrian ad.temp adsleep.c - $(CC) -o adsleep adsleep.c - $(RM) -f ad.temp - -# NOTE: this is the original source that won +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judges to +# consider. # -adrian.orig: adrian.orig.c - $(CC) $(CFLAGS) adrian.orig.c -o adrian.orig - -albert: albert.c - $(CC) $(CFLAGS) albert.c -o albert - -# NOTE: this is the original source that won +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: # -albert.orig: albert.orig.c - $(CC) $(CFLAGS) albert.orig.c -o albert.orig - -ant: ant.c - $(CC) $(CFLAGS) ant.c -o ant - -buzzard.1: buzzard.1.c - $(CC) $(CFLAGS) buzzard.1.c -o buzzard.1 - -babble.cppcb: buzzard.1.c - $(NOINCLUDE) buzzard.1.c | \ - $(CPP) $(CPPFLAGS) | \ - $(CPPCLEAN) | \ - $(CB) $(CBFLAGS) | \ - $(UNIQ) | \ - $(SPACECLEAN) > babble.cppcb 2>&1 - -buzzard.2: buzzard.2.c - $(CC) $(CFLAGS) buzzard.2.c -o buzzard.2 - -# NOTE: this is the original source that won +# https://github.com/ioccc-src/winner # -buzzard.2.orig: buzzard.2.orig.c - $(CC) $(CFLAGS) buzzard.2.orig.c -o buzzard.2.orig +################################################################################ -gson: gson.c - $(CC) $(CFLAGS) gson.c -o gson - -# NOTE: some systems may only need: +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: # -# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 +# Creative Commons Attribution-ShareAlike 3.0 Unported License. # -kivinen: kivinen.c - $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -lsocket -lresolv -lnsl +# See: http://creativecommons.org/licenses/by-sa/3.0/ -# NOTE: this is the original program that won + +############################# +# shell used by this Makefile +############################# # -# NOTE: some systems may only need: +SHELL= bash + +####################### +# common tool locations +####################### # -# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 +A2P= a2p +AR= ar +ASA= asa +AT= at +ATQ= atq +ATRM= atrm +AWK= awk +BANNER= banner +BASE64= base64 +BASENAME= basename +BATCH= batch +BC= bc +BINHEX= binhex +BISON= bison +BUNZIP2= bunzip2 +BZCAT= bzcat +BZCMP= bzcmp +BZDIFF= bzdiff +BZEGREP= bzegrep +BZFGREP= bzfgrep +BZGREP= bzgrep +BZIP2= bzip2 +BZLESS= bzless +BZMORE= bzmore +C2PH= c2ph +C89= c89 +C99= c99 +CAL= cal +CALC= calc +CAT= cat +CD= cd +CHFLAGS= chflags +CHGRP= chgrp +CHMOD= chmod +CKSUM= cksum +CLANG= clang +CLANG_PLUSPLUS= clang++ +CLEAR= clear +CMP= cmp +COL= col +COLLDEF= colldef +COLRM= colrm +COLUMN= column +COMPRESS= compress +CP= cp +CPIO= cpio +CPP= cpp +CRC32= crc32 +CSH= csh +CSPLIT= csplit +CURL= curl +CUT= cut +C_PLUSPLUS= c++ +C_PLUSPLUS_FILT= c++filt +DATE= date +DC= dc +DD= dd +DF= df +DIFF3= diff3 +DIFF= diff +DIG= dig +DIRNAME= dirname +ED= ed +EGREP= egrep +ENV= env +EQN= eqn +ETAGS= etags +EXPECT= expect +EXPR= expr +FALSE= false +FGREP= fgrep +FILE= file +FIND2PERL= find2perl +FIND= find +FLEX= flex +FLEX_PLUSPLUS= flex++ +FMT= fmt +FOLD= fold +FS_USAGE= fs_usage +FUNZIP= funzip +FUSER= fuser +GCC= gcc +GDIFFMK= gdiffmk +GENCAT= gencat +GENSTRINGS= genstrings +GETOPT= getopt +GETOPTS= getopts +GINDENT= gindent +GNUMAKE= gnumake +GREP= grep +GROFF= groff +GROFFER= groffer +GROG= grog +GROPS= grops +GROTTY= grotty +GUNZIP= gunzip +GVIM= gvim +GZCAT= gzcat +GZEXE= gzexe +GZIP_PROG= gzip +G_PLUSPLUS= g++ +H2PH= h2ph +H2XS= h2xs +HASH= hash +HEAD= head +HOSTNAME_PROG= hostname +ICONV= iconv +ID= id +INDENT= indent +INFO= info +JOT= jot +KILL= kill +KSH= ksh +LAST= last +LD= ld +LESSECHO= lessecho +LEX= len +LINK= link +LN= ln +LS= ls +M4= m4 +MAKE= make +MAN= man +MKDIR= mkdir +MKFIFO= mkfifo +MKTEMP= mktemp +MV= mv +NANO= nano +NASM= nasm +NEQN= neqn +NICE= nice +NL= nl +NM= nm +NOHUP= nohup +NROFF= nroff +NSLOOKUP= nslookup +OD= od +OPENSSL= openssl +PASTE= paste +PATCH= patch +PATHCHK= pathchk +PAX= pax +PERL= perl +PICO= pico +PR= pr +PRINTENV= printenv +PS= ps +PTAR= ptar +PTARDIFF= ptardiff +PTARGREP= ptargrep +PWD= pwd +PYDOC= pydoc +PYTHON= python +PYTHONW= pythonw +READLINK= readlink +RENICE= renice +RESET= reset +REV= rev +RI= ri +RM= rm +RMDIR= rmdir +RSYNC= rsync +RUBY= ruby +RVIM= rvim +SAY= say +SCP= scp +SCREEN= screen +SCRIPT= script +SDIFF= sdiff +SED= sed +SEQ= seq +SFTP= sftp +SH= sh +SHA1= sha1 +SHA= sha +SHAR= shar +SHASUM5_18= shasum5.18 +SHASUM= shasum +SIZE= size +SLEEP= sleep +SORT= sort +SSH= ssh +STAT= stat +STRIP= strip +STTY= stty +SUM= sum +SYNC= sync +TABS= tabs +TAIL= tail +TAR= tar +TEE= tee +TEST= test +TFTP= tftp +TIDY= tidy +TIME= time +TOP= top +TOUCH= touch +TPUT= tout +TPUT= tput +TR= tr +TROFF= troff +TRUE= true +TSET= tset +TSORT= tsort +UL= ul +UNAME= uname +UNCOMPRESS= uncompress +UNEXPAND= unexpand +UNIFDEF= unifdef +UNIFDEFALL= unifdefall +UNIQ= uniq +UNITS= units +UNLINK= unlink +UNZIP= unzip +UNZIPSFX= unzipsfx +UPTIME= uptime +UUDECODE= uudecode +UUENCODE= uuencode +UUIDGEN= uuidgen +VI= vi +VIEW= view +VIM= vim +VIMDIFF= vimdiff +W= w +WAIT4PATH= wait4path +WAIT= wait +WC= wc +WGET= wget +WHAT= what +WHATIS= whatis +WHICH= which +WHO= who +WHOAMI= whoami +WHOIS= whois +WRTIE= write +XAR= xar +XARGS= xargs +XATTR= xattr +XXD= xxd +YACC= yacc +YES= yes +ZCAT= zcat +ZCMP= zcmp +ZDIFF= zdiff +ZEGREP= zegrep +ZFGREP= zfgrep +ZFORCE= zforce +ZGREP= zgrep +ZIP= zip +ZIPCLOAK= zipcloak +ZIPGREp= zipgrep +ZIPINFo= zipinfo +ZIPNOTE= zipnote +ZIPSPLIT= zipsplit +ZLESS= zless +ZMORE= zmore +ZNEW= znew +ZPRINT= zprint +ZSH= zsh + +# Set X11_LIBDIR to the directory where the X11 library resides # -kivinen.orig: kivinen.orig.c - $(CC) $(CFLAGS) kivinen.orig.c -o kivinen.orig -lX11 \ - -lsocket -lresolv -lnsl +#X11_LIBDIR= /usr/X11R6/lib +#X11_LIBDIR= /usr/X11/lib +X11_LIBDIR= /opt/X11/lib -imc: imc.c - $(CC) $(CFLAGS) imc.c -o imc - -# NOTE: this is the original program that won +# Set X11_INCLUDEDIR to the directory where the X11 include files reside # -imc.orig: imc.orig.c - $(CC) $(CFLAGS) imc.orig.c -o imc.orig +#X11_INCDIR= /usr/X11R6/include +#X11_INCDIR= /usr/X11/include +X11_INCDIR= /opt/X11/include -lush: lush.c - $(CC) $(CFLAGS) lush.c -o lush - -lush.again: lush.c - $(CC) $(CFLAGS) lush.c -o lush.again - $(RM) -f lush.again - -# NOTE: this is the original program that won +# Common C compiler warnings to silence # -lush.orig: lush.orig.c - $(CC) $(CFLAGS) lush.orig.c -o lush.orig +#CSILENCE= +CSILENCE= -Wno-bitwise-conditional-parentheses -Wno-dangling-else -Wno-error \ + -Wno-implicit-function-declaration -Wno-parentheses -Wno-pedantic \ + -Wno-return-type -Wno-shift-op-parentheses -# NOTE: some systems may need: +# Common C compiler warning flags # -# $(CC) $(CFLAGS) marangon.c -o marangon -lcurses -ltermcap +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +#CWARN= -Wall -Wextra ${CSILENCE} +CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # -marangon: marangon.c - $(CC) $(CFLAGS) marangon.c -o marangon -lcurses +#CSTD= +#CSTD= -ansi +CSTD= -std=gnu90 -# NOTE: this is the original program that won +# Compiler bit architecture # -# NOTE: some systems may need: +# Some entries require 32-bitness: +# ARCH= -m32 # -# $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses -ltermcap +# Some entries require 64-bitness: +# ARCH= -m64 # -marangon.orig: marangon.orig.c - $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses - -nathan: nathan.c - $(CC) $(CFLAGS) nathan.c -o nathan - -# NOTE: this is the original program that won +# By default we assume nothing: # -nathan.orig: nathan.orig.c - $(CC) $(CFLAGS) nathan.orig.c -o nathan.orig +ARCH= -vern: vern.tmp.c - $(CC) $(CFLAGS) vern.tmp.c -o vern - -vern.tmp.c: vern.c - $(RM) -f vern.tmp.c - $(SED) vern.tmp.c - -# NOTE: this is the original program that won +# Defines that are needed to compile # -vern.orig: vern.orig.tmp.c - $(CC) $(CFLAGS) vern.orig.tmp.c -o vern.orig +CDEFINE= +#CDEFINE= -DIOCCC -vern.orig.tmp.c: vern.orig.c - $(RM) -f vern.orig.tmp.c - $(SED) vern.orig.tmp.c - -westley: westley.c - $(CC) $(CFLAGS) westley.c -o westley - -# alternate names for selected entries +# Include files that are needed to compile # -adgrep: adrian - $(RM) -f adgrep - $(LN) adrian adgrep -am: ant - $(RM) -f am - $(LN) ant am -babble: buzzard.1 - $(RM) -f babble - $(LN) buzzard.1 babble -first: buzzard.2 - $(RM) -f first - $(LN) buzzard.2 first -ag: gson - $(RM) -f ag - $(LN) gson ag -whereami: westley - $(RM) -f whereami - $(LN) westley whereami +CINCLUDE= +#CINCLUDE= -include stdlib.h +#CINCLUDE= -include stdio.h +#CINCLUDE= -include stdlib.h -include stdio.h +#CINCLUDE= -I ${X11_INCDIR} +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 +# Optimization +# +# Most compiles will safely use -O2. Some can use only -O1 or -O. +# A few compilers have broken optimizers or this entry make break +# under those buggy optimizers and thus you may not want anything. +# Reasonable compilers will allow for -O3. +# +#OPT= +#OPT= -O +#OPT= -O1 +#OPT= -O2 +OPT= -O3 + +# Default flags for ANSI C compilation +# +CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} + +# Libraries needed to build +# +LIBS= +#LIBS= -lm +#LIBS= -L ${X11_LIBDIR} -lX11 +#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL + +# C compiler to use +# +CC= cc +#CC=clang +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-comma -Wno-float-conversion -Wno-missing-prototypes \ + -Wno-missing-variable-declarations -Wno-poison-system-directories \ + -Wno-shadow -Wno-strict-prototypes +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif + + +############################## +# Special flags for this entry +############################## +# +ENTRY= vern +PROG= ${ENTRY} +# +OBJ= ${PROG}.o +DATA= +TARGET= ${PROG} +# +ALT_OBJ= +ALT_TARGET= + + +################# +# build the entry +################# +# +all: data ${TARGET} + @${TRUE} + +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto + +${PROG}: ${PROG}.tmp.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + +${PROG}.tmp.c: ${PROG}.c + ${RM} -f $@ + ${SED} <${PROG}.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \ + ${SED} 's/} /=/g;s/{ /i/g' >$@ + +# alternative executable +# +alt: data ${ALT_TARGET} + @${TRUE} + +# data files +# +data: ${DATA} + @${TRUE} + +# both all and alt +# +everything: all alt + + +############### +# utility rules +############### +# clean: - $(RM) -f *.o a.out core - $(RM) -f vern.tmp.c lush.again babble.cppcb vern.orig.tmp.c - $(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c + ${RM} -f ${OBJ} ${ALT_OBJ} + @-if [ -f indent.c ]; then \ + echo ${RM} -f indent.c; \ + ${RM} -f indent.c; \ + fi clobber: clean - $(RM) -f $(WINNERS) a.out - $(RM) -f $(ALT_NAMES) - $(RM) -f adwc adbasename adecho adhead adsleep - $(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig - $(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig + ${RM} -f ${TARGET} ${ALT_TARGET} + ${RM} -f ${PROG}.tmp.c + @-if [ -e sandwich ]; then \ + ${RM} -f sandwich; \ + echo 'ate sandwich'; \ + fi -am_clobber: clean am - $(RM) -f am.safe - $(CP) am am.safe - $(RM) -f $(WINNERS) a.out - $(RM) -f $(ALT_NAMES) - $(RM) -f adwc adbasename adecho adhead adsleep - $(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig - $(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig - $(CP) am.safe am - $(RM) -f am.safe +install: + @echo "Dr. Spock says that is not logical!" + @${TRUE} -nuke: clobber - @true +# you may be able to misunderstand the source by reading indent.c +# +indent.c: ${PROG}.c + @if which "${GINDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${GINDENT} < $< > $@"; \ + ${GINDENT} < $< > $@; \ + elif which "${INDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${INDENT} < $< > $@"; \ + ${INDENT} < $< > $@; \ + else \ + echo "no intent tool found, ident $< yourself, sorry"; \ + echo "exit 1"; \ + exit 1; \ + fi -install: all - cat $(WINNERS) > /dev/null + +################## +# 133t hacker rulz +################## +# +love: + @echo 'not war?' + @${TRUE} + +haste: + $(MAKE) waste + @${TRUE} + +waste: + @echo 'haste' + @${TRUE} + +maker: + @echo 'Participate in a maker faire' + @${TRUE} + +easter_egg: + @echo "you expected to often misunderstand this $${RANDOM} magic" + @echo "chongo '' /\\oo/\\" + @echo "Eggy" + +sandwich: easter_egg + @if [ `id -u` -eq 0 ]; then \ + echo 'Okay.'; \ + echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ + else \ + echo 'What? Make it yourself.'; \ + exit 1; \ + fi + +# Understand the history of the Homebrew Computer Club +# as well as the West Coast Computer Faire and +# you might be confused different. :-) +# +supernova: sandwich + @-if [ -r .code_anal ]; then \ + ${RM} -f .code_anal_v6; \ + else \ + echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ + fi + @echo "A $@ helps ${MAKE} the elements that help form planets" + @${TRUE} + +deep_magic: supernova + @-if [ -r .code_anal ]; then \ + ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ + --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + fi + @${TRUE} + +magic: deep_magic + @-if [ -r .code_anal ]; then \ + ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "If you don't eat yer meat, you can't have any pudding!"; \ + echo "How can you have any pudding if you don't eat yer meat?!"; \ + fi + @${TRUE} + +# The IOCCC resident astronomer states +# +charon: magic + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore IAU, $@ is a planet" + +pluto: charon + ${MAKE} charon + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore, $@ is a planet" + @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" diff --git a/1992/vern/README.md b/1992/vern/README.md index 5c81883d4..3bbfe1e45 100644 --- a/1992/vern/README.md +++ b/1992/vern/README.md @@ -1,4 +1,4 @@ -Best of Show: +# Best of Show: Vern Paxson Lawrence Berkeley Laboratory @@ -8,24 +8,29 @@ Best of Show: 1 Cyclotron Rd. Berkeley, CA 94720 USA +## To build: -Judges' comments: + make all - Try: - make vern - vern 3 <-- default is 2 +### To run + + ./vern 3 # <-- default is 2 + +## Judges' comments You might start off by giving the following input: + 63 43 76 55 71 52 67 57 (this may take a while) - + The judges assume no responsibility for the obfuscated opening suggested above. :-) For a real quick game try: - vern + + ./vern 65 55 66 46 @@ -35,8 +40,7 @@ Judges' comments: NOTE: Because some mailers have problems with the original winning source, a slightly modified version with shorter lines has been provided. - -Selected notes from the author: +## Author's comments This program plays chess. You play the white pieces and the program the black pieces. Moves are entered as a two-digit number specifying diff --git a/1992/vern/vern.orig.c b/1992/vern/vern.orig.c deleted file mode 100644 index 2bcfc2340..000000000 --- a/1992/vern/vern.orig.c +++ /dev/null @@ -1,210 +0,0 @@ -#include -; m(x)(x<0?-1:!!x) -; g tj()-J -; a(x)(x<0?-x:x) -; h(x)((x)<=K?x:N-(x)) -; f 9999 -; A return -; H printf{ -; R double -; U int -; V for -; b else -; u while -; B if -U v,w,Y} -1,W,J,p,F,o} f,M,N,K,X,YY,_,P[f],s{ } ; -typedef U{ *L} { } ; -L q[f]; -tj{ } { -U S} m{ v} +{ m{ w} <1||w-Y||!q[J]:{ w-Y&&{ w-Y*2||q[W+Y*{ N+1} ]|| - { J>>K} -K+{ Y-1} / 2} } ||q[J]; -} -z{ } { -_} 5; -A v*w||g; -} -e{ } { -_} -2; -A{ v*v*v-v||w*w*w-w} &&{ J-W-2||{ W&N} -4||{ W>>K!} { Y-1?N:0} } || - q[W+1]||q[W+2]||q[W+K]!} z||P[W+K]*Y<0} ; -} -R VR{ } { -int PZ} 0x7fff; -A{ R} { rand{ } &PZ} /{ R} PZ; -} -l{ } { -_} K+1; -A{ v*w&&a{ v} -a{ w} } ||g; -} -R UC{ } { -R { } 0,d; -u{ { { +} d} VR{ } } <1.0} ; -A d; -} -c{ } { -_} -11; -A a{ v} -a{ w} ||g; -} -I{ ur,n,x} { -W} ur; -J} n; -B{ P[W]!} Y||P[J]} } Y} A J+1; -v} { J&N} -{ W&N} ; -w} { J>>K} -{ W>>K} ; -A q[W]{ } ||{ x&&QL{ W,J,s} } ; -} -TT{ W} { -v} w} 0; -A q[W]{ } +K; -} -s{ } { -U j} -1,{ ; -Y} -Y; -V{ { } 0; { } 0&&!I{ { ,j,0} } A Y} -Y; -} -A!{ Y} -Y} ; -} -bb{ } { -_} 1; -A a{ v*w} -2; -} -uv{ } { -V{ v} 0; v>K} } } 0} { -U S} h{ v&N} ; -q[v]} !S?z:{ S} } 1?bb:{ S} } 2?c:{ v&N>K?l:e} } } ; -} -b B{ h{ v>>K} } } 1} q[v]} k; -b q[v]} 0; -P[v]} !!q[v]*{ 28-v} ; -} -} -y{ } { -U G} Y,{ ; -J} 0; -V{ { } 0; { >K} } } 0} q[J]} l; -B{ q[W]} } e} B{ J-W} } 2} O{ J+1,J-1} ; -b B{ W-J} } 2} O{ W-1,W+1} ; -P[J]} P[W]; -q[W]} 0; -P[W]} 0; -} -QL{ W,J,D} L D; -{ -U HQ} P[J],YX; -L AJ} q[J],XY} q[W]; -O{ W,J} ; -YX} D{ } ; -O{ J,W} ; -q[J]} AJ; -q[W]} XY; -P[J]} HQ; -A YX; -} -C{ } { -U { ,j,BZ} 0; -V{ { } 0; { >K} +h{ { &N} ,G} Y, - S} Z} } z?88:{ Z} } k?11+r+{ P[{ ]<0?N-{ { >>K} :{ { >>K} } : -{ Z} } l?124-{ { YY<8&&{ { { &N} !} K|| - { { >>K} !} { P[{ ]>0?0:N} } } ?M:0} : -{ Z} } c?41+r:{ Z} } e?f-r-r:36+r+r} } } } ; -Y} P[{ ]; -V{ j} 0; j>K+K,{ &M-1,1} } { -Y} -Y; -o} -E; -t} -QL{ { >>K+K,{ &M-1,PX} ; -Y} -Y; -B{ t>E} { -++XP; -Q} { ; -E} t; -B{ E>} S} -A++F,E; -} -} -B{ !XP} E} s{ } ?-f+1:0; -p} Q; -A++F,E; -} -RZ{ } { -U { ,j,T} 0; -V{ ; ; } { -y{ } ; -o} f; -do{ -H"\n%d %d %d %s ",X,T,C{ } ,s{ } ?"!":">"} ; -fflush{ stdout} ; -} -u{ scanf{ "%o%o",&{ ,&j} !} 2||I{ { ,j,1} } ; -O{ { ,j} ; -y{ } ; -X} 0; -++YY; -Y} -Y; -T} PX{ } ; -{ } p>>{ K<<1} ; -j} p&{ M-1} ; -B{ I{ { ,j,1} } { -H"Rats!\n"} ; -A; -} -O{ { ,j} ; -Y} -Y; -B{ T>M*M} H"\nHar har.\n"} ; -} -} -main{ ac,av} char**av; -{ -long time{ } ,j} time{ &j} ; -R { } 0; -srand{ { U} j} ; -V{ M} 0; M<} f; ++M} { +} UC{ } ; -M} { /100; -B{ M&3} ++M; -B{ M&1} --M; -V{ N} 1; N*N1?atoi{ av[1]} :2; -uv{ } ; -RZ{ } ; -} diff --git a/1992/westley/.gitignore b/1992/westley/.gitignore new file mode 100644 index 000000000..2a0c890f9 --- /dev/null +++ b/1992/westley/.gitignore @@ -0,0 +1 @@ +westley diff --git a/1992/westley/Makefile b/1992/westley/Makefile index 2eb115d13..2bfbfbb2b 100644 --- a/1992/westley/Makefile +++ b/1992/westley/Makefile @@ -1,244 +1,600 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1992 makefile +# IOCCC 1992 winning entry - westley + +################################################################################ # -# Copyright (c) 1992, Landon Curt Noll & Larry Bassel. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll and Larry Bassel. - - -SHELL=/bin/sh -CHMOD=chmod -CP=cp -RM=rm -SED=sed -LN=ln -UNIQ=uniq -CB=cb -GREP=grep -# set this to where your C Processor resides +# An Historical Makefile NOTE: # -# On some systems: -# CPP=/lib/cpp +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. # -CPP=/usr/ccs/lib/acpp - -# flags for ansi compiles +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. # -# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, -# others such as gcc may want -ansi, others may want nothing -# at all. Adjust the CFLAGS line as needed. +# Regarding individual entries: # -# NOTE: Some compilers cannot optimize, or optimize some entries -# entries incorrectly. You might want need to turn on -O -# to see if your compiler can handle them. +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. # -#CFLAGS=-O -Xa -CFLAGS=-Xa -CC=cc - -# misc shell babble +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. # -NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/' -SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g' -CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*' - -# winners that compile under ANSI C +# GitHub pull requests are welcome: # -WINNERS= adrian albert ant buzzard.1 buzzard.2 gson kivinen imc \ - lush marangon nathan vern westley -ALT_NAMES= adgrep am babble first ag whereami - -all: $(WINNERS) $(ALT_NAMES) - -adrian: adrian.c - $(CC) $(CFLAGS) adrian.c -o adrian - $(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c - $(SED) '1s/\..*\./. wc ./' adrian.c > ad.temp - -./adrian ad.temp adwc.c - $(CC) -o adwc adwc.c - $(SED) '1s/\..*\./. basename ./' adrian.c > ad.temp - -./adrian ad.temp adbasename.c - $(CC) -o adbasename adbasename.c - $(SED) '1s/\..*\./. echo| ./' adrian.c > ad.temp - -./adrian ad.temp adecho.c - $(CC) -o adecho adecho.c - $(SED) '1s/\..*\./. head; ./' adrian.c > ad.temp - -./adrian ad.temp adhead.c - $(CC) -o adhead adhead.c - $(SED) '1s/\..*\./. sleep ./' adrian.c > ad.temp - -./adrian ad.temp adsleep.c - $(CC) -o adsleep adsleep.c - $(RM) -f ad.temp - -# NOTE: this is the original source that won +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judges to +# consider. # -adrian.orig: adrian.orig.c - $(CC) $(CFLAGS) adrian.orig.c -o adrian.orig - -albert: albert.c - $(CC) $(CFLAGS) albert.c -o albert - -# NOTE: this is the original source that won +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: # -albert.orig: albert.orig.c - $(CC) $(CFLAGS) albert.orig.c -o albert.orig - -ant: ant.c - $(CC) $(CFLAGS) ant.c -o ant - -buzzard.1: buzzard.1.c - $(CC) $(CFLAGS) buzzard.1.c -o buzzard.1 - -babble.cppcb: buzzard.1.c - $(NOINCLUDE) buzzard.1.c | \ - $(CPP) $(CPPFLAGS) | \ - $(CPPCLEAN) | \ - $(CB) $(CBFLAGS) | \ - $(UNIQ) | \ - $(SPACECLEAN) > babble.cppcb 2>&1 - -buzzard.2: buzzard.2.c - $(CC) $(CFLAGS) buzzard.2.c -o buzzard.2 - -# NOTE: this is the original source that won +# https://github.com/ioccc-src/winner # -buzzard.2.orig: buzzard.2.orig.c - $(CC) $(CFLAGS) buzzard.2.orig.c -o buzzard.2.orig +################################################################################ -gson: gson.c - $(CC) $(CFLAGS) gson.c -o gson - -# NOTE: some systems may only need: +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: # -# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 +# Creative Commons Attribution-ShareAlike 3.0 Unported License. # -kivinen: kivinen.c - $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -lsocket -lresolv -lnsl +# See: http://creativecommons.org/licenses/by-sa/3.0/ -# NOTE: this is the original program that won + +############################# +# shell used by this Makefile +############################# # -# NOTE: some systems may only need: +SHELL= bash + +####################### +# common tool locations +####################### # -# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 +A2P= a2p +AR= ar +ASA= asa +AT= at +ATQ= atq +ATRM= atrm +AWK= awk +BANNER= banner +BASE64= base64 +BASENAME= basename +BATCH= batch +BC= bc +BINHEX= binhex +BISON= bison +BUNZIP2= bunzip2 +BZCAT= bzcat +BZCMP= bzcmp +BZDIFF= bzdiff +BZEGREP= bzegrep +BZFGREP= bzfgrep +BZGREP= bzgrep +BZIP2= bzip2 +BZLESS= bzless +BZMORE= bzmore +C2PH= c2ph +C89= c89 +C99= c99 +CAL= cal +CALC= calc +CAT= cat +CD= cd +CHFLAGS= chflags +CHGRP= chgrp +CHMOD= chmod +CKSUM= cksum +CLANG= clang +CLANG_PLUSPLUS= clang++ +CLEAR= clear +CMP= cmp +COL= col +COLLDEF= colldef +COLRM= colrm +COLUMN= column +COMPRESS= compress +CP= cp +CPIO= cpio +CPP= cpp +CRC32= crc32 +CSH= csh +CSPLIT= csplit +CURL= curl +CUT= cut +C_PLUSPLUS= c++ +C_PLUSPLUS_FILT= c++filt +DATE= date +DC= dc +DD= dd +DF= df +DIFF3= diff3 +DIFF= diff +DIG= dig +DIRNAME= dirname +ED= ed +EGREP= egrep +ENV= env +EQN= eqn +ETAGS= etags +EXPECT= expect +EXPR= expr +FALSE= false +FGREP= fgrep +FILE= file +FIND2PERL= find2perl +FIND= find +FLEX= flex +FLEX_PLUSPLUS= flex++ +FMT= fmt +FOLD= fold +FS_USAGE= fs_usage +FUNZIP= funzip +FUSER= fuser +GCC= gcc +GDIFFMK= gdiffmk +GENCAT= gencat +GENSTRINGS= genstrings +GETOPT= getopt +GETOPTS= getopts +GINDENT= gindent +GNUMAKE= gnumake +GREP= grep +GROFF= groff +GROFFER= groffer +GROG= grog +GROPS= grops +GROTTY= grotty +GUNZIP= gunzip +GVIM= gvim +GZCAT= gzcat +GZEXE= gzexe +GZIP_PROG= gzip +G_PLUSPLUS= g++ +H2PH= h2ph +H2XS= h2xs +HASH= hash +HEAD= head +HOSTNAME_PROG= hostname +ICONV= iconv +ID= id +INDENT= indent +INFO= info +JOT= jot +KILL= kill +KSH= ksh +LAST= last +LD= ld +LESSECHO= lessecho +LEX= len +LINK= link +LN= ln +LS= ls +M4= m4 +MAKE= make +MAN= man +MKDIR= mkdir +MKFIFO= mkfifo +MKTEMP= mktemp +MV= mv +NANO= nano +NASM= nasm +NEQN= neqn +NICE= nice +NL= nl +NM= nm +NOHUP= nohup +NROFF= nroff +NSLOOKUP= nslookup +OD= od +OPENSSL= openssl +PASTE= paste +PATCH= patch +PATHCHK= pathchk +PAX= pax +PERL= perl +PICO= pico +PR= pr +PRINTENV= printenv +PS= ps +PTAR= ptar +PTARDIFF= ptardiff +PTARGREP= ptargrep +PWD= pwd +PYDOC= pydoc +PYTHON= python +PYTHONW= pythonw +READLINK= readlink +RENICE= renice +RESET= reset +REV= rev +RI= ri +RM= rm +RMDIR= rmdir +RSYNC= rsync +RUBY= ruby +RVIM= rvim +SAY= say +SCP= scp +SCREEN= screen +SCRIPT= script +SDIFF= sdiff +SED= sed +SEQ= seq +SFTP= sftp +SH= sh +SHA1= sha1 +SHA= sha +SHAR= shar +SHASUM5_18= shasum5.18 +SHASUM= shasum +SIZE= size +SLEEP= sleep +SORT= sort +SSH= ssh +STAT= stat +STRIP= strip +STTY= stty +SUM= sum +SYNC= sync +TABS= tabs +TAIL= tail +TAR= tar +TEE= tee +TEST= test +TFTP= tftp +TIDY= tidy +TIME= time +TOP= top +TOUCH= touch +TPUT= tout +TPUT= tput +TR= tr +TROFF= troff +TRUE= true +TSET= tset +TSORT= tsort +UL= ul +UNAME= uname +UNCOMPRESS= uncompress +UNEXPAND= unexpand +UNIFDEF= unifdef +UNIFDEFALL= unifdefall +UNIQ= uniq +UNITS= units +UNLINK= unlink +UNZIP= unzip +UNZIPSFX= unzipsfx +UPTIME= uptime +UUDECODE= uudecode +UUENCODE= uuencode +UUIDGEN= uuidgen +VI= vi +VIEW= view +VIM= vim +VIMDIFF= vimdiff +W= w +WAIT4PATH= wait4path +WAIT= wait +WC= wc +WGET= wget +WHAT= what +WHATIS= whatis +WHICH= which +WHO= who +WHOAMI= whoami +WHOIS= whois +WRTIE= write +XAR= xar +XARGS= xargs +XATTR= xattr +XXD= xxd +YACC= yacc +YES= yes +ZCAT= zcat +ZCMP= zcmp +ZDIFF= zdiff +ZEGREP= zegrep +ZFGREP= zfgrep +ZFORCE= zforce +ZGREP= zgrep +ZIP= zip +ZIPCLOAK= zipcloak +ZIPGREp= zipgrep +ZIPINFo= zipinfo +ZIPNOTE= zipnote +ZIPSPLIT= zipsplit +ZLESS= zless +ZMORE= zmore +ZNEW= znew +ZPRINT= zprint +ZSH= zsh + +# Set X11_LIBDIR to the directory where the X11 library resides # -kivinen.orig: kivinen.orig.c - $(CC) $(CFLAGS) kivinen.orig.c -o kivinen.orig -lX11 \ - -lsocket -lresolv -lnsl +#X11_LIBDIR= /usr/X11R6/lib +#X11_LIBDIR= /usr/X11/lib +X11_LIBDIR= /opt/X11/lib -imc: imc.c - $(CC) $(CFLAGS) imc.c -o imc - -# NOTE: this is the original program that won +# Set X11_INCLUDEDIR to the directory where the X11 include files reside # -imc.orig: imc.orig.c - $(CC) $(CFLAGS) imc.orig.c -o imc.orig +#X11_INCDIR= /usr/X11R6/include +#X11_INCDIR= /usr/X11/include +X11_INCDIR= /opt/X11/include -lush: lush.c - $(CC) $(CFLAGS) lush.c -o lush - -lush.again: lush.c - $(CC) $(CFLAGS) lush.c -o lush.again - $(RM) -f lush.again - -# NOTE: this is the original program that won +# Common C compiler warnings to silence # -lush.orig: lush.orig.c - $(CC) $(CFLAGS) lush.orig.c -o lush.orig +#CSILENCE= +CSILENCE= -Wno-bitwise-op-parentheses -Wno-error -Wno-implicit-function-declaration \ + -Wno-parentheses -Wno-pedantic -# NOTE: some systems may need: +# Common C compiler warning flags # -# $(CC) $(CFLAGS) marangon.c -o marangon -lcurses -ltermcap +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +#CWARN= -Wall -Wextra ${CSILENCE} +CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # -marangon: marangon.c - $(CC) $(CFLAGS) marangon.c -o marangon -lcurses +#CSTD= +#CSTD= -ansi +CSTD= -std=gnu90 -# NOTE: this is the original program that won +# Compiler bit architecture # -# NOTE: some systems may need: +# Some entries require 32-bitness: +# ARCH= -m32 # -# $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses -ltermcap +# Some entries require 64-bitness: +# ARCH= -m64 # -marangon.orig: marangon.orig.c - $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses - -nathan: nathan.c - $(CC) $(CFLAGS) nathan.c -o nathan - -# NOTE: this is the original program that won +# By default we assume nothing: # -nathan.orig: nathan.orig.c - $(CC) $(CFLAGS) nathan.orig.c -o nathan.orig +ARCH= -vern: vern.tmp.c - $(CC) $(CFLAGS) vern.tmp.c -o vern - -vern.tmp.c: vern.c - $(RM) -f vern.tmp.c - $(SED) vern.tmp.c - -# NOTE: this is the original program that won +# Defines that are needed to compile # -vern.orig: vern.orig.tmp.c - $(CC) $(CFLAGS) vern.orig.tmp.c -o vern.orig +CDEFINE= +#CDEFINE= -DIOCCC -vern.orig.tmp.c: vern.orig.c - $(RM) -f vern.orig.tmp.c - $(SED) vern.orig.tmp.c - -westley: westley.c - $(CC) $(CFLAGS) westley.c -o westley - -# alternate names for selected entries +# Include files that are needed to compile # -adgrep: adrian - $(RM) -f adgrep - $(LN) adrian adgrep -am: ant - $(RM) -f am - $(LN) ant am -babble: buzzard.1 - $(RM) -f babble - $(LN) buzzard.1 babble -first: buzzard.2 - $(RM) -f first - $(LN) buzzard.2 first -ag: gson - $(RM) -f ag - $(LN) gson ag -whereami: westley - $(RM) -f whereami - $(LN) westley whereami +CINCLUDE= +#CINCLUDE= -include stdlib.h +#CINCLUDE= -include stdio.h +#CINCLUDE= -include stdlib.h -include stdio.h +#CINCLUDE= -I ${X11_INCDIR} +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 +# Optimization +# +# Most compiles will safely use -O2. Some can use only -O1 or -O. +# A few compilers have broken optimizers or this entry make break +# under those buggy optimizers and thus you may not want anything. +# Reasonable compilers will allow for -O3. +# +#OPT= +#OPT= -O +#OPT= -O1 +#OPT= -O2 +OPT= -O3 + +# Default flags for ANSI C compilation +# +CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} + +# Libraries needed to build +# +LIBS= +#LIBS= -lm +#LIBS= -L ${X11_LIBDIR} -lX11 +#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL + +# C compiler to use +# +CC= cc +#CC=clang +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-poison-system-directories +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif + + +############################## +# Special flags for this entry +############################## +# +ENTRY= westley +PROG= ${ENTRY} +# +OBJ= ${PROG}.o +DATA= +TARGET= ${PROG} +# +ALT_OBJ= +ALT_TARGET= + + +################# +# build the entry +################# +# +all: data ${TARGET} + @${TRUE} + +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto + +${PROG}: ${PROG}.c + @echo "NOTE: This entry may not compile when using modern compilers." + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + +whereami: ${PROG} + ${RM} -f $@ + ${LN} $< $@ + +# alternative executable +# +alt: data ${ALT_TARGET} + @${TRUE} + +# data files +# +data: ${DATA} + @${TRUE} + +# both all and alt +# +everything: all alt + + +############### +# utility rules +############### +# clean: - $(RM) -f *.o a.out core - $(RM) -f vern.tmp.c lush.again babble.cppcb vern.orig.tmp.c - $(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c + ${RM} -f ${OBJ} ${ALT_OBJ} + @-if [ -f indent.c ]; then \ + echo ${RM} -f indent.c; \ + ${RM} -f indent.c; \ + fi clobber: clean - $(RM) -f $(WINNERS) a.out - $(RM) -f $(ALT_NAMES) - $(RM) -f adwc adbasename adecho adhead adsleep - $(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig - $(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig + ${RM} -f ${TARGET} ${ALT_TARGET} + ${RM} -f whereami + @-if [ -e sandwich ]; then \ + ${RM} -f sandwich; \ + echo 'ate sandwich'; \ + fi -am_clobber: clean am - $(RM) -f am.safe - $(CP) am am.safe - $(RM) -f $(WINNERS) a.out - $(RM) -f $(ALT_NAMES) - $(RM) -f adwc adbasename adecho adhead adsleep - $(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig - $(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig - $(CP) am.safe am - $(RM) -f am.safe +install: + @echo "Dr. Spock says that is not logical!" + @${TRUE} -nuke: clobber - @true +# you may be able to misunderstand the source by reading indent.c +# +indent.c: ${PROG}.c + @if which "${GINDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${GINDENT} < $< > $@"; \ + ${GINDENT} < $< > $@; \ + elif which "${INDENT}" >/dev/null 2>&1; then \ + echo ${RM} -f $@; \ + ${RM} -f $@; \ + echo "${INDENT} < $< > $@"; \ + ${INDENT} < $< > $@; \ + else \ + echo "no intent tool found, ident $< yourself, sorry"; \ + echo "exit 1"; \ + exit 1; \ + fi -install: all - cat $(WINNERS) > /dev/null + +################## +# 133t hacker rulz +################## +# +love: + @echo 'not war?' + @${TRUE} + +haste: + $(MAKE) waste + @${TRUE} + +waste: + @echo 'haste' + @${TRUE} + +maker: + @echo 'Participate in a maker faire' + @${TRUE} + +easter_egg: + @echo "you expected to often misunderstand this $${RANDOM} magic" + @echo "chongo '' /\\oo/\\" + @echo "Eggy" + +sandwich: easter_egg + @if [ `id -u` -eq 0 ]; then \ + echo 'Okay.'; \ + echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ + else \ + echo 'What? Make it yourself.'; \ + exit 1; \ + fi + +# Understand the history of the Homebrew Computer Club +# as well as the West Coast Computer Faire and +# you might be confused different. :-) +# +supernova: sandwich + @-if [ -r .code_anal ]; then \ + ${RM} -f .code_anal_v6; \ + else \ + echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ + fi + @echo "A $@ helps ${MAKE} the elements that help form planets" + @${TRUE} + +deep_magic: supernova + @-if [ -r .code_anal ]; then \ + ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ + --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + sleep 2; \ + echo "Wrong! Do it again!"; \ + fi + @${TRUE} + +magic: deep_magic + @-if [ -r .code_anal ]; then \ + ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ + else \ + echo "If you don't eat yer meat, you can't have any pudding!"; \ + echo "How can you have any pudding if you don't eat yer meat?!"; \ + fi + @${TRUE} + +# The IOCCC resident astronomer states +# +charon: magic + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore IAU, $@ is a planet" + +pluto: charon + ${MAKE} charon + @echo "$@ is a dwarf planet" + @echo "dwarf is a type of planet" + @echo "therefore, $@ is a planet" + @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" diff --git a/1992/westley/README.md b/1992/westley/README.md index 1ad95e5c3..675b778d1 100644 --- a/1992/westley/README.md +++ b/1992/westley/README.md @@ -1,4 +1,4 @@ -Best Small Program: +# Best Small Program: Brian Westley (aka Merlyn LeRoy) Digi International @@ -6,23 +6,31 @@ Best Small Program: St. Paul, MN 55104 USA +## To build: -Judges' comments: + make all + + NOTE: This entry may not compile when using modern compilers. + +### To run If lost: + make whereami Then run: - whereami lat long + + ./whereami lat long + +## Judges' comments Where lat and long correspond to your latitude and longitude. To find the approximate place where this entry was judged, type: - whereami 37 -122 (- means west of meridian) + ./whereami 37 -122 (- means west of meridian) - -Selected notes from the author: +## Author's comments Run the program with your latitude & longitude as integer arguments; it will produce a map made up of '!' with the given diff --git a/1993/ant/.gitignore b/1993/ant/.gitignore new file mode 100644 index 000000000..59b09c9c8 --- /dev/null +++ b/1993/ant/.gitignore @@ -0,0 +1 @@ +ant diff --git a/1993/cmills/.gitignore b/1993/cmills/.gitignore new file mode 100644 index 000000000..931adc228 --- /dev/null +++ b/1993/cmills/.gitignore @@ -0,0 +1 @@ +cmills diff --git a/1993/dgibson/.gitignore b/1993/dgibson/.gitignore new file mode 100644 index 000000000..409faa207 --- /dev/null +++ b/1993/dgibson/.gitignore @@ -0,0 +1 @@ +dgibson diff --git a/1993/ejb/.gitignore b/1993/ejb/.gitignore new file mode 100644 index 000000000..a05a37517 --- /dev/null +++ b/1993/ejb/.gitignore @@ -0,0 +1 @@ +ejb diff --git a/1993/jonth/.gitignore b/1993/jonth/.gitignore new file mode 100644 index 000000000..e2b0f9ceb --- /dev/null +++ b/1993/jonth/.gitignore @@ -0,0 +1 @@ +jonth diff --git a/1993/leo/.gitignore b/1993/leo/.gitignore new file mode 100644 index 000000000..d26b7dc79 --- /dev/null +++ b/1993/leo/.gitignore @@ -0,0 +1 @@ +leo diff --git a/1993/lmfjyh/.gitignore b/1993/lmfjyh/.gitignore new file mode 100644 index 000000000..7d153f367 --- /dev/null +++ b/1993/lmfjyh/.gitignore @@ -0,0 +1 @@ +lmfjyh diff --git a/1993/plummer/.gitignore b/1993/plummer/.gitignore new file mode 100644 index 000000000..0ce7bbccf --- /dev/null +++ b/1993/plummer/.gitignore @@ -0,0 +1 @@ +plummer diff --git a/1993/rince/.gitignore b/1993/rince/.gitignore new file mode 100644 index 000000000..8e87c9d18 --- /dev/null +++ b/1993/rince/.gitignore @@ -0,0 +1 @@ +rince diff --git a/1993/schnitzi/.gitignore b/1993/schnitzi/.gitignore new file mode 100644 index 000000000..563ae8705 --- /dev/null +++ b/1993/schnitzi/.gitignore @@ -0,0 +1 @@ +schnitzi diff --git a/1993/vanb/.gitignore b/1993/vanb/.gitignore new file mode 100644 index 000000000..c0fa8eb22 --- /dev/null +++ b/1993/vanb/.gitignore @@ -0,0 +1 @@ +vanb diff --git a/1994/dodsond1/.gitignore b/1994/dodsond1/.gitignore new file mode 100644 index 000000000..e95d5d7e8 --- /dev/null +++ b/1994/dodsond1/.gitignore @@ -0,0 +1 @@ +dodsond1 diff --git a/1994/dodsond2/.gitignore b/1994/dodsond2/.gitignore new file mode 100644 index 000000000..66d8e0add --- /dev/null +++ b/1994/dodsond2/.gitignore @@ -0,0 +1 @@ +dodsond2 diff --git a/1994/horton/.gitignore b/1994/horton/.gitignore new file mode 100644 index 000000000..bb28a6992 --- /dev/null +++ b/1994/horton/.gitignore @@ -0,0 +1 @@ +horton diff --git a/1994/imc/.gitignore b/1994/imc/.gitignore new file mode 100644 index 000000000..eb3fb586e --- /dev/null +++ b/1994/imc/.gitignore @@ -0,0 +1 @@ +imc diff --git a/1994/ldb/.gitignore b/1994/ldb/.gitignore new file mode 100644 index 000000000..ee4dfc7fc --- /dev/null +++ b/1994/ldb/.gitignore @@ -0,0 +1 @@ +ldb diff --git a/1994/schnitzi/.gitignore b/1994/schnitzi/.gitignore new file mode 100644 index 000000000..563ae8705 --- /dev/null +++ b/1994/schnitzi/.gitignore @@ -0,0 +1 @@ +schnitzi diff --git a/1994/shapiro/.gitignore b/1994/shapiro/.gitignore new file mode 100644 index 000000000..9912ed2e4 --- /dev/null +++ b/1994/shapiro/.gitignore @@ -0,0 +1 @@ +shapiro diff --git a/1994/smr/.gitignore b/1994/smr/.gitignore new file mode 100644 index 000000000..7c1b2274f --- /dev/null +++ b/1994/smr/.gitignore @@ -0,0 +1 @@ +smr diff --git a/1994/tvr/.gitignore b/1994/tvr/.gitignore new file mode 100644 index 000000000..c681d6557 --- /dev/null +++ b/1994/tvr/.gitignore @@ -0,0 +1 @@ +tvr diff --git a/1994/weisberg/.gitignore b/1994/weisberg/.gitignore new file mode 100644 index 000000000..59d69f5d6 --- /dev/null +++ b/1994/weisberg/.gitignore @@ -0,0 +1 @@ +weisberg diff --git a/1994/westley/.gitignore b/1994/westley/.gitignore new file mode 100644 index 000000000..2a0c890f9 --- /dev/null +++ b/1994/westley/.gitignore @@ -0,0 +1 @@ +westley diff --git a/1995/cdua/.gitignore b/1995/cdua/.gitignore new file mode 100644 index 000000000..ab8a83b7e --- /dev/null +++ b/1995/cdua/.gitignore @@ -0,0 +1 @@ +cdua diff --git a/1995/dodsond1/.gitignore b/1995/dodsond1/.gitignore new file mode 100644 index 000000000..e95d5d7e8 --- /dev/null +++ b/1995/dodsond1/.gitignore @@ -0,0 +1 @@ +dodsond1 diff --git a/1995/dodsond2/.gitignore b/1995/dodsond2/.gitignore new file mode 100644 index 000000000..66d8e0add --- /dev/null +++ b/1995/dodsond2/.gitignore @@ -0,0 +1 @@ +dodsond2 diff --git a/1995/esde/.gitignore b/1995/esde/.gitignore new file mode 100644 index 000000000..cef3ba5b0 --- /dev/null +++ b/1995/esde/.gitignore @@ -0,0 +1 @@ +esde diff --git a/1995/garry/.gitignore b/1995/garry/.gitignore new file mode 100644 index 000000000..49349a9ab --- /dev/null +++ b/1995/garry/.gitignore @@ -0,0 +1 @@ +garry diff --git a/1995/heathbar/.gitignore b/1995/heathbar/.gitignore new file mode 100644 index 000000000..4037f15f0 --- /dev/null +++ b/1995/heathbar/.gitignore @@ -0,0 +1 @@ +heathbar diff --git a/1995/leo/.gitignore b/1995/leo/.gitignore new file mode 100644 index 000000000..d26b7dc79 --- /dev/null +++ b/1995/leo/.gitignore @@ -0,0 +1 @@ +leo diff --git a/1995/makarios/.gitignore b/1995/makarios/.gitignore new file mode 100644 index 000000000..c1edbccda --- /dev/null +++ b/1995/makarios/.gitignore @@ -0,0 +1 @@ +makarios diff --git a/1995/savastio/.gitignore b/1995/savastio/.gitignore new file mode 100644 index 000000000..4e2dcaafa --- /dev/null +++ b/1995/savastio/.gitignore @@ -0,0 +1 @@ +savastio diff --git a/1995/schnitzi/.gitignore b/1995/schnitzi/.gitignore new file mode 100644 index 000000000..563ae8705 --- /dev/null +++ b/1995/schnitzi/.gitignore @@ -0,0 +1 @@ +schnitzi diff --git a/1995/spinellis/.gitignore b/1995/spinellis/.gitignore new file mode 100644 index 000000000..5cf5145a5 --- /dev/null +++ b/1995/spinellis/.gitignore @@ -0,0 +1 @@ +spinellis diff --git a/1995/vanschnitz/.gitignore b/1995/vanschnitz/.gitignore new file mode 100644 index 000000000..a2fcd7db7 --- /dev/null +++ b/1995/vanschnitz/.gitignore @@ -0,0 +1 @@ +vanschnitz diff --git a/1996/august/.gitignore b/1996/august/.gitignore new file mode 100644 index 000000000..36c24223d --- /dev/null +++ b/1996/august/.gitignore @@ -0,0 +1 @@ +august diff --git a/1996/dalbec/.gitignore b/1996/dalbec/.gitignore new file mode 100644 index 000000000..9740628a3 --- /dev/null +++ b/1996/dalbec/.gitignore @@ -0,0 +1 @@ +dalbec diff --git a/1996/eldby/.gitignore b/1996/eldby/.gitignore new file mode 100644 index 000000000..6fffc035b --- /dev/null +++ b/1996/eldby/.gitignore @@ -0,0 +1 @@ +eldby diff --git a/1996/gandalf/.gitignore b/1996/gandalf/.gitignore new file mode 100644 index 000000000..235474030 --- /dev/null +++ b/1996/gandalf/.gitignore @@ -0,0 +1 @@ +gandalf diff --git a/1996/huffman/.gitignore b/1996/huffman/.gitignore new file mode 100644 index 000000000..1f0e8c24c --- /dev/null +++ b/1996/huffman/.gitignore @@ -0,0 +1 @@ +huffman diff --git a/1996/jonth/.gitignore b/1996/jonth/.gitignore new file mode 100644 index 000000000..e2b0f9ceb --- /dev/null +++ b/1996/jonth/.gitignore @@ -0,0 +1 @@ +jonth diff --git a/1996/rcm/.gitignore b/1996/rcm/.gitignore new file mode 100644 index 000000000..13274c8d4 --- /dev/null +++ b/1996/rcm/.gitignore @@ -0,0 +1 @@ +rcm diff --git a/1996/schweikh1/.gitignore b/1996/schweikh1/.gitignore new file mode 100644 index 000000000..72fbca3a7 --- /dev/null +++ b/1996/schweikh1/.gitignore @@ -0,0 +1 @@ +schweikh1 diff --git a/1996/schweikh2/.gitignore b/1996/schweikh2/.gitignore new file mode 100644 index 000000000..85e3bc2d7 --- /dev/null +++ b/1996/schweikh2/.gitignore @@ -0,0 +1 @@ +schweikh2 diff --git a/1996/schweikh3/.gitignore b/1996/schweikh3/.gitignore new file mode 100644 index 000000000..fc8e75c24 --- /dev/null +++ b/1996/schweikh3/.gitignore @@ -0,0 +1 @@ +schweikh3 diff --git a/1996/westley/.gitignore b/1996/westley/.gitignore new file mode 100644 index 000000000..2a0c890f9 --- /dev/null +++ b/1996/westley/.gitignore @@ -0,0 +1 @@ +westley diff --git a/1998/banks/.gitignore b/1998/banks/.gitignore new file mode 100644 index 000000000..745245b44 --- /dev/null +++ b/1998/banks/.gitignore @@ -0,0 +1 @@ +banks diff --git a/1998/bas1/.gitignore b/1998/bas1/.gitignore new file mode 100644 index 000000000..c3202efb6 --- /dev/null +++ b/1998/bas1/.gitignore @@ -0,0 +1 @@ +bas1 diff --git a/1998/bas2/.gitignore b/1998/bas2/.gitignore new file mode 100644 index 000000000..be2054eb2 --- /dev/null +++ b/1998/bas2/.gitignore @@ -0,0 +1 @@ +bas2 diff --git a/1998/chaos/.gitignore b/1998/chaos/.gitignore new file mode 100644 index 000000000..508f200d6 --- /dev/null +++ b/1998/chaos/.gitignore @@ -0,0 +1 @@ +chaos diff --git a/1998/df/.gitignore b/1998/df/.gitignore new file mode 100644 index 000000000..781e137cc --- /dev/null +++ b/1998/df/.gitignore @@ -0,0 +1 @@ +df diff --git a/1998/dlowe/.gitignore b/1998/dlowe/.gitignore new file mode 100644 index 000000000..e0deed35d --- /dev/null +++ b/1998/dlowe/.gitignore @@ -0,0 +1 @@ +dlowe diff --git a/1998/dloweneil/.gitignore b/1998/dloweneil/.gitignore new file mode 100644 index 000000000..fa8cdf80d --- /dev/null +++ b/1998/dloweneil/.gitignore @@ -0,0 +1 @@ +dloweneil diff --git a/1998/dorssel/.gitignore b/1998/dorssel/.gitignore new file mode 100644 index 000000000..0a2f15060 --- /dev/null +++ b/1998/dorssel/.gitignore @@ -0,0 +1 @@ +dorssel diff --git a/1998/fanf/.gitignore b/1998/fanf/.gitignore new file mode 100644 index 000000000..218e919f9 --- /dev/null +++ b/1998/fanf/.gitignore @@ -0,0 +1 @@ +fanf diff --git a/1998/schnitzi/.gitignore b/1998/schnitzi/.gitignore new file mode 100644 index 000000000..563ae8705 --- /dev/null +++ b/1998/schnitzi/.gitignore @@ -0,0 +1 @@ +schnitzi diff --git a/1998/schweikh1/.gitignore b/1998/schweikh1/.gitignore new file mode 100644 index 000000000..72fbca3a7 --- /dev/null +++ b/1998/schweikh1/.gitignore @@ -0,0 +1 @@ +schweikh1 diff --git a/1998/schweikh2/.gitignore b/1998/schweikh2/.gitignore new file mode 100644 index 000000000..85e3bc2d7 --- /dev/null +++ b/1998/schweikh2/.gitignore @@ -0,0 +1 @@ +schweikh2 diff --git a/1998/schweikh3/.gitignore b/1998/schweikh3/.gitignore new file mode 100644 index 000000000..fc8e75c24 --- /dev/null +++ b/1998/schweikh3/.gitignore @@ -0,0 +1 @@ +schweikh3 diff --git a/1998/tomtorfs/.gitignore b/1998/tomtorfs/.gitignore new file mode 100644 index 000000000..e0fcdbcec --- /dev/null +++ b/1998/tomtorfs/.gitignore @@ -0,0 +1 @@ +tomtorfs diff --git a/2000/anderson/.gitignore b/2000/anderson/.gitignore new file mode 100644 index 000000000..7faaac2e6 --- /dev/null +++ b/2000/anderson/.gitignore @@ -0,0 +1 @@ +anderson diff --git a/2000/bellard/.gitignore b/2000/bellard/.gitignore new file mode 100644 index 000000000..6f007f6fe --- /dev/null +++ b/2000/bellard/.gitignore @@ -0,0 +1 @@ +bellard diff --git a/2000/bmeyer/.gitignore b/2000/bmeyer/.gitignore new file mode 100644 index 000000000..79a0ac3fc --- /dev/null +++ b/2000/bmeyer/.gitignore @@ -0,0 +1 @@ +bmeyer diff --git a/2000/briddlebane/.gitignore b/2000/briddlebane/.gitignore new file mode 100644 index 000000000..1b2e83009 --- /dev/null +++ b/2000/briddlebane/.gitignore @@ -0,0 +1 @@ +briddlebane diff --git a/2000/dhyang/.gitignore b/2000/dhyang/.gitignore new file mode 100644 index 000000000..88d0b9ce3 --- /dev/null +++ b/2000/dhyang/.gitignore @@ -0,0 +1 @@ +dhyang diff --git a/2000/dlowe/.gitignore b/2000/dlowe/.gitignore new file mode 100644 index 000000000..e0deed35d --- /dev/null +++ b/2000/dlowe/.gitignore @@ -0,0 +1 @@ +dlowe diff --git a/2000/jarijyrki/.gitignore b/2000/jarijyrki/.gitignore new file mode 100644 index 000000000..227c8b4f7 --- /dev/null +++ b/2000/jarijyrki/.gitignore @@ -0,0 +1 @@ +jarijyrki diff --git a/2000/natori/.gitignore b/2000/natori/.gitignore new file mode 100644 index 000000000..c2f12625e --- /dev/null +++ b/2000/natori/.gitignore @@ -0,0 +1 @@ +natori diff --git a/2000/primenum/.gitignore b/2000/primenum/.gitignore new file mode 100644 index 000000000..68da89df9 --- /dev/null +++ b/2000/primenum/.gitignore @@ -0,0 +1 @@ +primenum diff --git a/2000/rince/.gitignore b/2000/rince/.gitignore new file mode 100644 index 000000000..8e87c9d18 --- /dev/null +++ b/2000/rince/.gitignore @@ -0,0 +1 @@ +rince diff --git a/2000/robison/.gitignore b/2000/robison/.gitignore new file mode 100644 index 000000000..c124d1dbc --- /dev/null +++ b/2000/robison/.gitignore @@ -0,0 +1 @@ +robison diff --git a/2000/schneiderwent/.gitignore b/2000/schneiderwent/.gitignore new file mode 100644 index 000000000..7add82d84 --- /dev/null +++ b/2000/schneiderwent/.gitignore @@ -0,0 +1 @@ +schneiderwent diff --git a/2000/thadgavin/.gitignore b/2000/thadgavin/.gitignore new file mode 100644 index 000000000..c7930e680 --- /dev/null +++ b/2000/thadgavin/.gitignore @@ -0,0 +1 @@ +thadgavin diff --git a/2001/anonymous/.gitignore b/2001/anonymous/.gitignore new file mode 100644 index 000000000..ed6d4bce0 --- /dev/null +++ b/2001/anonymous/.gitignore @@ -0,0 +1 @@ +anonymous diff --git a/2001/bellard/.gitignore b/2001/bellard/.gitignore new file mode 100644 index 000000000..6f007f6fe --- /dev/null +++ b/2001/bellard/.gitignore @@ -0,0 +1 @@ +bellard diff --git a/2001/cheong/.gitignore b/2001/cheong/.gitignore new file mode 100644 index 000000000..df4ec6876 --- /dev/null +++ b/2001/cheong/.gitignore @@ -0,0 +1 @@ +cheong diff --git a/2001/coupard/.gitignore b/2001/coupard/.gitignore new file mode 100644 index 000000000..04b0c16d3 --- /dev/null +++ b/2001/coupard/.gitignore @@ -0,0 +1 @@ +coupard diff --git a/2001/ctk/.gitignore b/2001/ctk/.gitignore new file mode 100644 index 000000000..e02fee0dd --- /dev/null +++ b/2001/ctk/.gitignore @@ -0,0 +1 @@ +ctk diff --git a/2001/dgbeards/.gitignore b/2001/dgbeards/.gitignore new file mode 100644 index 000000000..831f17e57 --- /dev/null +++ b/2001/dgbeards/.gitignore @@ -0,0 +1 @@ +dgbeards diff --git a/2001/herrmann1/.gitignore b/2001/herrmann1/.gitignore new file mode 100644 index 000000000..957e2a9b9 --- /dev/null +++ b/2001/herrmann1/.gitignore @@ -0,0 +1 @@ +herrmann1 diff --git a/2001/herrmann2/.gitignore b/2001/herrmann2/.gitignore new file mode 100644 index 000000000..24be698bf --- /dev/null +++ b/2001/herrmann2/.gitignore @@ -0,0 +1 @@ +herrmann2 diff --git a/2001/jason/.gitignore b/2001/jason/.gitignore new file mode 100644 index 000000000..316a72f9a --- /dev/null +++ b/2001/jason/.gitignore @@ -0,0 +1 @@ +jason diff --git a/2001/kev/.gitignore b/2001/kev/.gitignore new file mode 100644 index 000000000..961ec1d0c --- /dev/null +++ b/2001/kev/.gitignore @@ -0,0 +1 @@ +kev diff --git a/2001/ollinger/.gitignore b/2001/ollinger/.gitignore new file mode 100644 index 000000000..25cc0f591 --- /dev/null +++ b/2001/ollinger/.gitignore @@ -0,0 +1 @@ +ollinger diff --git a/2001/rosten/.gitignore b/2001/rosten/.gitignore new file mode 100644 index 000000000..568e5b5bb --- /dev/null +++ b/2001/rosten/.gitignore @@ -0,0 +1 @@ +rosten diff --git a/2001/schweikh/.gitignore b/2001/schweikh/.gitignore new file mode 100644 index 000000000..9b1346d05 --- /dev/null +++ b/2001/schweikh/.gitignore @@ -0,0 +1 @@ +schweikh diff --git a/2001/westley/.gitignore b/2001/westley/.gitignore new file mode 100644 index 000000000..2a0c890f9 --- /dev/null +++ b/2001/westley/.gitignore @@ -0,0 +1 @@ +westley diff --git a/2001/williams/.gitignore b/2001/williams/.gitignore new file mode 100644 index 000000000..8a1f55820 --- /dev/null +++ b/2001/williams/.gitignore @@ -0,0 +1 @@ +williams diff --git a/2004/anonymous/.gitignore b/2004/anonymous/.gitignore new file mode 100644 index 000000000..ed6d4bce0 --- /dev/null +++ b/2004/anonymous/.gitignore @@ -0,0 +1 @@ +anonymous diff --git a/2004/arachnid/.gitignore b/2004/arachnid/.gitignore new file mode 100644 index 000000000..9eae609b9 --- /dev/null +++ b/2004/arachnid/.gitignore @@ -0,0 +1 @@ +arachnid diff --git a/2004/burley/.gitignore b/2004/burley/.gitignore new file mode 100644 index 000000000..917468cfe --- /dev/null +++ b/2004/burley/.gitignore @@ -0,0 +1 @@ +burley diff --git a/2004/gavare/.gitignore b/2004/gavare/.gitignore new file mode 100644 index 000000000..67289f99d --- /dev/null +++ b/2004/gavare/.gitignore @@ -0,0 +1 @@ +gavare diff --git a/2004/gavin/.gitignore b/2004/gavin/.gitignore new file mode 100644 index 000000000..c485d3bf1 --- /dev/null +++ b/2004/gavin/.gitignore @@ -0,0 +1 @@ +gavin diff --git a/2004/hibachi/.gitignore b/2004/hibachi/.gitignore new file mode 100644 index 000000000..6ab1a25e1 --- /dev/null +++ b/2004/hibachi/.gitignore @@ -0,0 +1 @@ +hibachi diff --git a/2004/hoyle/.gitignore b/2004/hoyle/.gitignore new file mode 100644 index 000000000..39706d1fe --- /dev/null +++ b/2004/hoyle/.gitignore @@ -0,0 +1 @@ +hoyle diff --git a/2004/jdalbec/.gitignore b/2004/jdalbec/.gitignore new file mode 100644 index 000000000..b6afac96b --- /dev/null +++ b/2004/jdalbec/.gitignore @@ -0,0 +1 @@ +jdalbec diff --git a/2004/kopczynski/.gitignore b/2004/kopczynski/.gitignore new file mode 100644 index 000000000..1c40784e5 --- /dev/null +++ b/2004/kopczynski/.gitignore @@ -0,0 +1 @@ +kopczynski diff --git a/2004/newbern/.gitignore b/2004/newbern/.gitignore new file mode 100644 index 000000000..f006a9a2c --- /dev/null +++ b/2004/newbern/.gitignore @@ -0,0 +1 @@ +newbern diff --git a/2004/omoikane/.gitignore b/2004/omoikane/.gitignore new file mode 100644 index 000000000..db7ab6ec2 --- /dev/null +++ b/2004/omoikane/.gitignore @@ -0,0 +1 @@ +omoikane diff --git a/2004/schnitzi/.gitignore b/2004/schnitzi/.gitignore new file mode 100644 index 000000000..563ae8705 --- /dev/null +++ b/2004/schnitzi/.gitignore @@ -0,0 +1 @@ +schnitzi diff --git a/2004/sds/.gitignore b/2004/sds/.gitignore new file mode 100644 index 000000000..494c133dd --- /dev/null +++ b/2004/sds/.gitignore @@ -0,0 +1 @@ +sds diff --git a/2004/vik1/.gitignore b/2004/vik1/.gitignore new file mode 100644 index 000000000..0993548ac --- /dev/null +++ b/2004/vik1/.gitignore @@ -0,0 +1 @@ +vik1 diff --git a/2004/vik2/.gitignore b/2004/vik2/.gitignore new file mode 100644 index 000000000..8e7994066 --- /dev/null +++ b/2004/vik2/.gitignore @@ -0,0 +1 @@ +vik2 diff --git a/2006/birken/.gitignore b/2006/birken/.gitignore new file mode 100644 index 000000000..e5a552e19 --- /dev/null +++ b/2006/birken/.gitignore @@ -0,0 +1 @@ +birken diff --git a/2006/borsanyi/.gitignore b/2006/borsanyi/.gitignore new file mode 100644 index 000000000..5d7cdea5f --- /dev/null +++ b/2006/borsanyi/.gitignore @@ -0,0 +1 @@ +borsanyi diff --git a/2006/grothe/.gitignore b/2006/grothe/.gitignore new file mode 100644 index 000000000..11e3173dd --- /dev/null +++ b/2006/grothe/.gitignore @@ -0,0 +1 @@ +grothe diff --git a/2006/hamre/.gitignore b/2006/hamre/.gitignore new file mode 100644 index 000000000..7bf9e29be --- /dev/null +++ b/2006/hamre/.gitignore @@ -0,0 +1 @@ +hamre diff --git a/2006/meyer/.gitignore b/2006/meyer/.gitignore new file mode 100644 index 000000000..6e1b3595d --- /dev/null +++ b/2006/meyer/.gitignore @@ -0,0 +1 @@ +meyer diff --git a/2006/monge/.gitignore b/2006/monge/.gitignore new file mode 100644 index 000000000..42cc3d02d --- /dev/null +++ b/2006/monge/.gitignore @@ -0,0 +1 @@ +monge diff --git a/2006/night/.gitignore b/2006/night/.gitignore new file mode 100644 index 000000000..41feb5b6d --- /dev/null +++ b/2006/night/.gitignore @@ -0,0 +1 @@ +night diff --git a/2006/sloane/.gitignore b/2006/sloane/.gitignore new file mode 100644 index 000000000..84c5a1b15 --- /dev/null +++ b/2006/sloane/.gitignore @@ -0,0 +1 @@ +sloane diff --git a/2006/stewart/.gitignore b/2006/stewart/.gitignore new file mode 100644 index 000000000..db5a3b068 --- /dev/null +++ b/2006/stewart/.gitignore @@ -0,0 +1 @@ +stewart diff --git a/2006/sykes1/.gitignore b/2006/sykes1/.gitignore new file mode 100644 index 000000000..cd92228d4 --- /dev/null +++ b/2006/sykes1/.gitignore @@ -0,0 +1 @@ +sykes1 diff --git a/2006/sykes2/.gitignore b/2006/sykes2/.gitignore new file mode 100644 index 000000000..95e0a5398 --- /dev/null +++ b/2006/sykes2/.gitignore @@ -0,0 +1 @@ +sykes2 diff --git a/2006/toledo1/.gitignore b/2006/toledo1/.gitignore new file mode 100644 index 000000000..4cf03b026 --- /dev/null +++ b/2006/toledo1/.gitignore @@ -0,0 +1 @@ +toledo1 diff --git a/2006/toledo2/.gitignore b/2006/toledo2/.gitignore new file mode 100644 index 000000000..08125c0b0 --- /dev/null +++ b/2006/toledo2/.gitignore @@ -0,0 +1 @@ +toledo2 diff --git a/2006/toledo3/.gitignore b/2006/toledo3/.gitignore new file mode 100644 index 000000000..752239a81 --- /dev/null +++ b/2006/toledo3/.gitignore @@ -0,0 +1 @@ +toledo3 diff --git a/2011/akari/.gitignore b/2011/akari/.gitignore new file mode 100644 index 000000000..a8c33ec96 --- /dev/null +++ b/2011/akari/.gitignore @@ -0,0 +1 @@ +akari diff --git a/2011/blakely/.gitignore b/2011/blakely/.gitignore new file mode 100644 index 000000000..5c36c9097 --- /dev/null +++ b/2011/blakely/.gitignore @@ -0,0 +1 @@ +blakely diff --git a/2011/borsanyi/.gitignore b/2011/borsanyi/.gitignore new file mode 100644 index 000000000..5d7cdea5f --- /dev/null +++ b/2011/borsanyi/.gitignore @@ -0,0 +1 @@ +borsanyi diff --git a/2011/dlowe/.gitignore b/2011/dlowe/.gitignore new file mode 100644 index 000000000..e0deed35d --- /dev/null +++ b/2011/dlowe/.gitignore @@ -0,0 +1 @@ +dlowe diff --git a/2011/eastman/.gitignore b/2011/eastman/.gitignore new file mode 100644 index 000000000..a096b10ee --- /dev/null +++ b/2011/eastman/.gitignore @@ -0,0 +1 @@ +eastman diff --git a/2011/fredriksson/.gitignore b/2011/fredriksson/.gitignore new file mode 100644 index 000000000..f2e512e6b --- /dev/null +++ b/2011/fredriksson/.gitignore @@ -0,0 +1 @@ +fredriksson diff --git a/2011/goren/.gitignore b/2011/goren/.gitignore new file mode 100644 index 000000000..ac8e9a9ac --- /dev/null +++ b/2011/goren/.gitignore @@ -0,0 +1 @@ +goren diff --git a/2011/hamaji/.gitignore b/2011/hamaji/.gitignore new file mode 100644 index 000000000..38e8b4008 --- /dev/null +++ b/2011/hamaji/.gitignore @@ -0,0 +1 @@ +hamaji diff --git a/2011/hou/.gitignore b/2011/hou/.gitignore new file mode 100644 index 000000000..02f7029f9 --- /dev/null +++ b/2011/hou/.gitignore @@ -0,0 +1 @@ +hou diff --git a/2011/konno/.gitignore b/2011/konno/.gitignore new file mode 100644 index 000000000..1f308a241 --- /dev/null +++ b/2011/konno/.gitignore @@ -0,0 +1 @@ +konno diff --git a/2011/richards/.gitignore b/2011/richards/.gitignore new file mode 100644 index 000000000..94c1e89c1 --- /dev/null +++ b/2011/richards/.gitignore @@ -0,0 +1 @@ +richards diff --git a/2011/toledo/.gitignore b/2011/toledo/.gitignore new file mode 100644 index 000000000..7e255de0f --- /dev/null +++ b/2011/toledo/.gitignore @@ -0,0 +1 @@ +toledo diff --git a/2011/vik/.gitignore b/2011/vik/.gitignore new file mode 100644 index 000000000..c28f954b2 --- /dev/null +++ b/2011/vik/.gitignore @@ -0,0 +1 @@ +vik diff --git a/2011/zucker/.gitignore b/2011/zucker/.gitignore new file mode 100644 index 000000000..4be68913b --- /dev/null +++ b/2011/zucker/.gitignore @@ -0,0 +1 @@ +zucker diff --git a/2012/README.html b/2012/README.html deleted file mode 100644 index 5d4aeefc7..000000000 --- a/2012/README.html +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - README - - -

2012 marked the “The Twenty First International Obfuscated C Code Contest”

- -

Copyright © 2012, Landon Curt Noll, Simon Cooper, and Leonid A. -Broukhis. All Rights Reserved. Permission for personal, educational -or non-profit use is granted provided this copyright and notice are -included in its entirety and remains unaltered. All other uses -must receive prior permission from the contest judges.

- -

Standard IOCCC stuff

- -

The IOCCC has a web site and now has a number of international mirrors. -The primary site can be found at www.ioccc.org. - -

Use make to compile entries. It is possible that on non-Un*x / non-Linux -systems the makefile needs to be changed. See the Makefile for details.

- -

Look at the source and try to figure out what the programs do, and run -them with various inputs. If you want to, look at the hints files for -spoilers - this year we included most of the information included -by the submitter.

- -

Read over the makefile for compile/build issues. Your system may require -certain changes (add or remove a library, add or remove a #define).

- -

Some ANSI C compilers are not quite as good as they should be. If -yours is lacking, you may need to compile using gcc instead of your -local compiler.

- -

Remarks on some of the entries

- -

We believe you will be impressed with this year’s winners. We had -a very difficult time picking a single best from among the other winners -because the overall quality of the winners were so high.

- -

This year we selected the top 4 entries for particularly high honors:

- -
    -
  • Gold award - Balanced use of obfuscation

    - -

    A very extremely subtle and twisted piece of source code! -Even if you start with the zeitak_deobfucate.c source, -you will still have a very challenging time to understand it!

  • -
  • Silver award - Most elementary use of C

    - -

    A fun program that could also have won “Best abuse of -Ghostscript” because it managed to create some PDF files -that Ghostscript could not read.

  • -
  • Bronze award - Best use of cocoa

    - -

    A picture within a picture is worth more than a -thousand (4 byte) words. :-)

  • -
  • Honorable mention - Most complex ASCII fluid

    - -

    When you see this program in action, you too will -very likely say wow as we did!

  • -
- - -

But don’t ignore the other winners! There are games, utilities, -eye candy, calculators and graphical tools to explore.

- -

This year, Yusuke Endoh won with two entries, one of which (endoh1) -won the special Honorable mention award. Eight of the winning entries -were from people who won in previous years.

- -

This year we had a number of winners from Asia. We saw our second -winner from China and first from Korea. We are pleased to see -outstanding entries from areas of the world that have not been -active in past contests. Will we see an upswing of entries -from South America, Africa and Antarctica next year? :-)

- -

Please note that judging is done completely anonymously. Please -do NOT reveal your identity in your source code. In the future we -may disqualify entries that reveal the identity of the submitter!

- -

There were some outstanding entries that did not win. Unfortunately -some very good entries lost because they:

- -
    -
  • would take years to execute

  • -
  • were way way oversize and didn’t even attempt to justify their -excess by a clever abuse of the rules

  • -
  • obfuscate themselves by simply invoking a complex -state machine

  • -
  • depend on a single obfuscation trick

  • -
  • could only be run on a particular vendor’s platform

  • -
  • were very similar to previous winners

  • -
  • were based on an overused theme such as yet another -fractal display program

  • -
  • didn’t work as documented

  • -
- - -

We hope the authors of some of those entries will fix and re-submit -them for the next IOCCC.

- -

There is a risk in submitting an entry that is similar to a well -used theme by previous winners. Previous winners set a very high -bar. A new winner must not only compete against other submissions -form the current year, they must also excel over similar winners -in some particularly impressive way.

- -

Final Comments

- -

Please feel free to send us comments and suggestions about the -competition, this README or anything else that you would like to see in -future contests.

- -

If you use, distribute or publish these entries in some way, please drop -us a line. We enjoy seeing who, where and how the contest is used.

- -

If you have problems with any of the entries, AND YOU HAVE A FIX, please -send us the fix (patch file or the entire changed file).

- - - - - -
Creative Commons License

© Copyright 1984-2012, -Leo Broukhis, Simon Cooper, Landon Curt Noll -- All rights reserved
-This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

 
- - diff --git a/2012/blakely/.gitignore b/2012/blakely/.gitignore new file mode 100644 index 000000000..5c36c9097 --- /dev/null +++ b/2012/blakely/.gitignore @@ -0,0 +1 @@ +blakely diff --git a/2012/deckmyn/.gitignore b/2012/deckmyn/.gitignore new file mode 100644 index 000000000..cba32ef42 --- /dev/null +++ b/2012/deckmyn/.gitignore @@ -0,0 +1 @@ +deckmyn diff --git a/2012/dlowe/.gitignore b/2012/dlowe/.gitignore new file mode 100644 index 000000000..e0deed35d --- /dev/null +++ b/2012/dlowe/.gitignore @@ -0,0 +1 @@ +dlowe diff --git a/2012/endoh1/.gitignore b/2012/endoh1/.gitignore new file mode 100644 index 000000000..97dd818c8 --- /dev/null +++ b/2012/endoh1/.gitignore @@ -0,0 +1 @@ +endoh1 diff --git a/2012/endoh2/.gitignore b/2012/endoh2/.gitignore new file mode 100644 index 000000000..85f027cf4 --- /dev/null +++ b/2012/endoh2/.gitignore @@ -0,0 +1 @@ +endoh2 diff --git a/2012/grothe/.gitignore b/2012/grothe/.gitignore new file mode 100644 index 000000000..11e3173dd --- /dev/null +++ b/2012/grothe/.gitignore @@ -0,0 +1 @@ +grothe diff --git a/2012/hamano/.gitignore b/2012/hamano/.gitignore new file mode 100644 index 000000000..cd0177a16 --- /dev/null +++ b/2012/hamano/.gitignore @@ -0,0 +1 @@ +hamano diff --git a/2012/hou/.gitignore b/2012/hou/.gitignore new file mode 100644 index 000000000..02f7029f9 --- /dev/null +++ b/2012/hou/.gitignore @@ -0,0 +1 @@ +hou diff --git a/2012/kang/.gitignore b/2012/kang/.gitignore new file mode 100644 index 000000000..0ac0f0f49 --- /dev/null +++ b/2012/kang/.gitignore @@ -0,0 +1 @@ +kang diff --git a/2012/konno/.gitignore b/2012/konno/.gitignore new file mode 100644 index 000000000..1f308a241 --- /dev/null +++ b/2012/konno/.gitignore @@ -0,0 +1 @@ +konno diff --git a/2012/omoikane/.gitignore b/2012/omoikane/.gitignore new file mode 100644 index 000000000..db7ab6ec2 --- /dev/null +++ b/2012/omoikane/.gitignore @@ -0,0 +1 @@ +omoikane diff --git a/2012/tromp/.gitignore b/2012/tromp/.gitignore new file mode 100644 index 000000000..48d35ef74 --- /dev/null +++ b/2012/tromp/.gitignore @@ -0,0 +1 @@ +tromp diff --git a/2012/vik/.gitignore b/2012/vik/.gitignore new file mode 100644 index 000000000..c28f954b2 --- /dev/null +++ b/2012/vik/.gitignore @@ -0,0 +1 @@ +vik diff --git a/2012/zeitak/.gitignore b/2012/zeitak/.gitignore new file mode 100644 index 000000000..0989fbef7 --- /dev/null +++ b/2012/zeitak/.gitignore @@ -0,0 +1 @@ +zeitak diff --git a/2013/README.html b/2013/README.html deleted file mode 100644 index ceb51c8a1..000000000 --- a/2013/README.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - README - - -

2013 marked the “The Twenty Second International Obfuscated C Code Contest”

- -

Copyright © 2013, Landon Curt Noll, Simon Cooper, and Leonid A. -Broukhis. All Rights Reserved. Permission for personal, educational -or non-profit use is granted provided this copyright and notice are -included in its entirety and remains unaltered. All other uses -must receive prior permission from the contest judges.

- -

Standard IOCCC stuff

- -

The IOCCC has a web site and now has a number of international mirrors. -The primary site can be found at www.ioccc.org. - -

Use make to compile entries. It is possible that on non-Un*x / non-Linux -systems the makefile needs to be changed. See the Makefile for details.

- -

Look at the source and try to figure out what the programs do, and run -them with various inputs. If you want to, look at the hints files for -spoilers - this year we included most of the information included -by the submitter.

- -

Read over the makefile for compile/build issues. Your system may require -certain changes (add or remove a library, add or remove a #define).

- -

Some ANSI C compilers are not quite as good as they should be. If -yours is lacking, you may need to compile using gcc instead of your -local compiler.

- -

Remarks on some of the entries

- -

We believe you will again be impressed with this year’s winners.

- -

This year, several 8 people won 9 people won 15 awards. For the -first time in the history of the contest, one person, Yusuke Endoh, -won 4 times while Adrian Cable won 3 times! It is also worth noting -that Chris Mills previous win was in 1993. Welcome back Chris!

- -

We, the judges, were very surprised by this as many of the multiple -winners submitted very different styles of entries.

- -

This year was the first time the IOCCC size tool was used. Entries -had to print a value 2053 or less when the -i flag was used.

- -

Several people discovered an undocumented feature in that -certain comments such as:

- -
///*
-
- -

or:

- -
*\
-/
-
- -

were not correctly parsed by the tool. The guidelines stated:

- -
In cases where the above summary and the algorithm implemented by
-the IOCCC size tool source code conflict, the algorithm implemented
-by the IOCCC size tool source code is preferred by the judges.
-
- -

so this abuse was allowed (and encouraged). The judges hope that -the IOCCC size tool author will patch the tool to block this kind -of size abuse in future contests.

- -

There were some outstanding entries that did not win. Unfortunately -some very good entries lost because they:

- -
    -
  • were way way oversize and didn’t even attempt to justify their -excess by a clever abuse of the rules

  • -
  • depend on a single obfuscation trick

  • -
  • could only be run on a particular vendor’s platform

  • -
  • were very similar to previous winners

  • -
  • didn’t work as documented

  • -
- - -

We hope the authors of some of those entries will fix and re-submit -them for the next IOCCC.

- -

There is a risk in submitting an entry that is similar to a well -used theme by previous winners. Previous winners set a very high -bar. A new winner must not only compete against other submissions -from the current year, they must also excel over similar winners -in some particularly impressive way.

- -

Final Comments

- -

Please feel free to send us comments and suggestions about the -competition, this README or anything else that you would like to see in -future contests.

- -

If you use, distribute or publish these entries in some way, please drop -us a line. We enjoy seeing who, where and how the contest is used.

- -

If you have problems with any of the entries, AND YOU HAVE A FIX, please -send us the fix (patch file or the entire changed file).

- - - - - -
Creative Commons License

© Copyright 1984-2013, -Leo Broukhis, Simon Cooper, Landon Curt Noll -- All rights reserved
-This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

 
- - diff --git a/2013/birken/.gitignore b/2013/birken/.gitignore new file mode 100644 index 000000000..0635915bc --- /dev/null +++ b/2013/birken/.gitignore @@ -0,0 +1,3 @@ +birken +examples/ +images/ diff --git a/2013/cable1/.gitignore b/2013/cable1/.gitignore new file mode 100644 index 000000000..91e453045 --- /dev/null +++ b/2013/cable1/.gitignore @@ -0,0 +1 @@ +cable1 diff --git a/2013/cable2/.gitignore b/2013/cable2/.gitignore new file mode 100644 index 000000000..bf9ec9290 --- /dev/null +++ b/2013/cable2/.gitignore @@ -0,0 +1,7 @@ +ascii.bmp +bonus.bmp +cable2 +hello_world.bmp +mixed_sizes.bmp +multi_color.bmp +typeset.bmp diff --git a/2013/cable3/.gitignore b/2013/cable3/.gitignore new file mode 100644 index 000000000..669871cfd --- /dev/null +++ b/2013/cable3/.gitignore @@ -0,0 +1 @@ +cable3 diff --git a/2013/dlowe/.gitignore b/2013/dlowe/.gitignore new file mode 100644 index 000000000..e0deed35d --- /dev/null +++ b/2013/dlowe/.gitignore @@ -0,0 +1 @@ +dlowe diff --git a/2013/endoh1/.gitignore b/2013/endoh1/.gitignore new file mode 100644 index 000000000..6e5ac6929 --- /dev/null +++ b/2013/endoh1/.gitignore @@ -0,0 +1,4 @@ +echo +endoh1 +hello +tac diff --git a/2013/endoh2/.gitignore b/2013/endoh2/.gitignore new file mode 100644 index 000000000..9aed40587 --- /dev/null +++ b/2013/endoh2/.gitignore @@ -0,0 +1,4 @@ +endoh2 +jpeg +jpeg.c +jpeg.jpg diff --git a/2013/endoh3/.gitignore b/2013/endoh3/.gitignore new file mode 100644 index 000000000..63da6681f --- /dev/null +++ b/2013/endoh3/.gitignore @@ -0,0 +1 @@ +endoh3 diff --git a/2013/endoh4/.gitignore b/2013/endoh4/.gitignore new file mode 100644 index 000000000..17beb20b3 --- /dev/null +++ b/2013/endoh4/.gitignore @@ -0,0 +1,2 @@ +endoh4 +solids/ diff --git a/2013/hou/.gitignore b/2013/hou/.gitignore new file mode 100644 index 000000000..25a091b18 --- /dev/null +++ b/2013/hou/.gitignore @@ -0,0 +1,3 @@ +a +a.c +hou diff --git a/2013/mills/.gitignore b/2013/mills/.gitignore new file mode 100644 index 000000000..435314278 --- /dev/null +++ b/2013/mills/.gitignore @@ -0,0 +1 @@ +mills diff --git a/2013/misaka/.gitignore b/2013/misaka/.gitignore new file mode 100644 index 000000000..48055accb --- /dev/null +++ b/2013/misaka/.gitignore @@ -0,0 +1,18 @@ +horizontal_cat +long_cat +long_faat_cat +long_fat_cat +loong_cat +loooong_cat +loooooooong_cat +misaka +misaka2.c +misaka3.c +misaka4.c +misaka5.c +misaka6.c +misaka7.c +misaka8.c +misaka9.c +same_as_long_cat +vertical_cat diff --git a/2013/morgan1/.gitignore b/2013/morgan1/.gitignore new file mode 100644 index 000000000..730491f82 --- /dev/null +++ b/2013/morgan1/.gitignore @@ -0,0 +1 @@ +morgan1 diff --git a/2013/morgan2/.gitignore b/2013/morgan2/.gitignore new file mode 100644 index 000000000..28e6e30d6 --- /dev/null +++ b/2013/morgan2/.gitignore @@ -0,0 +1 @@ +morgan2 diff --git a/2013/robison/.gitignore b/2013/robison/.gitignore new file mode 100644 index 000000000..c124d1dbc --- /dev/null +++ b/2013/robison/.gitignore @@ -0,0 +1 @@ +robison diff --git a/2014/birken/.gitignore b/2014/birken/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2014/birken/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2014/deak/.gitignore b/2014/deak/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2014/deak/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2014/endoh1/.gitignore b/2014/endoh1/.gitignore new file mode 100644 index 000000000..216deeb88 --- /dev/null +++ b/2014/endoh1/.gitignore @@ -0,0 +1,3 @@ +main +main.c +prog diff --git a/2014/endoh2/.gitignore b/2014/endoh2/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2014/endoh2/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2014/maffiodo1/.gitignore b/2014/maffiodo1/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2014/maffiodo1/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2014/maffiodo2/.gitignore b/2014/maffiodo2/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2014/maffiodo2/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2014/morgan/.gitignore b/2014/morgan/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2014/morgan/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2014/sinon/.gitignore b/2014/sinon/.gitignore new file mode 100644 index 000000000..91cfa07d3 --- /dev/null +++ b/2014/sinon/.gitignore @@ -0,0 +1,2 @@ +prog +sinon.c diff --git a/2014/sinon/glock.sh b/2014/sinon/glock.sh old mode 100644 new mode 100755 diff --git a/2014/sinon/hecate.sh b/2014/sinon/hecate.sh old mode 100644 new mode 100755 diff --git a/2014/skeggs/.gitignore b/2014/skeggs/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2014/skeggs/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2014/vik/.gitignore b/2014/vik/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2014/vik/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2014/wiedijk/.gitignore b/2014/wiedijk/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2014/wiedijk/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2015/burton/.gitignore b/2015/burton/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2015/burton/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2015/dogon/.gitignore b/2015/dogon/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2015/dogon/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2015/duble/.gitignore b/2015/duble/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2015/duble/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2015/endoh1/.gitignore b/2015/endoh1/.gitignore new file mode 100644 index 000000000..62cfdd752 --- /dev/null +++ b/2015/endoh1/.gitignore @@ -0,0 +1,9 @@ +fitzhugh-nagumo-1 +fitzhugh-nagumo-2 +ginzburg-landau +gray-scott-1 +gray-scott-2 +gray-scott-3 +gray-scott-4 +oregonator +prog diff --git a/2015/endoh2/.gitignore b/2015/endoh2/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2015/endoh2/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2015/endoh3/.gitignore b/2015/endoh3/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2015/endoh3/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2015/endoh4/.gitignore b/2015/endoh4/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2015/endoh4/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2015/hou/.gitignore b/2015/hou/.gitignore new file mode 100644 index 000000000..9934da7fc --- /dev/null +++ b/2015/hou/.gitignore @@ -0,0 +1,2 @@ +prebuild +prog diff --git a/2015/howe/.gitignore b/2015/howe/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2015/howe/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2015/mills1/.gitignore b/2015/mills1/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2015/mills1/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2015/mills2/.gitignore b/2015/mills2/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2015/mills2/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2015/muth/.gitignore b/2015/muth/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2015/muth/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2015/schweikhardt/.gitignore b/2015/schweikhardt/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2015/schweikhardt/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2015/yang/.gitignore b/2015/yang/.gitignore new file mode 100644 index 000000000..7e746a13e --- /dev/null +++ b/2015/yang/.gitignore @@ -0,0 +1,7 @@ +prog +prog.cc +prog_c11 +prog_c90 +prog_c99 +prog_cpp11 +prog_cpp98 diff --git a/2018/algmyr/.gitignore b/2018/algmyr/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2018/algmyr/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2018/anderson/.gitignore b/2018/anderson/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2018/anderson/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2018/bellard/.gitignore b/2018/bellard/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2018/bellard/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2018/burton1/.gitignore b/2018/burton1/.gitignore new file mode 100644 index 000000000..199b25c10 --- /dev/null +++ b/2018/burton1/.gitignore @@ -0,0 +1,2 @@ +prog +prog.nowarn diff --git a/2018/burton2/.gitignore b/2018/burton2/.gitignore new file mode 100644 index 000000000..700e2c565 --- /dev/null +++ b/2018/burton2/.gitignore @@ -0,0 +1,2 @@ +keywords +prog diff --git a/2018/ciura/.gitignore b/2018/ciura/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2018/ciura/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2018/endoh1/.gitignore b/2018/endoh1/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2018/endoh1/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2018/endoh2/.gitignore b/2018/endoh2/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2018/endoh2/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2018/ferguson/.gitignore b/2018/ferguson/.gitignore index e626c23cc..af210664e 100644 --- a/2018/ferguson/.gitignore +++ b/2018/ferguson/.gitignore @@ -1,3 +1,4 @@ +prog prog-simple prog.orig weasel diff --git a/2018/giles/.gitignore b/2018/giles/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2018/giles/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2018/hou/.gitignore b/2018/hou/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2018/hou/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2018/mills/.gitignore b/2018/mills/.gitignore new file mode 100644 index 000000000..0b2e2bf71 --- /dev/null +++ b/2018/mills/.gitignore @@ -0,0 +1,9 @@ +builddisk.bsd +builddisk.v6 +empty.fs.bz2 +prog +rk05.bsd.fs +rk05.v6.fs +v0 +v6 +v6.img.bz2 diff --git a/2018/poikola/.gitignore b/2018/poikola/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2018/poikola/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2018/vokes/.gitignore b/2018/vokes/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2018/vokes/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2018/yang/.gitignore b/2018/yang/.gitignore new file mode 100644 index 000000000..7d70569fd --- /dev/null +++ b/2018/yang/.gitignore @@ -0,0 +1,12 @@ +generated1.c +generated2.c +generated3.c +generated4.c +generated5.c +left +msg0 +msg1 +msg2 +prog +right +shift diff --git a/2019/README.html b/2019/README.html deleted file mode 100644 index 127395ce4..000000000 --- a/2019/README.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - README - - -

2016 marked the “The Twenty Sixth International Obfuscated C Code Contest”

- -

Copyright © 2019, Landon Curt Noll, Simon Cooper, and Leonid A. -Broukhis. All Rights Reserved. Permission for personal, educational -or non-profit use is granted provided this copyright and notice are -included in its entirety and remains unaltered. All other uses -must receive prior permission from the contest judges.

- -

Standard IOCCC stuff

- -The primary site can be found at www.ioccc.org. - -

Use make to compile entries. It is possible that on non-Un*x / non-Linux -systems the makefile needs to be changed. See the Makefile for details.

- -

Look at the source and try to figure out what the programs do, and run -them with various inputs. If you want to, look at the hints files for -spoilers - this year we included most of the information included -by the submitter.

- -

Read over the makefile for compile/build issues. Your system may require -certain changes (add or remove a library, add or remove a #define).

- -

Some C compilers are not quite as good as they should be. If yours is -lacking, you may need to compile using clang or gcc instead of your local -compiler.

- -

Remarks on some of the winners

- -

This year’s winners are impressive!

- -

The “Most in need of debugging” (endoh) is very inventive in a way it produces its own text!

- -

The “Most likely to be awarded” (ciura) has an amazing vocabulary!

- -

There are again nods to winners of the years:

- -
[1991/davidguy](http://ioccc.org/years.html#1991_davidguy)
-[2011/blakely](http://ioccc.org/years.html#2011_blakely)
-
- -

These nods to not run afoul of the guideline:

- -
We tend to dislike programs that:
-...
-are rather similar to previous winners
-
- -

because the entry (dogon) appropriately pays homage to past winners -without blatantly reusing their code.

- -

…We’ll stop spouting spoilers now. Have fun exploring all the entries!

- -

Remarks on some of submissions that did not win

- -

Some entries tried to get around the size limit by submitting a data -file that was really C code and then blindly including code in prog.c.

- -

Quite a few entries suffered from undefined behavior like accessing -uninitialized locals and/or reading-writing below the stack. -We advise running your entry through valgrind to make sure those mistakes -are avoided.

- -

Using extra arguments to main, or arguments of wrong types as a quick and dirty -way of declaring variables is now passé. Clang, for example, rejects them outright.

- -

We hope the authors of some of those entries will fix and re-submit -them for the next IOCCC.

- -

Some entries seemed to have a good idea, but the implementation of -the idea was limited in scope.

- -

Final Comments

- -

Please feel free to send us comments and suggestions about the -competition, this README or anything else that you would like to see in -future contests.

- -

If you use, distribute or publish these entries in some way, please drop -us a line. We enjoy seeing who, where and how the contest is used.

- -

If you have problems with any of the entries, AND YOU HAVE A FIX, please -send us the fix (patch file or the entire changed file).

- - - - - -
Creative Commons License

© Copyright 1984-2019, -Leo Broukhis, Simon Cooper, Landon Curt Noll -- All rights reserved
-This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

 
- - diff --git a/2019/adamovsky/.gitignore b/2019/adamovsky/.gitignore new file mode 100644 index 000000000..1de53bd06 --- /dev/null +++ b/2019/adamovsky/.gitignore @@ -0,0 +1,4 @@ +identify.unl +iocccsize_2018 +prog +prog2 diff --git a/2019/burton/.gitignore b/2019/burton/.gitignore new file mode 100644 index 000000000..ac08449fb --- /dev/null +++ b/2019/burton/.gitignore @@ -0,0 +1,2 @@ +prog +prog.clean diff --git a/2019/ciura/.gitignore b/2019/ciura/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2019/ciura/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2019/diels-grabsch1/.gitignore b/2019/diels-grabsch1/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2019/diels-grabsch1/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2019/diels-grabsch2/.gitignore b/2019/diels-grabsch2/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2019/diels-grabsch2/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2019/dogon/.gitignore b/2019/dogon/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2019/dogon/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2019/duble/.gitignore b/2019/duble/.gitignore new file mode 100644 index 000000000..2b1e0c2ce --- /dev/null +++ b/2019/duble/.gitignore @@ -0,0 +1,2 @@ +Darwin +prog diff --git a/2019/endoh/.gitignore b/2019/endoh/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2019/endoh/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2019/giles/.gitignore b/2019/giles/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2019/giles/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2019/karns/.gitignore b/2019/karns/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2019/karns/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2019/lynn/.gitignore b/2019/lynn/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2019/lynn/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2019/mills/.gitignore b/2019/mills/.gitignore new file mode 100644 index 000000000..5613d8301 --- /dev/null +++ b/2019/mills/.gitignore @@ -0,0 +1,22 @@ +Eugene_Onegin.txt +IOCCC-Rules-Guidelines.txt +IOCCC-hints.txt +Shakespeare.txt +gru1 +gru2 +gru3 +lin1 +lstm1 +lstm2 +lstm3 +lstmp1 +lstmp2 +lstmp3 +per1 +prog +rlstm1 +rlstm2 +rlstm3 +rnn1 +rnn2 +rnn3 diff --git a/2019/poikola/.gitignore b/2019/poikola/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2019/poikola/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2019/yang/.gitignore b/2019/yang/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2019/yang/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2020/burton/.gitignore b/2020/burton/.gitignore new file mode 100644 index 000000000..92338fcef --- /dev/null +++ b/2020/burton/.gitignore @@ -0,0 +1,4 @@ +check +check_be +prog +prog_be diff --git a/2020/carlini/.gitignore b/2020/carlini/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2020/carlini/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2020/endoh1/.gitignore b/2020/endoh1/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2020/endoh1/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2020/endoh2/.gitignore b/2020/endoh2/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2020/endoh2/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2020/endoh3/.gitignore b/2020/endoh3/.gitignore new file mode 100644 index 000000000..2ac10321f --- /dev/null +++ b/2020/endoh3/.gitignore @@ -0,0 +1,4 @@ +clock +clock.c +prog +run_clock diff --git a/2020/ferguson1/.gitignore b/2020/ferguson1/.gitignore index 0f52baad6..560d31973 100644 --- a/2020/ferguson1/.gitignore +++ b/2020/ferguson1/.gitignore @@ -1,4 +1,5 @@ play +prog prog.alt snake snake-colours diff --git a/2020/ferguson2/.gitignore b/2020/ferguson2/.gitignore new file mode 100644 index 000000000..2a192830a --- /dev/null +++ b/2020/ferguson2/.gitignore @@ -0,0 +1,2 @@ +prog +recode diff --git a/2020/giles/.gitignore b/2020/giles/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2020/giles/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2020/kurdyukov1/.gitignore b/2020/kurdyukov1/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2020/kurdyukov1/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2020/kurdyukov2/.gitignore b/2020/kurdyukov2/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2020/kurdyukov2/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2020/kurdyukov3/.gitignore b/2020/kurdyukov3/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2020/kurdyukov3/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2020/kurdyukov4/.gitignore b/2020/kurdyukov4/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2020/kurdyukov4/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2020/otterness/.gitignore b/2020/otterness/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2020/otterness/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2020/tsoj/.gitignore b/2020/tsoj/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2020/tsoj/.gitignore @@ -0,0 +1 @@ +prog diff --git a/2020/yang/.gitignore b/2020/yang/.gitignore new file mode 100644 index 000000000..ea1749132 --- /dev/null +++ b/2020/yang/.gitignore @@ -0,0 +1 @@ +prog diff --git a/bin/sgit b/bin/sgit index cf8b12c1f..8cea29174 100755 --- a/bin/sgit +++ b/bin/sgit @@ -13,6 +13,10 @@ # how it is and I don't think it would do good to add any additional features # except perhaps allowing for one to specify path to sed. # +# A limitation is that if the sed command has spaces it will be a problem. +# Whether this will be fixed is not yet decided. I have some ideas of how it +# might happen but it might not be worth it. +# # - Cody Boone Ferguson (@xexyl) #