fix 1998 Makefiles
This commit is contained in:
1 parent
4ea61e331b
commit
37b80374df
42 files changed
+4560
-2330
No files matched your search
+10
-5
@@ -46,12 +46,17 @@
|
|||||||
# See: http://creativecommons.org/licenses/by-sa/3.0/
|
# See: http://creativecommons.org/licenses/by-sa/3.0/
|
||||||
|
|
||||||
|
|
||||||
################
|
#############################
|
||||||
# tool locations
|
# shell used by this Makefile
|
||||||
################
|
#############################
|
||||||
#
|
#
|
||||||
SHELL= /bin/bash
|
SHELL= bash
|
||||||
MAKE= make
|
|
||||||
|
#######################
|
||||||
|
# common tool locations
|
||||||
|
#######################
|
||||||
|
#
|
||||||
|
include ../var.mk
|
||||||
|
|
||||||
|
|
||||||
###############
|
###############
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
banks
|
banks
|
||||||
|
banks.alt
|
||||||
+320
-151
@@ -1,174 +1,343 @@
|
|||||||
#!/bin/make
|
#!/usr/bin/env make
|
||||||
# 1998 makefile
|
|
||||||
#
|
#
|
||||||
# Copyright (c) Landon Curt Noll, Jeremy Horn, Peter Seebach
|
# IOCCC 1998 winning entry - banks
|
||||||
# and Leonid A. Broukhis, 1999.
|
|
||||||
# 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 the contest judges.
|
|
||||||
|
|
||||||
SHELL=/bin/sh
|
################################################################################
|
||||||
CAT=cat
|
#
|
||||||
CHMOD=chmod
|
# An Historical Makefile NOTE:
|
||||||
CP=cp
|
#
|
||||||
MV=mv
|
# The orig.Makefile, if it exits, is the original Makefile before this IOCCC
|
||||||
LN=ln
|
# year directory was reworked so that entries are in separate directories.
|
||||||
RM=rm
|
# This also applies to any orig.ansi.mk and orig.common.mk files.
|
||||||
SED=sed
|
#
|
||||||
TRUE=true
|
# 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
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
# flags for ANSI compiles
|
# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
|
||||||
#
|
#
|
||||||
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode,
|
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||||
# 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
|
# See: http://creativecommons.org/licenses/by-sa/3.0/
|
||||||
# incorrectly. You might want to turn on -O to see if your
|
|
||||||
# compiler can handle them.
|
|
||||||
#
|
|
||||||
# NOTE: On some systems, the library path does not include the location
|
|
||||||
# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir
|
|
||||||
# in order to compile with these libs.
|
|
||||||
#
|
|
||||||
#CFLAGS=-O -Xa
|
|
||||||
#CFLAGS=-Xa
|
|
||||||
CFLAGS= -ansi
|
|
||||||
#CFLAGS= -ansi -O
|
|
||||||
#CFLAGS=
|
|
||||||
#CFLAGS= -ansi -L/usr/X11R6/lib
|
|
||||||
|
|
||||||
# ANSI compiler
|
|
||||||
|
#############################
|
||||||
|
# shell used by this Makefile
|
||||||
|
#############################
|
||||||
#
|
#
|
||||||
# Set CC to the name of your ANSI compiler.
|
SHELL= bash
|
||||||
|
|
||||||
|
#######################
|
||||||
|
# common tool locations
|
||||||
|
#######################
|
||||||
#
|
#
|
||||||
# Some entries seem to need gcc. If you have gcc, set
|
include ../../var.mk
|
||||||
# both CC and MAY_NEED_GCC to gcc.
|
|
||||||
|
# Set X11_LIBDIR to the directory where the X11 library resides
|
||||||
#
|
#
|
||||||
# If you do not have gcc, set CC to the name of your ANSI compiler, and
|
#X11_LIBDIR= /usr/X11R6/lib
|
||||||
# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just :
|
#X11_LIBDIR= /usr/X11/lib
|
||||||
# to disable such programs.
|
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-empty-body -Wno-error -Wno-implicit-function-declaration \
|
||||||
|
-Wno-unsequenced -Wno-incompatible-pointer-types
|
||||||
|
|
||||||
|
# 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= -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
||||||
|
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
||||||
|
-DCS=XK_Return -Ddt=0.02
|
||||||
|
|
||||||
|
# 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= cc
|
||||||
MAY_NEED_GCC= gcc
|
#CC=clang
|
||||||
|
#CC=gcc
|
||||||
|
|
||||||
# winners that compile under ANSI C
|
# Compiler add-ons or replacements for clang only
|
||||||
#
|
#
|
||||||
WINNERS= schweikh1 df dloweneil banks dlowe bas2 fanf bas1 tomtorfs dorssel \
|
ifeq ($(CC),clang)
|
||||||
schweikh2 schnitzi chaos schweikh3
|
|
||||||
ALT_NAMES= schweikh2.orig banks.orig dlowe.orig df.orig schweikh1.orig \
|
|
||||||
chaos_nohalf
|
|
||||||
DATA_FILES= banks_files chaos_files fanf_files schweikh1_files schweikh3_files
|
|
||||||
|
|
||||||
|
|
||||||
all: ${WINNERS}
|
|
||||||
|
|
||||||
schweikh1: schweikh1.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh1.orig: schweikh1.orig.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh1_files: info
|
|
||||||
|
|
||||||
df: df.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
df.orig: prog.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
prog.c : df.c
|
|
||||||
${RM} -f prog.c
|
|
||||||
${CP} $? prog.c
|
|
||||||
|
|
||||||
dloweneil: dloweneil.c
|
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
|
|
||||||
# See note about use of -L/path/to/X11/lib/dir above this rule fails to link
|
|
||||||
#
|
#
|
||||||
banks: banks.c
|
CSILENCE+= -Wno-comma -Wno-float-conversion -Wno-float-equal \
|
||||||
${CC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
-Wno-missing-variable-declarations -Wno-poison-system-directories \
|
||||||
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
-Wno-shadow -Wno-shorten-64-to-32
|
||||||
-DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@
|
|
||||||
|
|
||||||
# See note about use of -L/path/to/X11/lib/dir above this rule fails to link
|
|
||||||
#
|
#
|
||||||
banks.orig: banks.orig.c
|
CWARN+= -Weverything
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
|
||||||
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
|
||||||
-DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@
|
|
||||||
|
|
||||||
banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc
|
|
||||||
|
|
||||||
dlowe: dlowe.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
dlowe.orig: dlowe.orig.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
bas2: bas2.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
fanf: fanf.c
|
|
||||||
${RM} -f fanftmp1.c fanftmp2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@
|
|
||||||
|
|
||||||
fanf_files: fanf.lambda
|
|
||||||
|
|
||||||
bas1: bas1.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
tomtorfs: tomtorfs.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
dorssel: dorssel.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh2: schweikh2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh2.orig: schweikh2.orig.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh3: schweikh3.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \
|
|
||||||
-DM3=realloc -DM4=calloc -DM5=free -o $@
|
|
||||||
|
|
||||||
schweikh3_files: samefile.1
|
|
||||||
|
|
||||||
schnitzi: schnitzi.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
chaos: chaos.c
|
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
|
|
||||||
# some libcurses do not have halfdelay(). This rule is for those systems
|
|
||||||
#
|
#
|
||||||
chaos_nohalf: chaos_nohalf.c
|
endif
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
${CP} -f $@ chaos
|
|
||||||
|
|
||||||
chaos_nohalf.c: chaos.c
|
# Specific add-ons or replacements for gcc only
|
||||||
${RM} -f $@
|
#
|
||||||
${SED} -e 's/halfdelay([^)]*);//' < $? > $@
|
ifeq ($(CC),gcc)
|
||||||
|
#
|
||||||
|
#CSILENCE+=
|
||||||
|
#
|
||||||
|
#CWARN+=
|
||||||
|
#
|
||||||
|
endif
|
||||||
|
|
||||||
chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data
|
|
||||||
|
|
||||||
everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES}
|
##############################
|
||||||
|
# Special flags for this entry
|
||||||
|
##############################
|
||||||
|
#
|
||||||
|
ENTRY= banks
|
||||||
|
PROG= ${ENTRY}
|
||||||
|
#
|
||||||
|
OBJ= ${PROG}.o
|
||||||
|
DATA= bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc
|
||||||
|
TARGET= ${PROG} ${PROG}.alt
|
||||||
|
#
|
||||||
|
ALT_OBJ= ${PROG}.alt.o
|
||||||
|
ALT_TARGET= ${PROG}.alt
|
||||||
|
|
||||||
clean:
|
|
||||||
${RM} -f *.o a.out core ${WINNERS}
|
|
||||||
${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c
|
|
||||||
|
|
||||||
clobber: clean
|
#################
|
||||||
${RM} -f ${WINNERS}
|
# build the entry
|
||||||
${RM} -f ${ALT_NAMES}
|
#################
|
||||||
|
#
|
||||||
nuke: clobber
|
all: data ${TARGET}
|
||||||
@${TRUE}
|
@${TRUE}
|
||||||
|
|
||||||
install: all
|
.PHONY: all alt data everything clean clobber install \
|
||||||
${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null
|
love haste waste maker easter_egg sandwich \
|
||||||
|
supernova deep_magic magic charon pluto
|
||||||
|
|
||||||
|
${PROG}: ${PROG}.c
|
||||||
|
${CC} ${CFLAGS} $< -o $@ ${LIBS}
|
||||||
|
|
||||||
|
${PROG}.alt: ${PROG}.alt.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 ${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:
|
||||||
|
@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 '<was here>' /\\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"
|
||||||
+8
-10
@@ -1,4 +1,4 @@
|
|||||||
Best of Show:
|
# Best of Show:
|
||||||
|
|
||||||
Carl Banks
|
Carl Banks
|
||||||
Penn State Department of Aerospace Engineering
|
Penn State Department of Aerospace Engineering
|
||||||
@@ -8,17 +8,16 @@ Best of Show:
|
|||||||
|
|
||||||
http://www.personal.psu.edu/users/c/w/cwb129/
|
http://www.personal.psu.edu/users/c/w/cwb129/
|
||||||
|
|
||||||
|
## To build:
|
||||||
|
|
||||||
Judge's Comments:
|
make all
|
||||||
|
|
||||||
To build:
|
### To run
|
||||||
|
|
||||||
make banks
|
|
||||||
|
|
||||||
To use:
|
|
||||||
|
|
||||||
cat horizon.sc pittsburgh.sc | ./banks
|
cat horizon.sc pittsburgh.sc | ./banks
|
||||||
|
|
||||||
|
## Judges' comments
|
||||||
|
|
||||||
What can we say? It's a flight sim done in 1536 bytes of real code.
|
What can we say? It's a flight sim done in 1536 bytes of real code.
|
||||||
This one is a real marvel. When people say the size limits are too
|
This one is a real marvel. When people say the size limits are too
|
||||||
tight, well, we can just point them at this one. This program really
|
tight, well, we can just point them at this one. This program really
|
||||||
@@ -31,10 +30,9 @@ Judge's Comments:
|
|||||||
the altitude and airspeed. These problems have been fixed. One can
|
the altitude and airspeed. These problems have been fixed. One can
|
||||||
still build the original program by:
|
still build the original program by:
|
||||||
|
|
||||||
make banks.orig
|
make banks.alt
|
||||||
|
|
||||||
|
## Author's comments
|
||||||
Selected Author's Comments:
|
|
||||||
|
|
||||||
You have just stepped out of the real world and into the
|
You have just stepped out of the real world and into the
|
||||||
virtual. You are now sitting in the cockpit of a Piper Cherokee
|
virtual. You are now sitting in the cockpit of a Piper Cherokee
|
||||||
|
|||||||
File renamed without changes.
+317
-151
@@ -1,174 +1,340 @@
|
|||||||
#!/bin/make
|
#!/usr/bin/env make
|
||||||
# 1998 makefile
|
|
||||||
#
|
#
|
||||||
# Copyright (c) Landon Curt Noll, Jeremy Horn, Peter Seebach
|
# IOCCC 1998 winning entry - bas1
|
||||||
# and Leonid A. Broukhis, 1999.
|
|
||||||
# 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 the contest judges.
|
|
||||||
|
|
||||||
SHELL=/bin/sh
|
################################################################################
|
||||||
CAT=cat
|
#
|
||||||
CHMOD=chmod
|
# An Historical Makefile NOTE:
|
||||||
CP=cp
|
#
|
||||||
MV=mv
|
# The orig.Makefile, if it exits, is the original Makefile before this IOCCC
|
||||||
LN=ln
|
# year directory was reworked so that entries are in separate directories.
|
||||||
RM=rm
|
# This also applies to any orig.ansi.mk and orig.common.mk files.
|
||||||
SED=sed
|
#
|
||||||
TRUE=true
|
# 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
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
# flags for ANSI compiles
|
# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
|
||||||
#
|
#
|
||||||
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode,
|
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||||
# 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
|
# See: http://creativecommons.org/licenses/by-sa/3.0/
|
||||||
# incorrectly. You might want to turn on -O to see if your
|
|
||||||
# compiler can handle them.
|
|
||||||
#
|
|
||||||
# NOTE: On some systems, the library path does not include the location
|
|
||||||
# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir
|
|
||||||
# in order to compile with these libs.
|
|
||||||
#
|
|
||||||
#CFLAGS=-O -Xa
|
|
||||||
#CFLAGS=-Xa
|
|
||||||
CFLAGS= -ansi
|
|
||||||
#CFLAGS= -ansi -O
|
|
||||||
#CFLAGS=
|
|
||||||
#CFLAGS= -ansi -L/usr/X11R6/lib
|
|
||||||
|
|
||||||
# ANSI compiler
|
|
||||||
|
#############################
|
||||||
|
# shell used by this Makefile
|
||||||
|
#############################
|
||||||
#
|
#
|
||||||
# Set CC to the name of your ANSI compiler.
|
SHELL= bash
|
||||||
|
|
||||||
|
#######################
|
||||||
|
# common tool locations
|
||||||
|
#######################
|
||||||
#
|
#
|
||||||
# Some entries seem to need gcc. If you have gcc, set
|
include ../../var.mk
|
||||||
# both CC and MAY_NEED_GCC to gcc.
|
|
||||||
|
# Set X11_LIBDIR to the directory where the X11 library resides
|
||||||
#
|
#
|
||||||
# If you do not have gcc, set CC to the name of your ANSI compiler, and
|
#X11_LIBDIR= /usr/X11R6/lib
|
||||||
# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just :
|
#X11_LIBDIR= /usr/X11/lib
|
||||||
# to disable such programs.
|
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-bitwise-conditional-parentheses -Wno-bitwise-op-parentheses \
|
||||||
|
-Wno-empty-body -Wno-invalid-source-encoding -Wno-main -Wno-parentheses \
|
||||||
|
-Wno-shift-op-parentheses
|
||||||
|
|
||||||
|
# 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= cc
|
||||||
MAY_NEED_GCC= gcc
|
#CC=clang
|
||||||
|
#CC=gcc
|
||||||
|
|
||||||
# winners that compile under ANSI C
|
# Compiler add-ons or replacements for clang only
|
||||||
#
|
#
|
||||||
WINNERS= schweikh1 df dloweneil banks dlowe bas2 fanf bas1 tomtorfs dorssel \
|
ifeq ($(CC),clang)
|
||||||
schweikh2 schnitzi chaos schweikh3
|
|
||||||
ALT_NAMES= schweikh2.orig banks.orig dlowe.orig df.orig schweikh1.orig \
|
|
||||||
chaos_nohalf
|
|
||||||
DATA_FILES= banks_files chaos_files fanf_files schweikh1_files schweikh3_files
|
|
||||||
|
|
||||||
|
|
||||||
all: ${WINNERS}
|
|
||||||
|
|
||||||
schweikh1: schweikh1.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh1.orig: schweikh1.orig.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh1_files: info
|
|
||||||
|
|
||||||
df: df.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
df.orig: prog.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
prog.c : df.c
|
|
||||||
${RM} -f prog.c
|
|
||||||
${CP} $? prog.c
|
|
||||||
|
|
||||||
dloweneil: dloweneil.c
|
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
|
|
||||||
# See note about use of -L/path/to/X11/lib/dir above this rule fails to link
|
|
||||||
#
|
#
|
||||||
banks: banks.c
|
CSILENCE+= -Wno-comma -Wno-implicit-int-conversion -Wno-missing-prototypes \
|
||||||
${CC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
-Wno-missing-variable-declarations -Wno-pedantic \
|
||||||
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
-Wno-poison-system-directories -Wno-shorten-64-to-32 -Wno-sign-conversion \
|
||||||
-DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@
|
-Wno-strict-prototypes
|
||||||
|
|
||||||
# See note about use of -L/path/to/X11/lib/dir above this rule fails to link
|
|
||||||
#
|
#
|
||||||
banks.orig: banks.orig.c
|
CWARN+= -Weverything
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
|
||||||
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
|
||||||
-DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@
|
|
||||||
|
|
||||||
banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc
|
|
||||||
|
|
||||||
dlowe: dlowe.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
dlowe.orig: dlowe.orig.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
bas2: bas2.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
fanf: fanf.c
|
|
||||||
${RM} -f fanftmp1.c fanftmp2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@
|
|
||||||
|
|
||||||
fanf_files: fanf.lambda
|
|
||||||
|
|
||||||
bas1: bas1.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
tomtorfs: tomtorfs.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
dorssel: dorssel.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh2: schweikh2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh2.orig: schweikh2.orig.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh3: schweikh3.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \
|
|
||||||
-DM3=realloc -DM4=calloc -DM5=free -o $@
|
|
||||||
|
|
||||||
schweikh3_files: samefile.1
|
|
||||||
|
|
||||||
schnitzi: schnitzi.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
chaos: chaos.c
|
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
|
|
||||||
# some libcurses do not have halfdelay(). This rule is for those systems
|
|
||||||
#
|
#
|
||||||
chaos_nohalf: chaos_nohalf.c
|
endif
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
${CP} -f $@ chaos
|
|
||||||
|
|
||||||
chaos_nohalf.c: chaos.c
|
# Specific add-ons or replacements for gcc only
|
||||||
${RM} -f $@
|
#
|
||||||
${SED} -e 's/halfdelay([^)]*);//' < $? > $@
|
ifeq ($(CC),gcc)
|
||||||
|
#
|
||||||
|
#CSILENCE+=
|
||||||
|
#
|
||||||
|
#CWARN+=
|
||||||
|
#
|
||||||
|
endif
|
||||||
|
|
||||||
chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data
|
|
||||||
|
|
||||||
everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES}
|
##############################
|
||||||
|
# Special flags for this entry
|
||||||
|
##############################
|
||||||
|
#
|
||||||
|
ENTRY= bas1
|
||||||
|
PROG= ${ENTRY}
|
||||||
|
#
|
||||||
|
OBJ= ${PROG}.o
|
||||||
|
DATA=
|
||||||
|
TARGET= ${PROG}
|
||||||
|
#
|
||||||
|
ALT_OBJ=
|
||||||
|
ALT_TARGET=
|
||||||
|
|
||||||
clean:
|
|
||||||
${RM} -f *.o a.out core ${WINNERS}
|
|
||||||
${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c
|
|
||||||
|
|
||||||
clobber: clean
|
#################
|
||||||
${RM} -f ${WINNERS}
|
# build the entry
|
||||||
${RM} -f ${ALT_NAMES}
|
#################
|
||||||
|
#
|
||||||
nuke: clobber
|
all: data ${TARGET}
|
||||||
@${TRUE}
|
@${TRUE}
|
||||||
|
|
||||||
install: all
|
.PHONY: all alt data everything clean clobber install \
|
||||||
${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null
|
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 ${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:
|
||||||
|
@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 '<was here>' /\\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"
|
||||||
+7
-9
@@ -1,4 +1,4 @@
|
|||||||
Best Encapsulation:
|
# Best Encapsulation:
|
||||||
|
|
||||||
Bas de Bakker
|
Bas de Bakker
|
||||||
Pica, Centre for Library Automation
|
Pica, Centre for Library Automation
|
||||||
@@ -6,14 +6,11 @@ Best Encapsulation:
|
|||||||
3039 JN Rotterdam
|
3039 JN Rotterdam
|
||||||
The Netherlands
|
The Netherlands
|
||||||
|
|
||||||
|
## To build:
|
||||||
|
|
||||||
Judges' comments:
|
make all
|
||||||
|
|
||||||
To build:
|
### To run
|
||||||
|
|
||||||
make bas1
|
|
||||||
|
|
||||||
To use:
|
|
||||||
|
|
||||||
If lpr on your system can print PostScript:
|
If lpr on your system can print PostScript:
|
||||||
|
|
||||||
@@ -25,14 +22,15 @@ Judges' comments:
|
|||||||
or:
|
or:
|
||||||
./bas1 | gunzip | gs -sDEVICE=pgmraw -sOutputFile='|xv -' -
|
./bas1 | gunzip | gs -sDEVICE=pgmraw -sOutputFile='|xv -' -
|
||||||
|
|
||||||
|
## Judges' comments
|
||||||
|
|
||||||
The output is supposed to be a 3D maze, but it is somewhat more
|
The output is supposed to be a 3D maze, but it is somewhat more
|
||||||
than that. If you've seen any of the Maurits Escher's works,
|
than that. If you've seen any of the Maurits Escher's works,
|
||||||
you'll know what we're talking about.
|
you'll know what we're talking about.
|
||||||
|
|
||||||
When trying to run the program with command line arguments, be generous.
|
When trying to run the program with command line arguments, be generous.
|
||||||
|
|
||||||
|
## Author's comments
|
||||||
Selected Author's Comments:
|
|
||||||
|
|
||||||
BEMAZING
|
BEMAZING
|
||||||
========
|
========
|
||||||
|
|||||||
+313
-151
@@ -1,174 +1,336 @@
|
|||||||
#!/bin/make
|
#!/usr/bin/env make
|
||||||
# 1998 makefile
|
|
||||||
#
|
#
|
||||||
# Copyright (c) Landon Curt Noll, Jeremy Horn, Peter Seebach
|
# IOCCC 1998 winning entry - bas2
|
||||||
# and Leonid A. Broukhis, 1999.
|
|
||||||
# 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 the contest judges.
|
|
||||||
|
|
||||||
SHELL=/bin/sh
|
################################################################################
|
||||||
CAT=cat
|
#
|
||||||
CHMOD=chmod
|
# An Historical Makefile NOTE:
|
||||||
CP=cp
|
#
|
||||||
MV=mv
|
# The orig.Makefile, if it exits, is the original Makefile before this IOCCC
|
||||||
LN=ln
|
# year directory was reworked so that entries are in separate directories.
|
||||||
RM=rm
|
# This also applies to any orig.ansi.mk and orig.common.mk files.
|
||||||
SED=sed
|
#
|
||||||
TRUE=true
|
# 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
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
# flags for ANSI compiles
|
# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
|
||||||
#
|
#
|
||||||
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode,
|
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||||
# 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
|
# See: http://creativecommons.org/licenses/by-sa/3.0/
|
||||||
# incorrectly. You might want to turn on -O to see if your
|
|
||||||
# compiler can handle them.
|
|
||||||
#
|
|
||||||
# NOTE: On some systems, the library path does not include the location
|
|
||||||
# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir
|
|
||||||
# in order to compile with these libs.
|
|
||||||
#
|
|
||||||
#CFLAGS=-O -Xa
|
|
||||||
#CFLAGS=-Xa
|
|
||||||
CFLAGS= -ansi
|
|
||||||
#CFLAGS= -ansi -O
|
|
||||||
#CFLAGS=
|
|
||||||
#CFLAGS= -ansi -L/usr/X11R6/lib
|
|
||||||
|
|
||||||
# ANSI compiler
|
|
||||||
|
#############################
|
||||||
|
# shell used by this Makefile
|
||||||
|
#############################
|
||||||
#
|
#
|
||||||
# Set CC to the name of your ANSI compiler.
|
SHELL= bash
|
||||||
|
|
||||||
|
#######################
|
||||||
|
# common tool locations
|
||||||
|
#######################
|
||||||
#
|
#
|
||||||
# Some entries seem to need gcc. If you have gcc, set
|
include ../../var.mk
|
||||||
# both CC and MAY_NEED_GCC to gcc.
|
|
||||||
|
# Set X11_LIBDIR to the directory where the X11 library resides
|
||||||
#
|
#
|
||||||
# If you do not have gcc, set CC to the name of your ANSI compiler, and
|
#X11_LIBDIR= /usr/X11R6/lib
|
||||||
# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just :
|
#X11_LIBDIR= /usr/X11/lib
|
||||||
# to disable such programs.
|
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-main
|
||||||
|
|
||||||
|
# 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= cc
|
||||||
MAY_NEED_GCC= gcc
|
#CC=clang
|
||||||
|
#CC=gcc
|
||||||
|
|
||||||
# winners that compile under ANSI C
|
# Compiler add-ons or replacements for clang only
|
||||||
#
|
#
|
||||||
WINNERS= schweikh1 df dloweneil banks dlowe bas2 fanf bas1 tomtorfs dorssel \
|
ifeq ($(CC),clang)
|
||||||
schweikh2 schnitzi chaos schweikh3
|
|
||||||
ALT_NAMES= schweikh2.orig banks.orig dlowe.orig df.orig schweikh1.orig \
|
|
||||||
chaos_nohalf
|
|
||||||
DATA_FILES= banks_files chaos_files fanf_files schweikh1_files schweikh3_files
|
|
||||||
|
|
||||||
|
|
||||||
all: ${WINNERS}
|
|
||||||
|
|
||||||
schweikh1: schweikh1.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh1.orig: schweikh1.orig.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh1_files: info
|
|
||||||
|
|
||||||
df: df.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
df.orig: prog.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
prog.c : df.c
|
|
||||||
${RM} -f prog.c
|
|
||||||
${CP} $? prog.c
|
|
||||||
|
|
||||||
dloweneil: dloweneil.c
|
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
|
|
||||||
# See note about use of -L/path/to/X11/lib/dir above this rule fails to link
|
|
||||||
#
|
#
|
||||||
banks: banks.c
|
CSILENCE+= -Wno-comma -Wno-missing-variable-declarations -Wno-pedantic \
|
||||||
${CC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
-Wno-poison-system-directories
|
||||||
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
|
||||||
-DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@
|
|
||||||
|
|
||||||
# See note about use of -L/path/to/X11/lib/dir above this rule fails to link
|
|
||||||
#
|
#
|
||||||
banks.orig: banks.orig.c
|
CWARN+= -Weverything
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
|
||||||
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
|
||||||
-DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@
|
|
||||||
|
|
||||||
banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc
|
|
||||||
|
|
||||||
dlowe: dlowe.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
dlowe.orig: dlowe.orig.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
bas2: bas2.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
fanf: fanf.c
|
|
||||||
${RM} -f fanftmp1.c fanftmp2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@
|
|
||||||
|
|
||||||
fanf_files: fanf.lambda
|
|
||||||
|
|
||||||
bas1: bas1.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
tomtorfs: tomtorfs.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
dorssel: dorssel.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh2: schweikh2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh2.orig: schweikh2.orig.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh3: schweikh3.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \
|
|
||||||
-DM3=realloc -DM4=calloc -DM5=free -o $@
|
|
||||||
|
|
||||||
schweikh3_files: samefile.1
|
|
||||||
|
|
||||||
schnitzi: schnitzi.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
chaos: chaos.c
|
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
|
|
||||||
# some libcurses do not have halfdelay(). This rule is for those systems
|
|
||||||
#
|
#
|
||||||
chaos_nohalf: chaos_nohalf.c
|
endif
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
${CP} -f $@ chaos
|
|
||||||
|
|
||||||
chaos_nohalf.c: chaos.c
|
# Specific add-ons or replacements for gcc only
|
||||||
${RM} -f $@
|
#
|
||||||
${SED} -e 's/halfdelay([^)]*);//' < $? > $@
|
ifeq ($(CC),gcc)
|
||||||
|
#
|
||||||
|
#CSILENCE+=
|
||||||
|
#
|
||||||
|
#CWARN+=
|
||||||
|
#
|
||||||
|
endif
|
||||||
|
|
||||||
chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data
|
|
||||||
|
|
||||||
everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES}
|
##############################
|
||||||
|
# Special flags for this entry
|
||||||
|
##############################
|
||||||
|
#
|
||||||
|
ENTRY= bas2
|
||||||
|
PROG= ${ENTRY}
|
||||||
|
#
|
||||||
|
OBJ= ${PROG}.o
|
||||||
|
DATA=
|
||||||
|
TARGET= ${PROG}
|
||||||
|
#
|
||||||
|
ALT_OBJ=
|
||||||
|
ALT_TARGET=
|
||||||
|
|
||||||
clean:
|
|
||||||
${RM} -f *.o a.out core ${WINNERS}
|
|
||||||
${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c
|
|
||||||
|
|
||||||
clobber: clean
|
#################
|
||||||
${RM} -f ${WINNERS}
|
# build the entry
|
||||||
${RM} -f ${ALT_NAMES}
|
#################
|
||||||
|
#
|
||||||
nuke: clobber
|
all: data ${TARGET}
|
||||||
@${TRUE}
|
@${TRUE}
|
||||||
|
|
||||||
install: all
|
.PHONY: all alt data everything clean clobber install \
|
||||||
${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null
|
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 ${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:
|
||||||
|
@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 '<was here>' /\\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"
|
||||||
+7
-9
@@ -1,4 +1,4 @@
|
|||||||
Best Small Program:
|
# Best Small Program:
|
||||||
|
|
||||||
Bas de Bakker
|
Bas de Bakker
|
||||||
Pica, Centre for Library Automation
|
Pica, Centre for Library Automation
|
||||||
@@ -6,17 +6,16 @@ Best Small Program:
|
|||||||
3039 JN Rotterdam
|
3039 JN Rotterdam
|
||||||
The Netherlands
|
The Netherlands
|
||||||
|
|
||||||
|
## To build:
|
||||||
|
|
||||||
Judges' comments:
|
make all
|
||||||
|
|
||||||
To build:
|
### To run
|
||||||
|
|
||||||
make bas2
|
|
||||||
|
|
||||||
To use:
|
|
||||||
|
|
||||||
./bas2 < bas2.c
|
./bas2 < bas2.c
|
||||||
|
|
||||||
|
## Judges' comments
|
||||||
|
|
||||||
Questions to ponder:
|
Questions to ponder:
|
||||||
|
|
||||||
Can you determine the relationship between the input and the
|
Can you determine the relationship between the input and the
|
||||||
@@ -33,8 +32,7 @@ Judges' comments:
|
|||||||
official IOCCC rules. What is the rule and what is the octet
|
official IOCCC rules. What is the rule and what is the octet
|
||||||
value?
|
value?
|
||||||
|
|
||||||
|
## Author's comments
|
||||||
Selected Author's Comments:
|
|
||||||
|
|
||||||
The main obfuscation is the way characters are recognized, which is
|
The main obfuscation is the way characters are recognized, which is
|
||||||
done by matching the bit patterns. Minor obfuscations are:
|
done by matching the bit patterns. Minor obfuscations are:
|
||||||
|
|||||||
@@ -1 +1,3 @@
|
|||||||
chaos
|
chaos
|
||||||
|
chaos_nohalf
|
||||||
|
chaos_nohalf.c
|
||||||
+324
-152
@@ -1,174 +1,346 @@
|
|||||||
#!/bin/make
|
#!/usr/bin/env make
|
||||||
# 1998 makefile
|
|
||||||
#
|
#
|
||||||
# Copyright (c) Landon Curt Noll, Jeremy Horn, Peter Seebach
|
# IOCCC 1998 winning entry - chaos
|
||||||
# and Leonid A. Broukhis, 1999.
|
|
||||||
# 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 the contest judges.
|
|
||||||
|
|
||||||
SHELL=/bin/sh
|
################################################################################
|
||||||
CAT=cat
|
#
|
||||||
CHMOD=chmod
|
# An Historical Makefile NOTE:
|
||||||
CP=cp
|
#
|
||||||
MV=mv
|
# The orig.Makefile, if it exits, is the original Makefile before this IOCCC
|
||||||
LN=ln
|
# year directory was reworked so that entries are in separate directories.
|
||||||
RM=rm
|
# This also applies to any orig.ansi.mk and orig.common.mk files.
|
||||||
SED=sed
|
#
|
||||||
TRUE=true
|
# 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
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
# flags for ANSI compiles
|
# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
|
||||||
#
|
#
|
||||||
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode,
|
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||||
# 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
|
# See: http://creativecommons.org/licenses/by-sa/3.0/
|
||||||
# incorrectly. You might want to turn on -O to see if your
|
|
||||||
# compiler can handle them.
|
|
||||||
#
|
|
||||||
# NOTE: On some systems, the library path does not include the location
|
|
||||||
# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir
|
|
||||||
# in order to compile with these libs.
|
|
||||||
#
|
|
||||||
#CFLAGS=-O -Xa
|
|
||||||
#CFLAGS=-Xa
|
|
||||||
CFLAGS= -ansi
|
|
||||||
#CFLAGS= -ansi -O
|
|
||||||
#CFLAGS=
|
|
||||||
#CFLAGS= -ansi -L/usr/X11R6/lib
|
|
||||||
|
|
||||||
# ANSI compiler
|
|
||||||
|
#############################
|
||||||
|
# shell used by this Makefile
|
||||||
|
#############################
|
||||||
#
|
#
|
||||||
# Set CC to the name of your ANSI compiler.
|
SHELL= bash
|
||||||
|
|
||||||
|
#######################
|
||||||
|
# common tool locations
|
||||||
|
#######################
|
||||||
#
|
#
|
||||||
# Some entries seem to need gcc. If you have gcc, set
|
include ../../var.mk
|
||||||
# both CC and MAY_NEED_GCC to gcc.
|
|
||||||
|
# Set X11_LIBDIR to the directory where the X11 library resides
|
||||||
#
|
#
|
||||||
# If you do not have gcc, set CC to the name of your ANSI compiler, and
|
#X11_LIBDIR= /usr/X11R6/lib
|
||||||
# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just :
|
#X11_LIBDIR= /usr/X11/lib
|
||||||
# to disable such programs.
|
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-c99-extensions
|
||||||
|
|
||||||
|
# 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= -lcurses
|
||||||
|
#LIBS= -L ${X11_LIBDIR} -lX11
|
||||||
|
#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL
|
||||||
|
|
||||||
|
# C compiler to use
|
||||||
#
|
#
|
||||||
CC= cc
|
CC= cc
|
||||||
MAY_NEED_GCC= gcc
|
#CC=clang
|
||||||
|
#CC=gcc
|
||||||
|
|
||||||
# winners that compile under ANSI C
|
# Compiler add-ons or replacements for clang only
|
||||||
#
|
#
|
||||||
WINNERS= schweikh1 df dloweneil banks dlowe bas2 fanf bas1 tomtorfs dorssel \
|
ifeq ($(CC),clang)
|
||||||
schweikh2 schnitzi chaos schweikh3
|
|
||||||
ALT_NAMES= schweikh2.orig banks.orig dlowe.orig df.orig schweikh1.orig \
|
|
||||||
chaos_nohalf
|
|
||||||
DATA_FILES= banks_files chaos_files fanf_files schweikh1_files schweikh3_files
|
|
||||||
|
|
||||||
|
|
||||||
all: ${WINNERS}
|
|
||||||
|
|
||||||
schweikh1: schweikh1.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh1.orig: schweikh1.orig.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh1_files: info
|
|
||||||
|
|
||||||
df: df.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
df.orig: prog.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
prog.c : df.c
|
|
||||||
${RM} -f prog.c
|
|
||||||
${CP} $? prog.c
|
|
||||||
|
|
||||||
dloweneil: dloweneil.c
|
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
|
|
||||||
# See note about use of -L/path/to/X11/lib/dir above this rule fails to link
|
|
||||||
#
|
#
|
||||||
banks: banks.c
|
CSILENCE+= -Wno-bad-function-cast -Wno-double-promotion -Wno-float-conversion \
|
||||||
${CC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
-Wno-format-nonliteral -Wno-implicit-float-conversion \
|
||||||
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
-Wno-missing-variable-declarations -Wno-poison-system-directories \
|
||||||
-DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@
|
-Wno-sign-conversion
|
||||||
|
|
||||||
# See note about use of -L/path/to/X11/lib/dir above this rule fails to link
|
|
||||||
#
|
#
|
||||||
banks.orig: banks.orig.c
|
CWARN+= -Weverything
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
|
||||||
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
|
||||||
-DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@
|
|
||||||
|
|
||||||
banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc
|
|
||||||
|
|
||||||
dlowe: dlowe.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
dlowe.orig: dlowe.orig.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
bas2: bas2.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
fanf: fanf.c
|
|
||||||
${RM} -f fanftmp1.c fanftmp2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@
|
|
||||||
|
|
||||||
fanf_files: fanf.lambda
|
|
||||||
|
|
||||||
bas1: bas1.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
tomtorfs: tomtorfs.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
dorssel: dorssel.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh2: schweikh2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh2.orig: schweikh2.orig.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh3: schweikh3.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \
|
|
||||||
-DM3=realloc -DM4=calloc -DM5=free -o $@
|
|
||||||
|
|
||||||
schweikh3_files: samefile.1
|
|
||||||
|
|
||||||
schnitzi: schnitzi.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
chaos: chaos.c
|
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
|
|
||||||
# some libcurses do not have halfdelay(). This rule is for those systems
|
|
||||||
#
|
#
|
||||||
chaos_nohalf: chaos_nohalf.c
|
endif
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
${CP} -f $@ chaos
|
|
||||||
|
|
||||||
chaos_nohalf.c: chaos.c
|
# Specific add-ons or replacements for gcc only
|
||||||
|
#
|
||||||
|
ifeq ($(CC),gcc)
|
||||||
|
#
|
||||||
|
#CSILENCE+=
|
||||||
|
#
|
||||||
|
#CWARN+=
|
||||||
|
#
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
##############################
|
||||||
|
# Special flags for this entry
|
||||||
|
##############################
|
||||||
|
#
|
||||||
|
ENTRY= chaos
|
||||||
|
PROG= ${ENTRY}
|
||||||
|
#
|
||||||
|
OBJ= ${PROG}.o
|
||||||
|
DATA= cube.data desk.data ioccc.data pyramid.data xwing.data
|
||||||
|
TARGET= ${PROG} ${PROG}_nohalf
|
||||||
|
#
|
||||||
|
ALT_OBJ= ${PROG}_nohalf.o
|
||||||
|
ALT_TARGET= ${PROG}_nohalf
|
||||||
|
|
||||||
|
|
||||||
|
#################
|
||||||
|
# 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}
|
||||||
|
|
||||||
|
${PROG}_nohalf: ${PROG}_nohalf.c
|
||||||
|
${CC} ${CFLAGS} $< -o $@ ${LIBS}
|
||||||
|
|
||||||
|
${PROG}_nohalf.c: ${PROG}.c
|
||||||
${RM} -f $@
|
${RM} -f $@
|
||||||
${SED} -e 's/halfdelay([^)]*);//' < $? > $@
|
${SED} -e 's/halfdelay([^)]*);//' < $? > $@
|
||||||
|
|
||||||
chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data
|
# alternative executable
|
||||||
|
#
|
||||||
everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES}
|
alt: data ${ALT_TARGET}
|
||||||
|
|
||||||
clean:
|
|
||||||
${RM} -f *.o a.out core ${WINNERS}
|
|
||||||
${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c
|
|
||||||
|
|
||||||
clobber: clean
|
|
||||||
${RM} -f ${WINNERS}
|
|
||||||
${RM} -f ${ALT_NAMES}
|
|
||||||
|
|
||||||
nuke: clobber
|
|
||||||
@${TRUE}
|
@${TRUE}
|
||||||
|
|
||||||
install: all
|
# data files
|
||||||
${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null
|
#
|
||||||
|
data: ${DATA}
|
||||||
|
@${TRUE}
|
||||||
|
|
||||||
|
# both all and alt
|
||||||
|
#
|
||||||
|
everything: all alt
|
||||||
|
|
||||||
|
|
||||||
|
###############
|
||||||
|
# utility rules
|
||||||
|
###############
|
||||||
|
#
|
||||||
|
clean:
|
||||||
|
${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 ${PROG}_nohalf.c
|
||||||
|
@-if [ -e sandwich ]; then \
|
||||||
|
${RM} -f sandwich; \
|
||||||
|
echo 'ate sandwich'; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
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 '<was here>' /\\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"
|
||||||
+317
-151
@@ -1,174 +1,340 @@
|
|||||||
#!/bin/make
|
#!/usr/bin/env make
|
||||||
# 1998 makefile
|
|
||||||
#
|
#
|
||||||
# Copyright (c) Landon Curt Noll, Jeremy Horn, Peter Seebach
|
# IOCCC 1998 winning entry - df
|
||||||
# and Leonid A. Broukhis, 1999.
|
|
||||||
# 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 the contest judges.
|
|
||||||
|
|
||||||
SHELL=/bin/sh
|
################################################################################
|
||||||
CAT=cat
|
#
|
||||||
CHMOD=chmod
|
# An Historical Makefile NOTE:
|
||||||
CP=cp
|
#
|
||||||
MV=mv
|
# The orig.Makefile, if it exits, is the original Makefile before this IOCCC
|
||||||
LN=ln
|
# year directory was reworked so that entries are in separate directories.
|
||||||
RM=rm
|
# This also applies to any orig.ansi.mk and orig.common.mk files.
|
||||||
SED=sed
|
#
|
||||||
TRUE=true
|
# 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
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
# flags for ANSI compiles
|
# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
|
||||||
#
|
#
|
||||||
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode,
|
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||||
# 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
|
# See: http://creativecommons.org/licenses/by-sa/3.0/
|
||||||
# incorrectly. You might want to turn on -O to see if your
|
|
||||||
# compiler can handle them.
|
|
||||||
#
|
|
||||||
# NOTE: On some systems, the library path does not include the location
|
|
||||||
# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir
|
|
||||||
# in order to compile with these libs.
|
|
||||||
#
|
|
||||||
#CFLAGS=-O -Xa
|
|
||||||
#CFLAGS=-Xa
|
|
||||||
CFLAGS= -ansi
|
|
||||||
#CFLAGS= -ansi -O
|
|
||||||
#CFLAGS=
|
|
||||||
#CFLAGS= -ansi -L/usr/X11R6/lib
|
|
||||||
|
|
||||||
# ANSI compiler
|
|
||||||
|
#############################
|
||||||
|
# shell used by this Makefile
|
||||||
|
#############################
|
||||||
#
|
#
|
||||||
# Set CC to the name of your ANSI compiler.
|
SHELL= bash
|
||||||
|
|
||||||
|
#######################
|
||||||
|
# common tool locations
|
||||||
|
#######################
|
||||||
#
|
#
|
||||||
# Some entries seem to need gcc. If you have gcc, set
|
include ../../var.mk
|
||||||
# both CC and MAY_NEED_GCC to gcc.
|
|
||||||
|
# Set X11_LIBDIR to the directory where the X11 library resides
|
||||||
#
|
#
|
||||||
# If you do not have gcc, set CC to the name of your ANSI compiler, and
|
#X11_LIBDIR= /usr/X11R6/lib
|
||||||
# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just :
|
#X11_LIBDIR= /usr/X11/lib
|
||||||
# to disable such programs.
|
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-bitwise-op-parentheses -Wno-char-subscripts -Wno-pointer-to-int-cast \
|
||||||
|
-Wno-return-type -Wno-unused-parameter -Wno-unused-variable -Wno-typedef-redefinition
|
||||||
|
|
||||||
|
# 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= cc
|
||||||
MAY_NEED_GCC= gcc
|
#CC=clang
|
||||||
|
#CC=gcc
|
||||||
|
|
||||||
# winners that compile under ANSI C
|
# Compiler add-ons or replacements for clang only
|
||||||
#
|
#
|
||||||
WINNERS= schweikh1 df dloweneil banks dlowe bas2 fanf bas1 tomtorfs dorssel \
|
ifeq ($(CC),clang)
|
||||||
schweikh2 schnitzi chaos schweikh3
|
|
||||||
ALT_NAMES= schweikh2.orig banks.orig dlowe.orig df.orig schweikh1.orig \
|
|
||||||
chaos_nohalf
|
|
||||||
DATA_FILES= banks_files chaos_files fanf_files schweikh1_files schweikh3_files
|
|
||||||
|
|
||||||
|
|
||||||
all: ${WINNERS}
|
|
||||||
|
|
||||||
schweikh1: schweikh1.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh1.orig: schweikh1.orig.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh1_files: info
|
|
||||||
|
|
||||||
df: df.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
df.orig: prog.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
prog.c : df.c
|
|
||||||
${RM} -f prog.c
|
|
||||||
${CP} $? prog.c
|
|
||||||
|
|
||||||
dloweneil: dloweneil.c
|
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
|
|
||||||
# See note about use of -L/path/to/X11/lib/dir above this rule fails to link
|
|
||||||
#
|
#
|
||||||
banks: banks.c
|
CSILENCE+= -Wno-array-bounds-pointer-arithmetic -Wno-implicit-int-conversion \
|
||||||
${CC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
-Wno-keyword-macro -Wno-missing-prototypes \
|
||||||
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
-Wno-missing-variable-declarations -Wno-pedantic \
|
||||||
-DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@
|
-Wno-poison-system-directories -Wno-shadow -Wno-sign-conversion \
|
||||||
|
-Wno-strict-prototypes
|
||||||
# See note about use of -L/path/to/X11/lib/dir above this rule fails to link
|
|
||||||
#
|
#
|
||||||
banks.orig: banks.orig.c
|
CWARN+= -Weverything
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
|
||||||
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
|
||||||
-DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@
|
|
||||||
|
|
||||||
banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc
|
|
||||||
|
|
||||||
dlowe: dlowe.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
dlowe.orig: dlowe.orig.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
bas2: bas2.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
fanf: fanf.c
|
|
||||||
${RM} -f fanftmp1.c fanftmp2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@
|
|
||||||
|
|
||||||
fanf_files: fanf.lambda
|
|
||||||
|
|
||||||
bas1: bas1.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
tomtorfs: tomtorfs.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
dorssel: dorssel.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh2: schweikh2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh2.orig: schweikh2.orig.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh3: schweikh3.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \
|
|
||||||
-DM3=realloc -DM4=calloc -DM5=free -o $@
|
|
||||||
|
|
||||||
schweikh3_files: samefile.1
|
|
||||||
|
|
||||||
schnitzi: schnitzi.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
chaos: chaos.c
|
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
|
|
||||||
# some libcurses do not have halfdelay(). This rule is for those systems
|
|
||||||
#
|
#
|
||||||
chaos_nohalf: chaos_nohalf.c
|
endif
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
${CP} -f $@ chaos
|
|
||||||
|
|
||||||
chaos_nohalf.c: chaos.c
|
# Specific add-ons or replacements for gcc only
|
||||||
${RM} -f $@
|
#
|
||||||
${SED} -e 's/halfdelay([^)]*);//' < $? > $@
|
ifeq ($(CC),gcc)
|
||||||
|
#
|
||||||
|
#CSILENCE+=
|
||||||
|
#
|
||||||
|
#CWARN+=
|
||||||
|
#
|
||||||
|
endif
|
||||||
|
|
||||||
chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data
|
|
||||||
|
|
||||||
everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES}
|
##############################
|
||||||
|
# Special flags for this entry
|
||||||
|
##############################
|
||||||
|
#
|
||||||
|
ENTRY= df
|
||||||
|
PROG= ${ENTRY}
|
||||||
|
#
|
||||||
|
OBJ= ${PROG}.o
|
||||||
|
DATA=
|
||||||
|
TARGET= ${PROG}
|
||||||
|
#
|
||||||
|
ALT_OBJ=
|
||||||
|
ALT_TARGET=
|
||||||
|
|
||||||
clean:
|
|
||||||
${RM} -f *.o a.out core ${WINNERS}
|
|
||||||
${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c
|
|
||||||
|
|
||||||
clobber: clean
|
#################
|
||||||
${RM} -f ${WINNERS}
|
# build the entry
|
||||||
${RM} -f ${ALT_NAMES}
|
#################
|
||||||
|
#
|
||||||
nuke: clobber
|
all: data ${TARGET}
|
||||||
@${TRUE}
|
@${TRUE}
|
||||||
|
|
||||||
install: all
|
.PHONY: all alt data everything clean clobber install \
|
||||||
${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null
|
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 ${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:
|
||||||
|
@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 '<was here>' /\\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"
|
||||||
+7
-9
@@ -1,4 +1,4 @@
|
|||||||
Best Data Hiding:
|
# Best Data Hiding:
|
||||||
|
|
||||||
Daniel Fischer
|
Daniel Fischer
|
||||||
VNetx.com GbR
|
VNetx.com GbR
|
||||||
@@ -6,17 +6,16 @@ Best Data Hiding:
|
|||||||
D 72250 Freudenstadt
|
D 72250 Freudenstadt
|
||||||
German Federal Republic
|
German Federal Republic
|
||||||
|
|
||||||
|
## To build:
|
||||||
|
|
||||||
Judge's Comments:
|
make all
|
||||||
|
|
||||||
To build:
|
### To run
|
||||||
|
|
||||||
make df
|
|
||||||
|
|
||||||
To use:
|
|
||||||
|
|
||||||
./df
|
./df
|
||||||
|
|
||||||
|
## Judges' comments
|
||||||
|
|
||||||
Everyone talks about how data hiding can produce clearer code; I am
|
Everyone talks about how data hiding can produce clearer code; I am
|
||||||
pleased to offer this charming refutation.
|
pleased to offer this charming refutation.
|
||||||
|
|
||||||
@@ -38,8 +37,7 @@ Judge's Comments:
|
|||||||
How many words does this entry use?
|
How many words does this entry use?
|
||||||
Can you add more words to the program and still make it work?
|
Can you add more words to the program and still make it work?
|
||||||
|
|
||||||
|
## Author's comments
|
||||||
Selected Author's Comments:
|
|
||||||
|
|
||||||
This program lets you guess English words. It displays an underscore
|
This program lets you guess English words. It displays an underscore
|
||||||
for each letter in the word; guessing a letter that actually is in
|
for each letter in the word; guessing a letter that actually is in
|
||||||
|
|||||||
+2
-1
@@ -1,4 +1,5 @@
|
|||||||
#ifndef int
|
#ifndef int
|
||||||
|
typedef int lint;
|
||||||
#ifdef while
|
#ifdef while
|
||||||
char s[234],d[56],*p=s,m='m';
|
char s[234],d[56],*p=s,m='m';
|
||||||
#define int typedef (*define)();\
|
#define int typedef (*define)();\
|
||||||
@@ -9,7 +10,7 @@ signed short n(short bz){
|
|||||||
char o=1,i=1,l,pc=i,b=r+o/2,_f=6,m=7,s=8,g,q,od=o*rs+4^s,js=_f/*3-m*'c',bs='g';
|
char o=1,i=1,l,pc=i,b=r+o/2,_f=6,m=7,s=8,g,q,od=o*rs+4^s,js=_f/*3-m*'c',bs='g';
|
||||||
return 1; }
|
return 1; }
|
||||||
#y FILE c[a]+s,p[c],r[m]+u[i+4*o|f]-r[wob][wad]+s*f-!w|o,L+x | cut
|
#y FILE c[a]+s,p[c],r[m]+u[i+4*o|f]-r[wob][wad]+s*f-!w|o,L+x | cut
|
||||||
;}int main(i,love_unix){*/;}int main(i,love_unix){/*;}int main(i,love_unix){*\;}| here */
|
;}int main(lint i,char**love_unix){*/;}int main(lint i,char**love_unix){/*;}int main(lint i,char**love_unix){*\;}| here */
|
||||||
while(FILE)for(;9-(i=0[O](f)););
|
while(FILE)for(;9-(i=0[O](f)););
|
||||||
for(;32-(i=0[O](f));0&& 3[O]("-->%s<--", "gxdgbtgxsxpcctvpixktedhiedcte"));
|
for(;32-(i=0[O](f));0&& 3[O]("-->%s<--", "gxdgbtgxsxpcctvpixktedhiedcte"));
|
||||||
for(;'\n'-(i=O[0](f));)(i>='a'&&i<'z')?*
|
for(;'\n'-(i=O[0](f));)(i>='a'&&i<'z')?*
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
dlowe
|
dlowe
|
||||||
|
dlowe.alt
|
||||||
+315
-151
@@ -1,174 +1,338 @@
|
|||||||
#!/bin/make
|
#!/usr/bin/env make
|
||||||
# 1998 makefile
|
|
||||||
#
|
#
|
||||||
# Copyright (c) Landon Curt Noll, Jeremy Horn, Peter Seebach
|
# IOCCC 1998 winning entry - dlowe
|
||||||
# and Leonid A. Broukhis, 1999.
|
|
||||||
# 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 the contest judges.
|
|
||||||
|
|
||||||
SHELL=/bin/sh
|
################################################################################
|
||||||
CAT=cat
|
#
|
||||||
CHMOD=chmod
|
# An Historical Makefile NOTE:
|
||||||
CP=cp
|
#
|
||||||
MV=mv
|
# The orig.Makefile, if it exits, is the original Makefile before this IOCCC
|
||||||
LN=ln
|
# year directory was reworked so that entries are in separate directories.
|
||||||
RM=rm
|
# This also applies to any orig.ansi.mk and orig.common.mk files.
|
||||||
SED=sed
|
#
|
||||||
TRUE=true
|
# 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
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
# flags for ANSI compiles
|
# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
|
||||||
#
|
#
|
||||||
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode,
|
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||||
# 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
|
# See: http://creativecommons.org/licenses/by-sa/3.0/
|
||||||
# incorrectly. You might want to turn on -O to see if your
|
|
||||||
# compiler can handle them.
|
|
||||||
#
|
|
||||||
# NOTE: On some systems, the library path does not include the location
|
|
||||||
# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir
|
|
||||||
# in order to compile with these libs.
|
|
||||||
#
|
|
||||||
#CFLAGS=-O -Xa
|
|
||||||
#CFLAGS=-Xa
|
|
||||||
CFLAGS= -ansi
|
|
||||||
#CFLAGS= -ansi -O
|
|
||||||
#CFLAGS=
|
|
||||||
#CFLAGS= -ansi -L/usr/X11R6/lib
|
|
||||||
|
|
||||||
# ANSI compiler
|
|
||||||
|
#############################
|
||||||
|
# shell used by this Makefile
|
||||||
|
#############################
|
||||||
#
|
#
|
||||||
# Set CC to the name of your ANSI compiler.
|
SHELL= bash
|
||||||
|
|
||||||
|
#######################
|
||||||
|
# common tool locations
|
||||||
|
#######################
|
||||||
#
|
#
|
||||||
# Some entries seem to need gcc. If you have gcc, set
|
include ../../var.mk
|
||||||
# both CC and MAY_NEED_GCC to gcc.
|
|
||||||
|
# Set X11_LIBDIR to the directory where the X11 library resides
|
||||||
#
|
#
|
||||||
# If you do not have gcc, set CC to the name of your ANSI compiler, and
|
#X11_LIBDIR= /usr/X11R6/lib
|
||||||
# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just :
|
#X11_LIBDIR= /usr/X11/lib
|
||||||
# to disable such programs.
|
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-main-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= -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= cc
|
||||||
MAY_NEED_GCC= gcc
|
#CC=clang
|
||||||
|
#CC=gcc
|
||||||
|
|
||||||
# winners that compile under ANSI C
|
# Compiler add-ons or replacements for clang only
|
||||||
#
|
#
|
||||||
WINNERS= schweikh1 df dloweneil banks dlowe bas2 fanf bas1 tomtorfs dorssel \
|
ifeq ($(CC),clang)
|
||||||
schweikh2 schnitzi chaos schweikh3
|
|
||||||
ALT_NAMES= schweikh2.orig banks.orig dlowe.orig df.orig schweikh1.orig \
|
|
||||||
chaos_nohalf
|
|
||||||
DATA_FILES= banks_files chaos_files fanf_files schweikh1_files schweikh3_files
|
|
||||||
|
|
||||||
|
|
||||||
all: ${WINNERS}
|
|
||||||
|
|
||||||
schweikh1: schweikh1.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh1.orig: schweikh1.orig.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh1_files: info
|
|
||||||
|
|
||||||
df: df.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
df.orig: prog.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
prog.c : df.c
|
|
||||||
${RM} -f prog.c
|
|
||||||
${CP} $? prog.c
|
|
||||||
|
|
||||||
dloweneil: dloweneil.c
|
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
|
|
||||||
# See note about use of -L/path/to/X11/lib/dir above this rule fails to link
|
|
||||||
#
|
#
|
||||||
banks: banks.c
|
CSILENCE+= -Wno-implicit-int-conversion -Wno-poison-system-directories
|
||||||
${CC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
|
||||||
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
|
||||||
-DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@
|
|
||||||
|
|
||||||
# See note about use of -L/path/to/X11/lib/dir above this rule fails to link
|
|
||||||
#
|
#
|
||||||
banks.orig: banks.orig.c
|
CWARN+= -Weverything
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
|
||||||
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
|
||||||
-DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@
|
|
||||||
|
|
||||||
banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc
|
|
||||||
|
|
||||||
dlowe: dlowe.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
dlowe.orig: dlowe.orig.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
bas2: bas2.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
fanf: fanf.c
|
|
||||||
${RM} -f fanftmp1.c fanftmp2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@
|
|
||||||
|
|
||||||
fanf_files: fanf.lambda
|
|
||||||
|
|
||||||
bas1: bas1.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
tomtorfs: tomtorfs.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
dorssel: dorssel.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh2: schweikh2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh2.orig: schweikh2.orig.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh3: schweikh3.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \
|
|
||||||
-DM3=realloc -DM4=calloc -DM5=free -o $@
|
|
||||||
|
|
||||||
schweikh3_files: samefile.1
|
|
||||||
|
|
||||||
schnitzi: schnitzi.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
chaos: chaos.c
|
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
|
|
||||||
# some libcurses do not have halfdelay(). This rule is for those systems
|
|
||||||
#
|
#
|
||||||
chaos_nohalf: chaos_nohalf.c
|
endif
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
${CP} -f $@ chaos
|
|
||||||
|
|
||||||
chaos_nohalf.c: chaos.c
|
# Specific add-ons or replacements for gcc only
|
||||||
${RM} -f $@
|
#
|
||||||
${SED} -e 's/halfdelay([^)]*);//' < $? > $@
|
ifeq ($(CC),gcc)
|
||||||
|
#
|
||||||
|
#CSILENCE+=
|
||||||
|
#
|
||||||
|
#CWARN+=
|
||||||
|
#
|
||||||
|
endif
|
||||||
|
|
||||||
chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data
|
|
||||||
|
|
||||||
everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES}
|
##############################
|
||||||
|
# Special flags for this entry
|
||||||
|
##############################
|
||||||
|
#
|
||||||
|
ENTRY= dlowe
|
||||||
|
PROG= ${ENTRY}
|
||||||
|
#
|
||||||
|
OBJ= ${PROG}.o
|
||||||
|
DATA=
|
||||||
|
TARGET= ${PROG} ${PROG}.alt
|
||||||
|
#
|
||||||
|
ALT_OBJ= ${PROG}.alt.o
|
||||||
|
ALT_TARGET= ${PROG}.alt
|
||||||
|
|
||||||
clean:
|
|
||||||
${RM} -f *.o a.out core ${WINNERS}
|
|
||||||
${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c
|
|
||||||
|
|
||||||
clobber: clean
|
#################
|
||||||
${RM} -f ${WINNERS}
|
# build the entry
|
||||||
${RM} -f ${ALT_NAMES}
|
#################
|
||||||
|
#
|
||||||
nuke: clobber
|
all: data ${TARGET}
|
||||||
@${TRUE}
|
@${TRUE}
|
||||||
|
|
||||||
install: all
|
.PHONY: all alt data everything clean clobber install \
|
||||||
${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null
|
love haste waste maker easter_egg sandwich \
|
||||||
|
supernova deep_magic magic charon pluto
|
||||||
|
|
||||||
|
${PROG}: ${PROG}.c
|
||||||
|
${CC} ${CFLAGS} $< -o $@ ${LIBS}
|
||||||
|
|
||||||
|
${PROG}.alt: ${PROG}.alt.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 ${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:
|
||||||
|
@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 '<was here>' /\\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"
|
||||||
+9
-11
@@ -1,4 +1,4 @@
|
|||||||
Best Utility:
|
# Best Utility:
|
||||||
|
|
||||||
David Lowe
|
David Lowe
|
||||||
Pootpoot
|
Pootpoot
|
||||||
@@ -8,17 +8,16 @@ Best Utility:
|
|||||||
|
|
||||||
http://pootpoot.com/
|
http://pootpoot.com/
|
||||||
|
|
||||||
|
## To build:
|
||||||
|
|
||||||
Judges' Comments:
|
make all
|
||||||
|
|
||||||
To build:
|
### To run
|
||||||
|
|
||||||
make dlowe
|
|
||||||
|
|
||||||
To use:
|
|
||||||
|
|
||||||
./dlowe < anyfile > pootfile
|
./dlowe < anyfile > pootfile
|
||||||
|
|
||||||
|
## Judges' comments
|
||||||
|
|
||||||
Why is this entry would be considered a utility? Well because it
|
Why is this entry would be considered a utility? Well because it
|
||||||
is able to convert content-free web pages into useful web pages.
|
is able to convert content-free web pages into useful web pages.
|
||||||
|
|
||||||
@@ -63,11 +62,10 @@ Judges' Comments:
|
|||||||
NOTE: The original entry was just a text based pootifier. To build
|
NOTE: The original entry was just a text based pootifier. To build
|
||||||
that version try:
|
that version try:
|
||||||
|
|
||||||
make dlowe.orig
|
make dlowe.alt
|
||||||
./dlowe.orig < anyfile > pootfile
|
./dlowe.alt < anyfile > pootfile
|
||||||
|
|
||||||
|
## Author's comments
|
||||||
Selected Author's Comments:
|
|
||||||
|
|
||||||
This program is a text filter, it reads stdin and outputs the
|
This program is a text filter, it reads stdin and outputs the
|
||||||
"corrected" text to stdout.
|
"corrected" text to stdout.
|
||||||
|
|||||||
File renamed without changes.
@@ -1 +1,2 @@
|
|||||||
dloweneil
|
dloweneil
|
||||||
|
pootris
|
||||||
+316
-151
@@ -1,174 +1,339 @@
|
|||||||
#!/bin/make
|
#!/usr/bin/env make
|
||||||
# 1998 makefile
|
|
||||||
#
|
#
|
||||||
# Copyright (c) Landon Curt Noll, Jeremy Horn, Peter Seebach
|
# IOCCC 1998 winning entry - dloweneil
|
||||||
# and Leonid A. Broukhis, 1999.
|
|
||||||
# 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 the contest judges.
|
|
||||||
|
|
||||||
SHELL=/bin/sh
|
################################################################################
|
||||||
CAT=cat
|
#
|
||||||
CHMOD=chmod
|
# An Historical Makefile NOTE:
|
||||||
CP=cp
|
#
|
||||||
MV=mv
|
# The orig.Makefile, if it exits, is the original Makefile before this IOCCC
|
||||||
LN=ln
|
# year directory was reworked so that entries are in separate directories.
|
||||||
RM=rm
|
# This also applies to any orig.ansi.mk and orig.common.mk files.
|
||||||
SED=sed
|
#
|
||||||
TRUE=true
|
# 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
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
# flags for ANSI compiles
|
# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
|
||||||
#
|
#
|
||||||
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode,
|
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||||
# 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
|
# See: http://creativecommons.org/licenses/by-sa/3.0/
|
||||||
# incorrectly. You might want to turn on -O to see if your
|
|
||||||
# compiler can handle them.
|
|
||||||
#
|
|
||||||
# NOTE: On some systems, the library path does not include the location
|
|
||||||
# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir
|
|
||||||
# in order to compile with these libs.
|
|
||||||
#
|
|
||||||
#CFLAGS=-O -Xa
|
|
||||||
#CFLAGS=-Xa
|
|
||||||
CFLAGS= -ansi
|
|
||||||
#CFLAGS= -ansi -O
|
|
||||||
#CFLAGS=
|
|
||||||
#CFLAGS= -ansi -L/usr/X11R6/lib
|
|
||||||
|
|
||||||
# ANSI compiler
|
|
||||||
|
#############################
|
||||||
|
# shell used by this Makefile
|
||||||
|
#############################
|
||||||
#
|
#
|
||||||
# Set CC to the name of your ANSI compiler.
|
SHELL= bash
|
||||||
|
|
||||||
|
#######################
|
||||||
|
# common tool locations
|
||||||
|
#######################
|
||||||
#
|
#
|
||||||
# Some entries seem to need gcc. If you have gcc, set
|
include ../../var.mk
|
||||||
# both CC and MAY_NEED_GCC to gcc.
|
|
||||||
|
# Set X11_LIBDIR to the directory where the X11 library resides
|
||||||
#
|
#
|
||||||
# If you do not have gcc, set CC to the name of your ANSI compiler, and
|
#X11_LIBDIR= /usr/X11R6/lib
|
||||||
# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just :
|
#X11_LIBDIR= /usr/X11/lib
|
||||||
# to disable such programs.
|
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-dangling-else
|
||||||
|
|
||||||
|
# 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= -lcurses
|
||||||
|
#LIBS= -L ${X11_LIBDIR} -lX11
|
||||||
|
#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL
|
||||||
|
|
||||||
|
# C compiler to use
|
||||||
#
|
#
|
||||||
CC= cc
|
CC= cc
|
||||||
MAY_NEED_GCC= gcc
|
#CC=clang
|
||||||
|
#CC=gcc
|
||||||
|
|
||||||
# winners that compile under ANSI C
|
# Compiler add-ons or replacements for clang only
|
||||||
#
|
#
|
||||||
WINNERS= schweikh1 df dloweneil banks dlowe bas2 fanf bas1 tomtorfs dorssel \
|
ifeq ($(CC),clang)
|
||||||
schweikh2 schnitzi chaos schweikh3
|
|
||||||
ALT_NAMES= schweikh2.orig banks.orig dlowe.orig df.orig schweikh1.orig \
|
|
||||||
chaos_nohalf
|
|
||||||
DATA_FILES= banks_files chaos_files fanf_files schweikh1_files schweikh3_files
|
|
||||||
|
|
||||||
|
|
||||||
all: ${WINNERS}
|
|
||||||
|
|
||||||
schweikh1: schweikh1.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh1.orig: schweikh1.orig.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh1_files: info
|
|
||||||
|
|
||||||
df: df.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
df.orig: prog.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
prog.c : df.c
|
|
||||||
${RM} -f prog.c
|
|
||||||
${CP} $? prog.c
|
|
||||||
|
|
||||||
dloweneil: dloweneil.c
|
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
|
|
||||||
# See note about use of -L/path/to/X11/lib/dir above this rule fails to link
|
|
||||||
#
|
#
|
||||||
banks: banks.c
|
CSILENCE+= -Wno-comma -Wno-poison-system-directories
|
||||||
${CC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
|
||||||
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
|
||||||
-DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@
|
|
||||||
|
|
||||||
# See note about use of -L/path/to/X11/lib/dir above this rule fails to link
|
|
||||||
#
|
#
|
||||||
banks.orig: banks.orig.c
|
CWARN+= -Weverything
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
|
||||||
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
|
||||||
-DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@
|
|
||||||
|
|
||||||
banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc
|
|
||||||
|
|
||||||
dlowe: dlowe.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
dlowe.orig: dlowe.orig.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
bas2: bas2.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
fanf: fanf.c
|
|
||||||
${RM} -f fanftmp1.c fanftmp2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@
|
|
||||||
|
|
||||||
fanf_files: fanf.lambda
|
|
||||||
|
|
||||||
bas1: bas1.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
tomtorfs: tomtorfs.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
dorssel: dorssel.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh2: schweikh2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh2.orig: schweikh2.orig.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh3: schweikh3.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \
|
|
||||||
-DM3=realloc -DM4=calloc -DM5=free -o $@
|
|
||||||
|
|
||||||
schweikh3_files: samefile.1
|
|
||||||
|
|
||||||
schnitzi: schnitzi.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
chaos: chaos.c
|
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
|
|
||||||
# some libcurses do not have halfdelay(). This rule is for those systems
|
|
||||||
#
|
#
|
||||||
chaos_nohalf: chaos_nohalf.c
|
endif
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
${CP} -f $@ chaos
|
|
||||||
|
|
||||||
chaos_nohalf.c: chaos.c
|
# Specific add-ons or replacements for gcc only
|
||||||
${RM} -f $@
|
#
|
||||||
${SED} -e 's/halfdelay([^)]*);//' < $? > $@
|
ifeq ($(CC),gcc)
|
||||||
|
#
|
||||||
|
#CSILENCE+=
|
||||||
|
#
|
||||||
|
#CWARN+=
|
||||||
|
#
|
||||||
|
endif
|
||||||
|
|
||||||
chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data
|
|
||||||
|
|
||||||
everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES}
|
##############################
|
||||||
|
# Special flags for this entry
|
||||||
|
##############################
|
||||||
|
#
|
||||||
|
ENTRY= dloweneil
|
||||||
|
PROG= ${ENTRY}
|
||||||
|
#
|
||||||
|
OBJ= ${PROG}.o
|
||||||
|
DATA=
|
||||||
|
TARGET= ${PROG} pootris
|
||||||
|
#
|
||||||
|
ALT_OBJ=
|
||||||
|
ALT_TARGET=
|
||||||
|
|
||||||
clean:
|
|
||||||
${RM} -f *.o a.out core ${WINNERS}
|
|
||||||
${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c
|
|
||||||
|
|
||||||
clobber: clean
|
#################
|
||||||
${RM} -f ${WINNERS}
|
# build the entry
|
||||||
${RM} -f ${ALT_NAMES}
|
#################
|
||||||
|
#
|
||||||
nuke: clobber
|
all: data ${TARGET}
|
||||||
@${TRUE}
|
@${TRUE}
|
||||||
|
|
||||||
install: all
|
.PHONY: all alt data everything clean clobber install \
|
||||||
${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null
|
love haste waste maker easter_egg sandwich \
|
||||||
|
supernova deep_magic magic charon pluto
|
||||||
|
|
||||||
|
${PROG}: ${PROG}.c
|
||||||
|
${CC} ${CFLAGS} $< -o $@ ${LIBS}
|
||||||
|
|
||||||
|
pootris: ${PROG}
|
||||||
|
${RM} -f $@
|
||||||
|
${CP} $< $@
|
||||||
|
|
||||||
|
# alternative executable
|
||||||
|
#
|
||||||
|
alt: data ${ALT_TARGET}
|
||||||
|
@${TRUE}
|
||||||
|
|
||||||
|
# data files
|
||||||
|
#
|
||||||
|
data: ${DATA}
|
||||||
|
@${TRUE}
|
||||||
|
|
||||||
|
# both all and alt
|
||||||
|
#
|
||||||
|
everything: all alt
|
||||||
|
|
||||||
|
|
||||||
|
###############
|
||||||
|
# utility rules
|
||||||
|
###############
|
||||||
|
#
|
||||||
|
clean:
|
||||||
|
${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:
|
||||||
|
@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 '<was here>' /\\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"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
Most Fun:
|
# Most Fun:
|
||||||
|
|
||||||
David Lowe Neil Mix
|
David Lowe Neil Mix
|
||||||
Pootpoot Pootpoot
|
Pootpoot Pootpoot
|
||||||
@@ -8,16 +8,15 @@ Most Fun:
|
|||||||
|
|
||||||
http://pootpoot.com/
|
http://pootpoot.com/
|
||||||
|
|
||||||
|
## To build:
|
||||||
|
|
||||||
Judge's Comments:
|
make all
|
||||||
|
|
||||||
To build:
|
### To run
|
||||||
|
|
||||||
make dloweneil
|
./pootris
|
||||||
|
|
||||||
To use:
|
## Judges' comments
|
||||||
|
|
||||||
./dloweneil
|
|
||||||
|
|
||||||
Read the Author's comments below. We believe that your experience may
|
Read the Author's comments below. We believe that your experience may
|
||||||
mirror one of our experiences:
|
mirror one of our experiences:
|
||||||
@@ -26,11 +25,11 @@ Judge's Comments:
|
|||||||
description of the controls. I started playing. I struggled.
|
description of the controls. I started playing. I struggled.
|
||||||
I spelled my first "poot". I was hooked ...
|
I spelled my first "poot". I was hooked ...
|
||||||
|
|
||||||
|
## Author's comments
|
||||||
Selected Author's comments:
|
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
pootris [X size of board] [Y size of board]
|
|
||||||
|
./pootris [X size of board] [Y size of board]
|
||||||
|
|
||||||
Synopsis:
|
Synopsis:
|
||||||
The object of this game is to spell "POOT" as much as possible. There
|
The object of this game is to spell "POOT" as much as possible. There
|
||||||
|
|||||||
+315
-151
@@ -1,174 +1,338 @@
|
|||||||
#!/bin/make
|
#!/usr/bin/env make
|
||||||
# 1998 makefile
|
|
||||||
#
|
#
|
||||||
# Copyright (c) Landon Curt Noll, Jeremy Horn, Peter Seebach
|
# IOCCC 1998 winning entry - dorssel
|
||||||
# and Leonid A. Broukhis, 1999.
|
|
||||||
# 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 the contest judges.
|
|
||||||
|
|
||||||
SHELL=/bin/sh
|
################################################################################
|
||||||
CAT=cat
|
#
|
||||||
CHMOD=chmod
|
# An Historical Makefile NOTE:
|
||||||
CP=cp
|
#
|
||||||
MV=mv
|
# The orig.Makefile, if it exits, is the original Makefile before this IOCCC
|
||||||
LN=ln
|
# year directory was reworked so that entries are in separate directories.
|
||||||
RM=rm
|
# This also applies to any orig.ansi.mk and orig.common.mk files.
|
||||||
SED=sed
|
#
|
||||||
TRUE=true
|
# 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
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
# flags for ANSI compiles
|
# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
|
||||||
#
|
#
|
||||||
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode,
|
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||||
# 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
|
# See: http://creativecommons.org/licenses/by-sa/3.0/
|
||||||
# incorrectly. You might want to turn on -O to see if your
|
|
||||||
# compiler can handle them.
|
|
||||||
#
|
|
||||||
# NOTE: On some systems, the library path does not include the location
|
|
||||||
# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir
|
|
||||||
# in order to compile with these libs.
|
|
||||||
#
|
|
||||||
#CFLAGS=-O -Xa
|
|
||||||
#CFLAGS=-Xa
|
|
||||||
CFLAGS= -ansi
|
|
||||||
#CFLAGS= -ansi -O
|
|
||||||
#CFLAGS=
|
|
||||||
#CFLAGS= -ansi -L/usr/X11R6/lib
|
|
||||||
|
|
||||||
# ANSI compiler
|
|
||||||
|
#############################
|
||||||
|
# shell used by this Makefile
|
||||||
|
#############################
|
||||||
#
|
#
|
||||||
# Set CC to the name of your ANSI compiler.
|
SHELL= bash
|
||||||
|
|
||||||
|
#######################
|
||||||
|
# common tool locations
|
||||||
|
#######################
|
||||||
#
|
#
|
||||||
# Some entries seem to need gcc. If you have gcc, set
|
include ../../var.mk
|
||||||
# both CC and MAY_NEED_GCC to gcc.
|
|
||||||
|
# Set X11_LIBDIR to the directory where the X11 library resides
|
||||||
#
|
#
|
||||||
# If you do not have gcc, set CC to the name of your ANSI compiler, and
|
#X11_LIBDIR= /usr/X11R6/lib
|
||||||
# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just :
|
#X11_LIBDIR= /usr/X11/lib
|
||||||
# to disable such programs.
|
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
|
||||||
|
|
||||||
|
# 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= cc
|
||||||
MAY_NEED_GCC= gcc
|
#CC=clang
|
||||||
|
#CC=gcc
|
||||||
|
|
||||||
# winners that compile under ANSI C
|
# Compiler add-ons or replacements for clang only
|
||||||
#
|
#
|
||||||
WINNERS= schweikh1 df dloweneil banks dlowe bas2 fanf bas1 tomtorfs dorssel \
|
ifeq ($(CC),clang)
|
||||||
schweikh2 schnitzi chaos schweikh3
|
|
||||||
ALT_NAMES= schweikh2.orig banks.orig dlowe.orig df.orig schweikh1.orig \
|
|
||||||
chaos_nohalf
|
|
||||||
DATA_FILES= banks_files chaos_files fanf_files schweikh1_files schweikh3_files
|
|
||||||
|
|
||||||
|
|
||||||
all: ${WINNERS}
|
|
||||||
|
|
||||||
schweikh1: schweikh1.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh1.orig: schweikh1.orig.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh1_files: info
|
|
||||||
|
|
||||||
df: df.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
df.orig: prog.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
prog.c : df.c
|
|
||||||
${RM} -f prog.c
|
|
||||||
${CP} $? prog.c
|
|
||||||
|
|
||||||
dloweneil: dloweneil.c
|
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
|
|
||||||
# See note about use of -L/path/to/X11/lib/dir above this rule fails to link
|
|
||||||
#
|
#
|
||||||
banks: banks.c
|
CSILENCE+= -Wno-array-bounds-pointer-arithmetic -Wno-comma \
|
||||||
${CC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
-Wno-implicit-int-conversion -Wno-poison-system-directories -Wno-shadow \
|
||||||
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
-Wno-shorten-64-to-32
|
||||||
-DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@
|
|
||||||
|
|
||||||
# See note about use of -L/path/to/X11/lib/dir above this rule fails to link
|
|
||||||
#
|
#
|
||||||
banks.orig: banks.orig.c
|
CWARN+= -Weverything
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
|
||||||
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
|
||||||
-DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@
|
|
||||||
|
|
||||||
banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc
|
|
||||||
|
|
||||||
dlowe: dlowe.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
dlowe.orig: dlowe.orig.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
bas2: bas2.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
fanf: fanf.c
|
|
||||||
${RM} -f fanftmp1.c fanftmp2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@
|
|
||||||
|
|
||||||
fanf_files: fanf.lambda
|
|
||||||
|
|
||||||
bas1: bas1.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
tomtorfs: tomtorfs.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
dorssel: dorssel.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh2: schweikh2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh2.orig: schweikh2.orig.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh3: schweikh3.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \
|
|
||||||
-DM3=realloc -DM4=calloc -DM5=free -o $@
|
|
||||||
|
|
||||||
schweikh3_files: samefile.1
|
|
||||||
|
|
||||||
schnitzi: schnitzi.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
chaos: chaos.c
|
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
|
|
||||||
# some libcurses do not have halfdelay(). This rule is for those systems
|
|
||||||
#
|
#
|
||||||
chaos_nohalf: chaos_nohalf.c
|
endif
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
${CP} -f $@ chaos
|
|
||||||
|
|
||||||
chaos_nohalf.c: chaos.c
|
# Specific add-ons or replacements for gcc only
|
||||||
${RM} -f $@
|
#
|
||||||
${SED} -e 's/halfdelay([^)]*);//' < $? > $@
|
ifeq ($(CC),gcc)
|
||||||
|
#
|
||||||
|
#CSILENCE+=
|
||||||
|
#
|
||||||
|
#CWARN+=
|
||||||
|
#
|
||||||
|
endif
|
||||||
|
|
||||||
chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data
|
|
||||||
|
|
||||||
everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES}
|
##############################
|
||||||
|
# Special flags for this entry
|
||||||
|
##############################
|
||||||
|
#
|
||||||
|
ENTRY= dorssel
|
||||||
|
PROG= ${ENTRY}
|
||||||
|
#
|
||||||
|
OBJ= ${PROG}.o
|
||||||
|
DATA= dorssel.hint2
|
||||||
|
TARGET= ${PROG}
|
||||||
|
#
|
||||||
|
ALT_OBJ=
|
||||||
|
ALT_TARGET=
|
||||||
|
|
||||||
clean:
|
|
||||||
${RM} -f *.o a.out core ${WINNERS}
|
|
||||||
${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c
|
|
||||||
|
|
||||||
clobber: clean
|
#################
|
||||||
${RM} -f ${WINNERS}
|
# build the entry
|
||||||
${RM} -f ${ALT_NAMES}
|
#################
|
||||||
|
#
|
||||||
nuke: clobber
|
all: data ${TARGET}
|
||||||
@${TRUE}
|
@${TRUE}
|
||||||
|
|
||||||
install: all
|
.PHONY: all alt data everything clean clobber install \
|
||||||
${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null
|
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 ${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:
|
||||||
|
@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 '<was here>' /\\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"
|
||||||
+8
-10
@@ -1,4 +1,4 @@
|
|||||||
Obsolescent Feature:
|
# Obsolescent Feature:
|
||||||
|
|
||||||
Frans van Dorsselaer
|
Frans van Dorsselaer
|
||||||
Bakker Industrial Automation
|
Bakker Industrial Automation
|
||||||
@@ -6,17 +6,16 @@ Obsolescent Feature:
|
|||||||
NL-2311 GP Leiden
|
NL-2311 GP Leiden
|
||||||
The Netherlands
|
The Netherlands
|
||||||
|
|
||||||
|
## To build:
|
||||||
|
|
||||||
Judges' comments:
|
make all
|
||||||
|
|
||||||
To build:
|
### To run
|
||||||
|
|
||||||
make dorssel
|
|
||||||
|
|
||||||
To use:
|
|
||||||
|
|
||||||
echo Simple as 123 | ./dorssel
|
echo Simple as 123 | ./dorssel
|
||||||
echo '.... --- .-- -.. --- . ... .. - -.. --- - .... .- -'|./dorssel
|
echo '.... --- .-- -.. --- . ... .. - -.. --- - .... .- -' | ./dorssel
|
||||||
|
|
||||||
|
## Judges' comments
|
||||||
|
|
||||||
How does the program decide which way to convert?
|
How does the program decide which way to convert?
|
||||||
|
|
||||||
@@ -37,8 +36,7 @@ Judges' comments:
|
|||||||
|
|
||||||
You might also want to read the dorssel.hint2 file.
|
You might also want to read the dorssel.hint2 file.
|
||||||
|
|
||||||
|
## Author's comments
|
||||||
Selected author's notes:
|
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
=====
|
=====
|
||||||
|
|||||||
@@ -1 +1,3 @@
|
|||||||
fanf
|
fanf
|
||||||
|
fanftmp1.c
|
||||||
|
fanftmp2.c
|
||||||
+320
-151
@@ -1,174 +1,343 @@
|
|||||||
#!/bin/make
|
#!/usr/bin/env make
|
||||||
# 1998 makefile
|
|
||||||
#
|
#
|
||||||
# Copyright (c) Landon Curt Noll, Jeremy Horn, Peter Seebach
|
# IOCCC 1998 winning entry - fanf
|
||||||
# and Leonid A. Broukhis, 1999.
|
|
||||||
# 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 the contest judges.
|
|
||||||
|
|
||||||
SHELL=/bin/sh
|
################################################################################
|
||||||
CAT=cat
|
#
|
||||||
CHMOD=chmod
|
# An Historical Makefile NOTE:
|
||||||
CP=cp
|
#
|
||||||
MV=mv
|
# The orig.Makefile, if it exits, is the original Makefile before this IOCCC
|
||||||
LN=ln
|
# year directory was reworked so that entries are in separate directories.
|
||||||
RM=rm
|
# This also applies to any orig.ansi.mk and orig.common.mk files.
|
||||||
SED=sed
|
#
|
||||||
TRUE=true
|
# 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
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
# flags for ANSI compiles
|
# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
|
||||||
#
|
#
|
||||||
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode,
|
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||||
# 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
|
# See: http://creativecommons.org/licenses/by-sa/3.0/
|
||||||
# incorrectly. You might want to turn on -O to see if your
|
|
||||||
# compiler can handle them.
|
|
||||||
#
|
|
||||||
# NOTE: On some systems, the library path does not include the location
|
|
||||||
# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir
|
|
||||||
# in order to compile with these libs.
|
|
||||||
#
|
|
||||||
#CFLAGS=-O -Xa
|
|
||||||
#CFLAGS=-Xa
|
|
||||||
CFLAGS= -ansi
|
|
||||||
#CFLAGS= -ansi -O
|
|
||||||
#CFLAGS=
|
|
||||||
#CFLAGS= -ansi -L/usr/X11R6/lib
|
|
||||||
|
|
||||||
# ANSI compiler
|
|
||||||
|
#############################
|
||||||
|
# shell used by this Makefile
|
||||||
|
#############################
|
||||||
#
|
#
|
||||||
# Set CC to the name of your ANSI compiler.
|
SHELL= bash
|
||||||
|
|
||||||
|
#######################
|
||||||
|
# common tool locations
|
||||||
|
#######################
|
||||||
#
|
#
|
||||||
# Some entries seem to need gcc. If you have gcc, set
|
include ../../var.mk
|
||||||
# both CC and MAY_NEED_GCC to gcc.
|
|
||||||
|
# Set X11_LIBDIR to the directory where the X11 library resides
|
||||||
#
|
#
|
||||||
# If you do not have gcc, set CC to the name of your ANSI compiler, and
|
#X11_LIBDIR= /usr/X11R6/lib
|
||||||
# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just :
|
#X11_LIBDIR= /usr/X11/lib
|
||||||
# to disable such programs.
|
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-pointer-bool-conversion -Wno-unused-parameter -Wno-main
|
||||||
|
|
||||||
|
# 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= cc
|
||||||
MAY_NEED_GCC= gcc
|
#CC=clang
|
||||||
|
#CC=gcc
|
||||||
|
|
||||||
# winners that compile under ANSI C
|
# Compiler add-ons or replacements for clang only
|
||||||
#
|
#
|
||||||
WINNERS= schweikh1 df dloweneil banks dlowe bas2 fanf bas1 tomtorfs dorssel \
|
ifeq ($(CC),clang)
|
||||||
schweikh2 schnitzi chaos schweikh3
|
|
||||||
ALT_NAMES= schweikh2.orig banks.orig dlowe.orig df.orig schweikh1.orig \
|
|
||||||
chaos_nohalf
|
|
||||||
DATA_FILES= banks_files chaos_files fanf_files schweikh1_files schweikh3_files
|
|
||||||
|
|
||||||
|
|
||||||
all: ${WINNERS}
|
|
||||||
|
|
||||||
schweikh1: schweikh1.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh1.orig: schweikh1.orig.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh1_files: info
|
|
||||||
|
|
||||||
df: df.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
df.orig: prog.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
prog.c : df.c
|
|
||||||
${RM} -f prog.c
|
|
||||||
${CP} $? prog.c
|
|
||||||
|
|
||||||
dloweneil: dloweneil.c
|
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
|
|
||||||
# See note about use of -L/path/to/X11/lib/dir above this rule fails to link
|
|
||||||
#
|
#
|
||||||
banks: banks.c
|
CSILENCE+= -Wno-comma -Wno-disabled-macro-expansion -Wno-missing-prototypes \
|
||||||
${CC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
-Wno-missing-variable-declarations -Wno-padded \
|
||||||
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
-Wno-poison-system-directories -Wno-unused-macros
|
||||||
-DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@
|
|
||||||
|
|
||||||
# See note about use of -L/path/to/X11/lib/dir above this rule fails to link
|
|
||||||
#
|
#
|
||||||
banks.orig: banks.orig.c
|
CWARN+= -Weverything
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
|
||||||
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
|
||||||
-DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@
|
|
||||||
|
|
||||||
banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc
|
|
||||||
|
|
||||||
dlowe: dlowe.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
dlowe.orig: dlowe.orig.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
bas2: bas2.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
fanf: fanf.c
|
|
||||||
${RM} -f fanftmp1.c fanftmp2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@
|
|
||||||
|
|
||||||
fanf_files: fanf.lambda
|
|
||||||
|
|
||||||
bas1: bas1.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
tomtorfs: tomtorfs.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
dorssel: dorssel.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh2: schweikh2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh2.orig: schweikh2.orig.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh3: schweikh3.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \
|
|
||||||
-DM3=realloc -DM4=calloc -DM5=free -o $@
|
|
||||||
|
|
||||||
schweikh3_files: samefile.1
|
|
||||||
|
|
||||||
schnitzi: schnitzi.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
chaos: chaos.c
|
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
|
|
||||||
# some libcurses do not have halfdelay(). This rule is for those systems
|
|
||||||
#
|
#
|
||||||
chaos_nohalf: chaos_nohalf.c
|
endif
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
${CP} -f $@ chaos
|
|
||||||
|
|
||||||
chaos_nohalf.c: chaos.c
|
# Specific add-ons or replacements for gcc only
|
||||||
${RM} -f $@
|
#
|
||||||
${SED} -e 's/halfdelay([^)]*);//' < $? > $@
|
ifeq ($(CC),gcc)
|
||||||
|
#
|
||||||
|
#CSILENCE+=
|
||||||
|
#
|
||||||
|
#CWARN+=
|
||||||
|
#
|
||||||
|
endif
|
||||||
|
|
||||||
chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data
|
|
||||||
|
|
||||||
everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES}
|
##############################
|
||||||
|
# Special flags for this entry
|
||||||
|
##############################
|
||||||
|
#
|
||||||
|
ENTRY= fanf
|
||||||
|
PROG= ${ENTRY}
|
||||||
|
#
|
||||||
|
OBJ= ${PROG}.o
|
||||||
|
DATA= fanf.lambda
|
||||||
|
TARGET= ${PROG}
|
||||||
|
#
|
||||||
|
ALT_OBJ=
|
||||||
|
ALT_TARGET=
|
||||||
|
|
||||||
clean:
|
|
||||||
${RM} -f *.o a.out core ${WINNERS}
|
|
||||||
${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c
|
|
||||||
|
|
||||||
clobber: clean
|
#################
|
||||||
${RM} -f ${WINNERS}
|
# build the entry
|
||||||
${RM} -f ${ALT_NAMES}
|
#################
|
||||||
|
#
|
||||||
nuke: clobber
|
all: data ${TARGET}
|
||||||
@${TRUE}
|
@${TRUE}
|
||||||
|
|
||||||
install: all
|
.PHONY: all alt data everything clean clobber install \
|
||||||
${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null
|
love haste waste maker easter_egg sandwich \
|
||||||
|
supernova deep_magic magic charon pluto
|
||||||
|
|
||||||
|
${PROG}: ${PROG}.c
|
||||||
|
${RM} -f ${PROG}tmp1.c
|
||||||
|
${CC} ${CFLAGS} -E $< > ${PROG}tmp1.c
|
||||||
|
${RM} -f ${PROG}tmp2.c
|
||||||
|
${CC} ${CFLAGS} -E ${PROG}tmp1.c > ${PROG}tmp2.c
|
||||||
|
@echo This next compile may take a whie to complete
|
||||||
|
${CC} ${CFLAGS} ${PROG}tmp2.c ${LIBS} -o $@
|
||||||
|
|
||||||
|
# alternative executable
|
||||||
|
#
|
||||||
|
alt: data ${ALT_TARGET}
|
||||||
|
@${TRUE}
|
||||||
|
|
||||||
|
# data files
|
||||||
|
#
|
||||||
|
data: ${DATA}
|
||||||
|
@${TRUE}
|
||||||
|
|
||||||
|
# both all and alt
|
||||||
|
#
|
||||||
|
everything: all alt
|
||||||
|
|
||||||
|
|
||||||
|
###############
|
||||||
|
# utility rules
|
||||||
|
###############
|
||||||
|
#
|
||||||
|
clean:
|
||||||
|
${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 ${PROG}tmp1.c ${PROG}tmp2.c
|
||||||
|
@-if [ -e sandwich ]; then \
|
||||||
|
${RM} -f sandwich; \
|
||||||
|
echo 'ate sandwich'; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
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 '<was here>' /\\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"
|
||||||
+12
-9
@@ -1,4 +1,4 @@
|
|||||||
Most Obfuscated Translator:
|
# Most Obfuscated Translator:
|
||||||
|
|
||||||
Tony Finch
|
Tony Finch
|
||||||
Demon Internet
|
Demon Internet
|
||||||
@@ -9,14 +9,18 @@ Most Obfuscated Translator:
|
|||||||
|
|
||||||
http://www.inch.demon.co.uk/
|
http://www.inch.demon.co.uk/
|
||||||
|
|
||||||
|
## To build:
|
||||||
|
|
||||||
Judges' comments:
|
make all
|
||||||
|
|
||||||
To build:
|
NOTE: This may take a while. Some systems may have problems building
|
||||||
make fanf
|
this entry because of the system resources it requires.
|
||||||
|
|
||||||
Some systems may have problems building this entry because
|
### To run
|
||||||
of the system resources can require.
|
|
||||||
|
./fanf
|
||||||
|
|
||||||
|
## Judges' comments
|
||||||
|
|
||||||
To use:
|
To use:
|
||||||
Enter an expression on standard input. Here are some
|
Enter an expression on standard input. Here are some
|
||||||
@@ -58,7 +62,7 @@ Judges' comments:
|
|||||||
|
|
||||||
Look at the first stage of the C pre-processing:
|
Look at the first stage of the C pre-processing:
|
||||||
|
|
||||||
gcc -ansi fanf.c -E > fanftmp1.c
|
cc fanf.c -E > fanftmp1.c
|
||||||
|
|
||||||
Skip to the bottom of fanftmp1.c (after all of the #include header
|
Skip to the bottom of fanftmp1.c (after all of the #include header
|
||||||
stuff ... look for a line of the form: # 2 "fanf.c" near the bottom)
|
stuff ... look for a line of the form: # 2 "fanf.c" near the bottom)
|
||||||
@@ -73,8 +77,7 @@ Judges' comments:
|
|||||||
What do you have to do to make this program work with an
|
What do you have to do to make this program work with an
|
||||||
old non-ANSI C preprocessor?
|
old non-ANSI C preprocessor?
|
||||||
|
|
||||||
|
## Author's comments
|
||||||
Selected Author's comments:
|
|
||||||
|
|
||||||
My program is a demonstration of some practical applications of
|
My program is a demonstration of some practical applications of
|
||||||
theoretical computer science. The application it implements is a program
|
theoretical computer science. The application it implements is a program
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
|
data
|
||||||
schnitzi
|
schnitzi
|
||||||
+314
-151
@@ -1,174 +1,337 @@
|
|||||||
#!/bin/make
|
#!/usr/bin/env make
|
||||||
# 1998 makefile
|
|
||||||
#
|
#
|
||||||
# Copyright (c) Landon Curt Noll, Jeremy Horn, Peter Seebach
|
# IOCCC 1998 winning entry - schnitzi
|
||||||
# and Leonid A. Broukhis, 1999.
|
|
||||||
# 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 the contest judges.
|
|
||||||
|
|
||||||
SHELL=/bin/sh
|
################################################################################
|
||||||
CAT=cat
|
#
|
||||||
CHMOD=chmod
|
# An Historical Makefile NOTE:
|
||||||
CP=cp
|
#
|
||||||
MV=mv
|
# The orig.Makefile, if it exits, is the original Makefile before this IOCCC
|
||||||
LN=ln
|
# year directory was reworked so that entries are in separate directories.
|
||||||
RM=rm
|
# This also applies to any orig.ansi.mk and orig.common.mk files.
|
||||||
SED=sed
|
#
|
||||||
TRUE=true
|
# 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
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
# flags for ANSI compiles
|
# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
|
||||||
#
|
#
|
||||||
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode,
|
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||||
# 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
|
# See: http://creativecommons.org/licenses/by-sa/3.0/
|
||||||
# incorrectly. You might want to turn on -O to see if your
|
|
||||||
# compiler can handle them.
|
|
||||||
#
|
|
||||||
# NOTE: On some systems, the library path does not include the location
|
|
||||||
# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir
|
|
||||||
# in order to compile with these libs.
|
|
||||||
#
|
|
||||||
#CFLAGS=-O -Xa
|
|
||||||
#CFLAGS=-Xa
|
|
||||||
CFLAGS= -ansi
|
|
||||||
#CFLAGS= -ansi -O
|
|
||||||
#CFLAGS=
|
|
||||||
#CFLAGS= -ansi -L/usr/X11R6/lib
|
|
||||||
|
|
||||||
# ANSI compiler
|
|
||||||
|
#############################
|
||||||
|
# shell used by this Makefile
|
||||||
|
#############################
|
||||||
#
|
#
|
||||||
# Set CC to the name of your ANSI compiler.
|
SHELL= bash
|
||||||
|
|
||||||
|
#######################
|
||||||
|
# common tool locations
|
||||||
|
#######################
|
||||||
#
|
#
|
||||||
# Some entries seem to need gcc. If you have gcc, set
|
|
||||||
# both CC and MAY_NEED_GCC to gcc.
|
# Set X11_LIBDIR to the directory where the X11 library resides
|
||||||
#
|
#
|
||||||
# If you do not have gcc, set CC to the name of your ANSI compiler, and
|
#X11_LIBDIR= /usr/X11R6/lib
|
||||||
# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just :
|
#X11_LIBDIR= /usr/X11/lib
|
||||||
# to disable such programs.
|
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-format-security \
|
||||||
|
-Wno-int-to-pointer-cast -Wno-int-conversion -Wno-unused-parameter
|
||||||
|
|
||||||
|
# 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= cc
|
||||||
MAY_NEED_GCC= gcc
|
#CC=clang
|
||||||
|
#CC=gcc
|
||||||
|
|
||||||
# winners that compile under ANSI C
|
# Compiler add-ons or replacements for clang only
|
||||||
#
|
#
|
||||||
WINNERS= schweikh1 df dloweneil banks dlowe bas2 fanf bas1 tomtorfs dorssel \
|
ifeq ($(CC),clang)
|
||||||
schweikh2 schnitzi chaos schweikh3
|
|
||||||
ALT_NAMES= schweikh2.orig banks.orig dlowe.orig df.orig schweikh1.orig \
|
|
||||||
chaos_nohalf
|
|
||||||
DATA_FILES= banks_files chaos_files fanf_files schweikh1_files schweikh3_files
|
|
||||||
|
|
||||||
|
|
||||||
all: ${WINNERS}
|
|
||||||
|
|
||||||
schweikh1: schweikh1.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh1.orig: schweikh1.orig.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh1_files: info
|
|
||||||
|
|
||||||
df: df.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
df.orig: prog.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
prog.c : df.c
|
|
||||||
${RM} -f prog.c
|
|
||||||
${CP} $? prog.c
|
|
||||||
|
|
||||||
dloweneil: dloweneil.c
|
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
|
|
||||||
# See note about use of -L/path/to/X11/lib/dir above this rule fails to link
|
|
||||||
#
|
#
|
||||||
banks: banks.c
|
CSILENCE+= -Wno-implicit-int-conversion -Wno-missing-prototypes \
|
||||||
${CC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
-Wno-missing-variable-declarations -Wno-pedantic \
|
||||||
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
-Wno-poison-system-directories -Wno-shorten-64-to-32 -Wno-strict-prototypes
|
||||||
-DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@
|
|
||||||
|
|
||||||
# See note about use of -L/path/to/X11/lib/dir above this rule fails to link
|
|
||||||
#
|
#
|
||||||
banks.orig: banks.orig.c
|
CWARN+= -Weverything
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
|
||||||
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
|
||||||
-DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@
|
|
||||||
|
|
||||||
banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc
|
|
||||||
|
|
||||||
dlowe: dlowe.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
dlowe.orig: dlowe.orig.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
bas2: bas2.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
fanf: fanf.c
|
|
||||||
${RM} -f fanftmp1.c fanftmp2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@
|
|
||||||
|
|
||||||
fanf_files: fanf.lambda
|
|
||||||
|
|
||||||
bas1: bas1.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
tomtorfs: tomtorfs.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
dorssel: dorssel.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh2: schweikh2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh2.orig: schweikh2.orig.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh3: schweikh3.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \
|
|
||||||
-DM3=realloc -DM4=calloc -DM5=free -o $@
|
|
||||||
|
|
||||||
schweikh3_files: samefile.1
|
|
||||||
|
|
||||||
schnitzi: schnitzi.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
chaos: chaos.c
|
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
|
|
||||||
# some libcurses do not have halfdelay(). This rule is for those systems
|
|
||||||
#
|
#
|
||||||
chaos_nohalf: chaos_nohalf.c
|
endif
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
${CP} -f $@ chaos
|
|
||||||
|
|
||||||
chaos_nohalf.c: chaos.c
|
# Specific add-ons or replacements for gcc only
|
||||||
${RM} -f $@
|
#
|
||||||
${SED} -e 's/halfdelay([^)]*);//' < $? > $@
|
ifeq ($(CC),gcc)
|
||||||
|
#
|
||||||
|
#CSILENCE+=
|
||||||
|
#
|
||||||
|
#CWARN+=
|
||||||
|
#
|
||||||
|
endif
|
||||||
|
|
||||||
chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data
|
|
||||||
|
|
||||||
everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES}
|
##############################
|
||||||
|
# Special flags for this entry
|
||||||
|
##############################
|
||||||
|
#
|
||||||
|
ENTRY= schnitzi
|
||||||
|
PROG= ${ENTRY}
|
||||||
|
#
|
||||||
|
OBJ= ${PROG}.o
|
||||||
|
DATA=
|
||||||
|
TARGET= ${PROG}
|
||||||
|
#
|
||||||
|
ALT_OBJ=
|
||||||
|
ALT_TARGET=
|
||||||
|
|
||||||
clean:
|
|
||||||
${RM} -f *.o a.out core ${WINNERS}
|
|
||||||
${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c
|
|
||||||
|
|
||||||
clobber: clean
|
#################
|
||||||
${RM} -f ${WINNERS}
|
# build the entry
|
||||||
${RM} -f ${ALT_NAMES}
|
#################
|
||||||
|
#
|
||||||
nuke: clobber
|
all: data ${TARGET}
|
||||||
@${TRUE}
|
@${TRUE}
|
||||||
|
|
||||||
install: all
|
.PHONY: all alt data everything clean clobber install \
|
||||||
${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null
|
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 ${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:
|
||||||
|
@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 '<was here>' /\\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"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
Best Flow Control:
|
# Best Flow Control:
|
||||||
|
|
||||||
Mark Schnitzius
|
Mark Schnitzius
|
||||||
ISX Corporation
|
ISX Corporation
|
||||||
@@ -8,14 +8,11 @@ Best Flow Control:
|
|||||||
|
|
||||||
http://east.isx.com/~schnitzi/
|
http://east.isx.com/~schnitzi/
|
||||||
|
|
||||||
|
## To build:
|
||||||
|
|
||||||
Judge's Comments:
|
make all
|
||||||
|
|
||||||
To build:
|
### To run
|
||||||
|
|
||||||
make schnitzi
|
|
||||||
|
|
||||||
To use:
|
|
||||||
|
|
||||||
./schnitzi 5 > sort.c
|
./schnitzi 5 > sort.c
|
||||||
cc sort.c -o sort
|
cc sort.c -o sort
|
||||||
@@ -26,14 +23,15 @@ Judge's Comments:
|
|||||||
echo 324 >> data
|
echo 324 >> data
|
||||||
./sort < data
|
./sort < data
|
||||||
|
|
||||||
|
## Judges' comments
|
||||||
|
|
||||||
This is a beautiful program. How can a program with no conditional
|
This is a beautiful program. How can a program with no conditional
|
||||||
behavior at all have output which depends on anything?
|
behavior at all have output which depends on anything?
|
||||||
|
|
||||||
For hints on deciphering this, see below past the Author's Comments;
|
For hints on deciphering this, see below past the Author's Comments;
|
||||||
they're a nice summary, but they leave the mystery intact.
|
they're a nice summary, but they leave the mystery intact.
|
||||||
|
|
||||||
|
## Author's comments
|
||||||
Selected Author's Comments:
|
|
||||||
|
|
||||||
In literary circles, there is a poetic form called a "lipogram",
|
In literary circles, there is a poetic form called a "lipogram",
|
||||||
which is a poem in which a specific letter has been distinctly
|
which is a poem in which a specific letter has been distinctly
|
||||||
|
|||||||
@@ -52,5 +52,5 @@ void x_(){ O=g; *r=y[k-2]; _=r; j=o_; }
|
|||||||
void d (){ O=g; *r=y[k]; _=r; k=k+1; m=k<z; w=_t; l=p_; j=p; }
|
void d (){ O=g; *r=y[k]; _=r; k=k+1; m=k<z; w=_t; l=p_; j=p; }
|
||||||
void y_(){ O=g; *r=x[17][1]+k; _=r; j=q_; }
|
void y_(){ O=g; *r=x[17][1]+k; _=r; j=q_; }
|
||||||
void r_(){ O=_b; _=x[17]; s=(char**)_d; s=s+1; i=*s; q=0; }
|
void r_(){ O=_b; _=x[17]; s=(char**)_d; s=s+1; i=*s; q=0; }
|
||||||
main(v,c){ O=r_; _d=c;
|
main(int v,char **c){ O=r_; _d=c;
|
||||||
x: (O)(); goto x; }
|
x: (O)(); goto x; }
|
||||||
+312
-151
@@ -1,174 +1,335 @@
|
|||||||
#!/bin/make
|
#!/usr/bin/env make
|
||||||
# 1998 makefile
|
|
||||||
#
|
#
|
||||||
# Copyright (c) Landon Curt Noll, Jeremy Horn, Peter Seebach
|
# IOCCC 1998 winning entry - schweikh1
|
||||||
# and Leonid A. Broukhis, 1999.
|
|
||||||
# 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 the contest judges.
|
|
||||||
|
|
||||||
SHELL=/bin/sh
|
################################################################################
|
||||||
CAT=cat
|
#
|
||||||
CHMOD=chmod
|
# An Historical Makefile NOTE:
|
||||||
CP=cp
|
#
|
||||||
MV=mv
|
# The orig.Makefile, if it exits, is the original Makefile before this IOCCC
|
||||||
LN=ln
|
# year directory was reworked so that entries are in separate directories.
|
||||||
RM=rm
|
# This also applies to any orig.ansi.mk and orig.common.mk files.
|
||||||
SED=sed
|
#
|
||||||
TRUE=true
|
# 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
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
# flags for ANSI compiles
|
# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
|
||||||
#
|
#
|
||||||
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode,
|
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||||
# 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
|
# See: http://creativecommons.org/licenses/by-sa/3.0/
|
||||||
# incorrectly. You might want to turn on -O to see if your
|
|
||||||
# compiler can handle them.
|
|
||||||
#
|
|
||||||
# NOTE: On some systems, the library path does not include the location
|
|
||||||
# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir
|
|
||||||
# in order to compile with these libs.
|
|
||||||
#
|
|
||||||
#CFLAGS=-O -Xa
|
|
||||||
#CFLAGS=-Xa
|
|
||||||
CFLAGS= -ansi
|
|
||||||
#CFLAGS= -ansi -O
|
|
||||||
#CFLAGS=
|
|
||||||
#CFLAGS= -ansi -L/usr/X11R6/lib
|
|
||||||
|
|
||||||
# ANSI compiler
|
|
||||||
|
#############################
|
||||||
|
# shell used by this Makefile
|
||||||
|
#############################
|
||||||
#
|
#
|
||||||
# Set CC to the name of your ANSI compiler.
|
SHELL= bash
|
||||||
|
|
||||||
|
#######################
|
||||||
|
# common tool locations
|
||||||
|
#######################
|
||||||
#
|
#
|
||||||
# Some entries seem to need gcc. If you have gcc, set
|
include ../../var.mk
|
||||||
# both CC and MAY_NEED_GCC to gcc.
|
|
||||||
|
# Set X11_LIBDIR to the directory where the X11 library resides
|
||||||
#
|
#
|
||||||
# If you do not have gcc, set CC to the name of your ANSI compiler, and
|
#X11_LIBDIR= /usr/X11R6/lib
|
||||||
# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just :
|
#X11_LIBDIR= /usr/X11/lib
|
||||||
# to disable such programs.
|
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-string-plus-int -Wno-switch-bool
|
||||||
|
|
||||||
|
# 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 -include string.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= cc
|
||||||
MAY_NEED_GCC= gcc
|
#CC=clang
|
||||||
|
#CC=gcc
|
||||||
|
|
||||||
# winners that compile under ANSI C
|
# Compiler add-ons or replacements for clang only
|
||||||
#
|
#
|
||||||
WINNERS= schweikh1 df dloweneil banks dlowe bas2 fanf bas1 tomtorfs dorssel \
|
ifeq ($(CC),clang)
|
||||||
schweikh2 schnitzi chaos schweikh3
|
|
||||||
ALT_NAMES= schweikh2.orig banks.orig dlowe.orig df.orig schweikh1.orig \
|
|
||||||
chaos_nohalf
|
|
||||||
DATA_FILES= banks_files chaos_files fanf_files schweikh1_files schweikh3_files
|
|
||||||
|
|
||||||
|
|
||||||
all: ${WINNERS}
|
|
||||||
|
|
||||||
schweikh1: schweikh1.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh1.orig: schweikh1.orig.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh1_files: info
|
|
||||||
|
|
||||||
df: df.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
df.orig: prog.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
prog.c : df.c
|
|
||||||
${RM} -f prog.c
|
|
||||||
${CP} $? prog.c
|
|
||||||
|
|
||||||
dloweneil: dloweneil.c
|
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
|
|
||||||
# See note about use of -L/path/to/X11/lib/dir above this rule fails to link
|
|
||||||
#
|
#
|
||||||
banks: banks.c
|
CSILENCE+= -Wno-poison-system-directories
|
||||||
${CC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
|
||||||
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
|
||||||
-DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@
|
|
||||||
|
|
||||||
# See note about use of -L/path/to/X11/lib/dir above this rule fails to link
|
|
||||||
#
|
#
|
||||||
banks.orig: banks.orig.c
|
CWARN+= -Weverything
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
|
||||||
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
|
||||||
-DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@
|
|
||||||
|
|
||||||
banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc
|
|
||||||
|
|
||||||
dlowe: dlowe.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
dlowe.orig: dlowe.orig.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
bas2: bas2.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
fanf: fanf.c
|
|
||||||
${RM} -f fanftmp1.c fanftmp2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@
|
|
||||||
|
|
||||||
fanf_files: fanf.lambda
|
|
||||||
|
|
||||||
bas1: bas1.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
tomtorfs: tomtorfs.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
dorssel: dorssel.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh2: schweikh2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh2.orig: schweikh2.orig.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh3: schweikh3.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \
|
|
||||||
-DM3=realloc -DM4=calloc -DM5=free -o $@
|
|
||||||
|
|
||||||
schweikh3_files: samefile.1
|
|
||||||
|
|
||||||
schnitzi: schnitzi.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
chaos: chaos.c
|
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
|
|
||||||
# some libcurses do not have halfdelay(). This rule is for those systems
|
|
||||||
#
|
#
|
||||||
chaos_nohalf: chaos_nohalf.c
|
endif
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
${CP} -f $@ chaos
|
|
||||||
|
|
||||||
chaos_nohalf.c: chaos.c
|
# Specific add-ons or replacements for gcc only
|
||||||
${RM} -f $@
|
#
|
||||||
${SED} -e 's/halfdelay([^)]*);//' < $? > $@
|
ifeq ($(CC),gcc)
|
||||||
|
#
|
||||||
|
#CSILENCE+=
|
||||||
|
#
|
||||||
|
#CWARN+=
|
||||||
|
#
|
||||||
|
endif
|
||||||
|
|
||||||
chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data
|
|
||||||
|
|
||||||
everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES}
|
##############################
|
||||||
|
# Special flags for this entry
|
||||||
|
##############################
|
||||||
|
#
|
||||||
|
ENTRY= schweikh1
|
||||||
|
PROG= ${ENTRY}
|
||||||
|
#
|
||||||
|
OBJ= ${PROG}.o
|
||||||
|
DATA= info
|
||||||
|
TARGET= ${PROG}
|
||||||
|
#
|
||||||
|
ALT_OBJ=
|
||||||
|
ALT_TARGET=
|
||||||
|
|
||||||
clean:
|
|
||||||
${RM} -f *.o a.out core ${WINNERS}
|
|
||||||
${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c
|
|
||||||
|
|
||||||
clobber: clean
|
#################
|
||||||
${RM} -f ${WINNERS}
|
# build the entry
|
||||||
${RM} -f ${ALT_NAMES}
|
#################
|
||||||
|
#
|
||||||
nuke: clobber
|
all: data ${TARGET}
|
||||||
@${TRUE}
|
@${TRUE}
|
||||||
|
|
||||||
install: all
|
.PHONY: all alt data everything clean clobber install \
|
||||||
${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null
|
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 ${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:
|
||||||
|
@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 '<was here>' /\\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"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
CPP Abuse:
|
# CPP Abuse:
|
||||||
|
|
||||||
Jens Schweikhardt
|
Jens Schweikhardt
|
||||||
DFN Network Operation Center
|
DFN Network Operation Center
|
||||||
@@ -8,17 +8,16 @@ CPP Abuse:
|
|||||||
|
|
||||||
http://www.shuttle.de/schweikh/
|
http://www.shuttle.de/schweikh/
|
||||||
|
|
||||||
|
## To build:
|
||||||
|
|
||||||
Judge's Comments:
|
make all
|
||||||
|
|
||||||
To build:
|
### To run
|
||||||
|
|
||||||
make schweikh1
|
|
||||||
|
|
||||||
To use:
|
|
||||||
|
|
||||||
./schweikh1
|
./schweikh1
|
||||||
|
|
||||||
|
## Judges' comments
|
||||||
|
|
||||||
What does it do? It seems to print a list of system headers, perhaps
|
What does it do? It seems to print a list of system headers, perhaps
|
||||||
with words after them. Curiously, if you look at the list of words
|
with words after them. Curiously, if you look at the list of words
|
||||||
defined in a given standard header, they are never printed directly
|
defined in a given standard header, they are never printed directly
|
||||||
@@ -42,14 +41,7 @@ Judge's Comments:
|
|||||||
will need to frob the source anyway and can be expected to do the
|
will need to frob the source anyway and can be expected to do the
|
||||||
right thing with ${CC}. So use gcc.
|
right thing with ${CC}. So use gcc.
|
||||||
|
|
||||||
NOTE: One may build the original entry, which incorrectly used
|
## Author's comments
|
||||||
^K's and ^L's after a # cpp-directive. While this works under
|
|
||||||
gcc, it is not ISO C89. One may build this original entry by:
|
|
||||||
|
|
||||||
make schweikh1.orig
|
|
||||||
|
|
||||||
|
|
||||||
Selected Author's Comments:
|
|
||||||
|
|
||||||
Important! This program, if it compiles at all, is mis-compiled by many
|
Important! This program, if it compiles at all, is mis-compiled by many
|
||||||
compilers due to compiler bugs. It could be the "least likely
|
compilers due to compiler bugs. It could be the "least likely
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
%:define H(x) <st%:%:x##.h>
|
%:define H(x) <st%:%:x##.h>
|
||||||
#include H(dio)
|
/*#include H(dio)*/
|
||||||
#include H(dlib)
|
/*#include H(dlib)*/
|
||||||
#include H(ring)
|
/*#include H(ring)*/
|
||||||
|
|
||||||
#define x ) == 0 ?__LINE__:0){O =__LINE__;break;} }
|
#define x ) == 0 ?__LINE__:0){O =__LINE__;break;} }
|
||||||
#define X(x) __LINE__ x __LINE__
|
#define X(x) __LINE__ x __LINE__
|
||||||
|
|||||||
@@ -1,70 +0,0 @@
|
|||||||
%:defineH(x) <st%:%:x##.h>
|
|
||||||
#includeH(dio)
|
|
||||||
#includeH(dlib)
|
|
||||||
#includeH(ring)
|
|
||||||
|
|
||||||
#definex)==0?__LINE__:0){O=__LINE__;break;}}
|
|
||||||
#defineX(x)__LINE__x__LINE__
|
|
||||||
#definet(a)\
|
|
||||||
for(c=0;c<n##a; ++c) { \
|
|
||||||
if(strchr (a[c], 0[__FILE__])) { if (*a[c] == 0[__FILE__]) { \
|
|
||||||
if (strcmp (a[c]+__LINE__, I + strlen (I) + __LINE__ - strlen (a[c]) x else { \
|
|
||||||
if (strncmp (a[c], I, strlen (a[c])-__LINE__ x \
|
|
||||||
}else { if (strcmp (a[c], I x }
|
|
||||||
|
|
||||||
#line 4 "info\0r"
|
|
||||||
int
|
|
||||||
main (int C, char **V)
|
|
||||||
{
|
|
||||||
FILE *H;
|
|
||||||
int c, ne, nn, S = C < 2 ? 060 : *V[1];
|
|
||||||
|
|
||||||
char f[__LINE__][X(*)], K[X(*)], L[X(<<)],
|
|
||||||
e[X(<<)][3*__LINE__], n[X(<<)][3*__LINE__], F[__LINE__];
|
|
||||||
|
|
||||||
if (freopen (__FILE__, 5+__FILE__, stdin) == 0) return __LINE__-13;
|
|
||||||
for (c = 0;;) {
|
|
||||||
#line 1 "#\n"
|
|
||||||
if (!fgets (f[c], (int)sizeof *f, stdin)) return __LINE__; if (*f[c] == 0[__FILE__]) continue; if (*f[c] != __LINE__[__FILE__]) { f[c][strlen (f[c]) - __LINE__] = 2[__FILE__];
|
|
||||||
++c;
|
|
||||||
} else
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
for (ne = 0;;) {
|
|
||||||
do {
|
|
||||||
#line 1 "#%s%s"
|
|
||||||
if (!fgets (L, (int)sizeof L, stdin)) return __LINE__; } while (*L == 0[__FILE__]); switch (sscanf (L, __LINE__+__FILE__, F, e[ne])) { default: goto O;
|
|
||||||
case __LINE__: switch (strchr (F, S)!=0) case 1: ++ne;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
O:
|
|
||||||
nn = 0;
|
|
||||||
while ((fgets (L, (int) sizeof L, stdin)) != 0) {
|
|
||||||
|
|
||||||
|
|
||||||
char A[__LINE__], f3; if (*L == 0[__FILE__]) continue;
|
|
||||||
#line 1 "%s%s %c"
|
|
||||||
switch (sscanf (L, __FILE__, A, n[nn], &f3)) {
|
|
||||||
case __LINE__: if (strchr (A, S)) ++nn; break;
|
|
||||||
case __LINE__:
|
|
||||||
if (strchr (A, S)) {
|
|
||||||
#line 8 "<%s>:\n"
|
|
||||||
char *I = L + __LINE__;
|
|
||||||
int O = printf (__FILE__, n[nn]) +
|
|
||||||
#line 2 "0gcc -ansi -E -dM -undef %s /usr/include/%s>r\0 ("
|
|
||||||
sprintf (K, 1+__FILE__, f[S-*__FILE__] + __LINE__, n[nn]);
|
|
||||||
O += system (K);
|
|
||||||
if ((H = fopen (__FILE__+44, 44+__FILE__)) == 0) return 1;
|
|
||||||
while ((fgets (L, (int)sizeof L, H)) != 0) {
|
|
||||||
I[strcspn (I, 46+__FILE__)] = O = 0;
|
|
||||||
#line 1 "*r"
|
|
||||||
t (n) t (e)
|
|
||||||
if (0 == O) O = puts (L);
|
|
||||||
}
|
|
||||||
nn = fclose (H);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return remove (1+__FILE__);
|
|
||||||
}
|
|
||||||
+315
-151
@@ -1,174 +1,338 @@
|
|||||||
#!/bin/make
|
#!/usr/bin/env make
|
||||||
# 1998 makefile
|
|
||||||
#
|
#
|
||||||
# Copyright (c) Landon Curt Noll, Jeremy Horn, Peter Seebach
|
# IOCCC 1998 winning entry - schweikh2
|
||||||
# and Leonid A. Broukhis, 1999.
|
|
||||||
# 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 the contest judges.
|
|
||||||
|
|
||||||
SHELL=/bin/sh
|
################################################################################
|
||||||
CAT=cat
|
#
|
||||||
CHMOD=chmod
|
# An Historical Makefile NOTE:
|
||||||
CP=cp
|
#
|
||||||
MV=mv
|
# The orig.Makefile, if it exits, is the original Makefile before this IOCCC
|
||||||
LN=ln
|
# year directory was reworked so that entries are in separate directories.
|
||||||
RM=rm
|
# This also applies to any orig.ansi.mk and orig.common.mk files.
|
||||||
SED=sed
|
#
|
||||||
TRUE=true
|
# 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
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
# flags for ANSI compiles
|
# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
|
||||||
#
|
#
|
||||||
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode,
|
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||||
# 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
|
# See: http://creativecommons.org/licenses/by-sa/3.0/
|
||||||
# incorrectly. You might want to turn on -O to see if your
|
|
||||||
# compiler can handle them.
|
|
||||||
#
|
|
||||||
# NOTE: On some systems, the library path does not include the location
|
|
||||||
# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir
|
|
||||||
# in order to compile with these libs.
|
|
||||||
#
|
|
||||||
#CFLAGS=-O -Xa
|
|
||||||
#CFLAGS=-Xa
|
|
||||||
CFLAGS= -ansi
|
|
||||||
#CFLAGS= -ansi -O
|
|
||||||
#CFLAGS=
|
|
||||||
#CFLAGS= -ansi -L/usr/X11R6/lib
|
|
||||||
|
|
||||||
# ANSI compiler
|
|
||||||
|
#############################
|
||||||
|
# shell used by this Makefile
|
||||||
|
#############################
|
||||||
#
|
#
|
||||||
# Set CC to the name of your ANSI compiler.
|
SHELL= bash
|
||||||
|
|
||||||
|
#######################
|
||||||
|
# common tool locations
|
||||||
|
#######################
|
||||||
#
|
#
|
||||||
# Some entries seem to need gcc. If you have gcc, set
|
include ../../var.mk
|
||||||
# both CC and MAY_NEED_GCC to gcc.
|
|
||||||
|
# Set X11_LIBDIR to the directory where the X11 library resides
|
||||||
#
|
#
|
||||||
# If you do not have gcc, set CC to the name of your ANSI compiler, and
|
#X11_LIBDIR= /usr/X11R6/lib
|
||||||
# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just :
|
#X11_LIBDIR= /usr/X11/lib
|
||||||
# to disable such programs.
|
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-trigraphs -Wno-sign-compare -Wno-string-plus-int -Wno-switch-bool
|
||||||
|
|
||||||
|
# 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= cc
|
||||||
MAY_NEED_GCC= gcc
|
#CC=clang
|
||||||
|
#CC=gcc
|
||||||
|
|
||||||
# winners that compile under ANSI C
|
# Compiler add-ons or replacements for clang only
|
||||||
#
|
#
|
||||||
WINNERS= schweikh1 df dloweneil banks dlowe bas2 fanf bas1 tomtorfs dorssel \
|
ifeq ($(CC),clang)
|
||||||
schweikh2 schnitzi chaos schweikh3
|
|
||||||
ALT_NAMES= schweikh2.orig banks.orig dlowe.orig df.orig schweikh1.orig \
|
|
||||||
chaos_nohalf
|
|
||||||
DATA_FILES= banks_files chaos_files fanf_files schweikh1_files schweikh3_files
|
|
||||||
|
|
||||||
|
|
||||||
all: ${WINNERS}
|
|
||||||
|
|
||||||
schweikh1: schweikh1.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh1.orig: schweikh1.orig.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh1_files: info
|
|
||||||
|
|
||||||
df: df.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
df.orig: prog.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
prog.c : df.c
|
|
||||||
${RM} -f prog.c
|
|
||||||
${CP} $? prog.c
|
|
||||||
|
|
||||||
dloweneil: dloweneil.c
|
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
|
|
||||||
# See note about use of -L/path/to/X11/lib/dir above this rule fails to link
|
|
||||||
#
|
#
|
||||||
banks: banks.c
|
CSILENCE+= -Wno-poison-system-directories -Wno-unused-macros -Wno-sign-conversion
|
||||||
${CC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
|
||||||
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
|
||||||
-DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@
|
|
||||||
|
|
||||||
# See note about use of -L/path/to/X11/lib/dir above this rule fails to link
|
|
||||||
#
|
#
|
||||||
banks.orig: banks.orig.c
|
CWARN+= -Weverything
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
|
||||||
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
|
||||||
-DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@
|
|
||||||
|
|
||||||
banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc
|
|
||||||
|
|
||||||
dlowe: dlowe.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
dlowe.orig: dlowe.orig.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
bas2: bas2.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
fanf: fanf.c
|
|
||||||
${RM} -f fanftmp1.c fanftmp2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@
|
|
||||||
|
|
||||||
fanf_files: fanf.lambda
|
|
||||||
|
|
||||||
bas1: bas1.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
tomtorfs: tomtorfs.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
dorssel: dorssel.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh2: schweikh2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh2.orig: schweikh2.orig.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh3: schweikh3.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \
|
|
||||||
-DM3=realloc -DM4=calloc -DM5=free -o $@
|
|
||||||
|
|
||||||
schweikh3_files: samefile.1
|
|
||||||
|
|
||||||
schnitzi: schnitzi.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
chaos: chaos.c
|
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
|
|
||||||
# some libcurses do not have halfdelay(). This rule is for those systems
|
|
||||||
#
|
#
|
||||||
chaos_nohalf: chaos_nohalf.c
|
endif
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
${CP} -f $@ chaos
|
|
||||||
|
|
||||||
chaos_nohalf.c: chaos.c
|
# Specific add-ons or replacements for gcc only
|
||||||
${RM} -f $@
|
#
|
||||||
${SED} -e 's/halfdelay([^)]*);//' < $? > $@
|
ifeq ($(CC),gcc)
|
||||||
|
#
|
||||||
|
#CSILENCE+=
|
||||||
|
#
|
||||||
|
#CWARN+=
|
||||||
|
#
|
||||||
|
endif
|
||||||
|
|
||||||
chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data
|
|
||||||
|
|
||||||
everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES}
|
##############################
|
||||||
|
# Special flags for this entry
|
||||||
|
##############################
|
||||||
|
#
|
||||||
|
ENTRY= schweikh2
|
||||||
|
PROG= ${ENTRY}
|
||||||
|
#
|
||||||
|
OBJ= ${PROG}.o
|
||||||
|
DATA=
|
||||||
|
TARGET= ${PROG} ${PROG}.alt
|
||||||
|
#
|
||||||
|
ALT_OBJ= ${PROG}.alt.o
|
||||||
|
ALT_TARGET= ${PROG}.alt
|
||||||
|
|
||||||
clean:
|
|
||||||
${RM} -f *.o a.out core ${WINNERS}
|
|
||||||
${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c
|
|
||||||
|
|
||||||
clobber: clean
|
#################
|
||||||
${RM} -f ${WINNERS}
|
# build the entry
|
||||||
${RM} -f ${ALT_NAMES}
|
#################
|
||||||
|
#
|
||||||
nuke: clobber
|
all: data ${TARGET}
|
||||||
@${TRUE}
|
@${TRUE}
|
||||||
|
|
||||||
install: all
|
.PHONY: all alt data everything clean clobber install \
|
||||||
${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null
|
love haste waste maker easter_egg sandwich \
|
||||||
|
supernova deep_magic magic charon pluto
|
||||||
|
|
||||||
|
${PROG}: ${PROG}.c
|
||||||
|
${CC} ${CFLAGS} $< -o $@ ${LIBS}
|
||||||
|
|
||||||
|
${PROG}.alt: ${PROG}.alt.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 ${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:
|
||||||
|
@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 '<was here>' /\\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"
|
||||||
+13
-12
@@ -1,4 +1,4 @@
|
|||||||
Most Erratic Behavior:
|
# Most Erratic Behavior:
|
||||||
|
|
||||||
Jens Schweikhardt
|
Jens Schweikhardt
|
||||||
DFN Network Operation Center
|
DFN Network Operation Center
|
||||||
@@ -9,15 +9,15 @@ Most Erratic Behavior:
|
|||||||
http://www.shuttle.de/schweikh/
|
http://www.shuttle.de/schweikh/
|
||||||
|
|
||||||
|
|
||||||
Judges' comments:
|
## To build:
|
||||||
|
|
||||||
To build:
|
make all
|
||||||
|
|
||||||
make schweikh2
|
NOTE: Almost every compiler is supposed to be able to accept the code in
|
||||||
|
schweikh2.c; try compiling schweikh2.alt.c to see if your compiler
|
||||||
|
is fully standard-compliant.
|
||||||
|
|
||||||
Almost every compiler is supposed to be able to accept the code in
|
### To run
|
||||||
schweikh2.c; try compiling schweikh2.orig.c to see if your compiler
|
|
||||||
is fully standard-compliant.
|
|
||||||
|
|
||||||
To use:
|
To use:
|
||||||
|
|
||||||
@@ -25,6 +25,8 @@ Judges' comments:
|
|||||||
or
|
or
|
||||||
./schweikh2 integer_number
|
./schweikh2 integer_number
|
||||||
|
|
||||||
|
## Judges' comments
|
||||||
|
|
||||||
Run the program with a small argument, like 5 or 10, several times.
|
Run the program with a small argument, like 5 or 10, several times.
|
||||||
Are the results different? Why?
|
Are the results different? Why?
|
||||||
|
|
||||||
@@ -34,11 +36,11 @@ Judges' comments:
|
|||||||
At the time this hint file was written, some gcc and egcs
|
At the time this hint file was written, some gcc and egcs
|
||||||
implementations ran into problem when building the original entry:
|
implementations ran into problem when building the original entry:
|
||||||
|
|
||||||
make schweikh2.orig
|
make schweikh2.alt
|
||||||
|
|
||||||
This program often will produce an error of the form:
|
This program often will produce an error of the form:
|
||||||
|
|
||||||
gcc -ansi schweikh2.orig.c -o schweikh2.orig
|
gcc -ansi schweikh2.alt.c -o schweikh2.alt
|
||||||
as: Error: cca00NzV.s, line 58: Missing " at end of string
|
as: Error: cca00NzV.s, line 58: Missing " at end of string
|
||||||
"
|
"
|
||||||
as: Error: cca00NzV.s, line 58: malformed statement
|
as: Error: cca00NzV.s, line 58: malformed statement
|
||||||
@@ -61,7 +63,7 @@ Judges' comments:
|
|||||||
|
|
||||||
In some cases one must compile using 'gcc -g':
|
In some cases one must compile using 'gcc -g':
|
||||||
|
|
||||||
make schweikh2.orig CFLAGS=-g
|
make schweikh2.alt CFLAGS=-g
|
||||||
|
|
||||||
to trigger this error.
|
to trigger this error.
|
||||||
|
|
||||||
@@ -78,8 +80,7 @@ Judges' comments:
|
|||||||
If you succeed in doing this (especially on FreeBSD, Linux or Sparc),
|
If you succeed in doing this (especially on FreeBSD, Linux or Sparc),
|
||||||
email the author for a free pat on the back.
|
email the author for a free pat on the back.
|
||||||
|
|
||||||
|
## Author's comments
|
||||||
Selected author's comments:
|
|
||||||
|
|
||||||
What this program does
|
What this program does
|
||||||
----------------------
|
----------------------
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ static volatile sig_atomic_t One;
|
|||||||
#include<unistd.h>
|
#include<unistd.h>
|
||||||
#define Zero(NULL)#NULL
|
#define Zero(NULL)#NULL
|
||||||
#define ONE(One) Zero(One)
|
#define ONE(One) Zero(One)
|
||||||
in??/
|
int
|
||||||
t
|
|
||||||
??=line 10 ONE(O(1,1,2,6,0,6))
|
??=line 10 ONE(O(1,1,2,6,0,6))
|
||||||
main (register zero, char **ONE)
|
main (register zero, char **ONE)
|
||||||
%:
|
%:
|
||||||
@@ -6,8 +6,8 @@ static volatile sig_atomic_t One;
|
|||||||
#include<unistd.h>
|
#include<unistd.h>
|
||||||
#define Zero(NULL)#NULL
|
#define Zero(NULL)#NULL
|
||||||
#define ONE(One) Zero(One)
|
#define ONE(One) Zero(One)
|
||||||
in??/
|
int
|
||||||
t
|
|
||||||
#line 10 "01\015"
|
#line 10 "01\015"
|
||||||
main (register zero, char **ONE)
|
main (register zero, char **ONE)
|
||||||
%:
|
%:
|
||||||
|
|||||||
+313
-151
@@ -1,174 +1,336 @@
|
|||||||
#!/bin/make
|
#!/usr/bin/env make
|
||||||
# 1998 makefile
|
|
||||||
#
|
#
|
||||||
# Copyright (c) Landon Curt Noll, Jeremy Horn, Peter Seebach
|
# IOCCC 1998 winning entry - schweikh3
|
||||||
# and Leonid A. Broukhis, 1999.
|
|
||||||
# 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 the contest judges.
|
|
||||||
|
|
||||||
SHELL=/bin/sh
|
################################################################################
|
||||||
CAT=cat
|
#
|
||||||
CHMOD=chmod
|
# An Historical Makefile NOTE:
|
||||||
CP=cp
|
#
|
||||||
MV=mv
|
# The orig.Makefile, if it exits, is the original Makefile before this IOCCC
|
||||||
LN=ln
|
# year directory was reworked so that entries are in separate directories.
|
||||||
RM=rm
|
# This also applies to any orig.ansi.mk and orig.common.mk files.
|
||||||
SED=sed
|
#
|
||||||
TRUE=true
|
# 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
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
# flags for ANSI compiles
|
# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
|
||||||
#
|
#
|
||||||
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode,
|
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||||
# 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
|
# See: http://creativecommons.org/licenses/by-sa/3.0/
|
||||||
# incorrectly. You might want to turn on -O to see if your
|
|
||||||
# compiler can handle them.
|
|
||||||
#
|
|
||||||
# NOTE: On some systems, the library path does not include the location
|
|
||||||
# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir
|
|
||||||
# in order to compile with these libs.
|
|
||||||
#
|
|
||||||
#CFLAGS=-O -Xa
|
|
||||||
#CFLAGS=-Xa
|
|
||||||
CFLAGS= -ansi
|
|
||||||
#CFLAGS= -ansi -O
|
|
||||||
#CFLAGS=
|
|
||||||
#CFLAGS= -ansi -L/usr/X11R6/lib
|
|
||||||
|
|
||||||
# ANSI compiler
|
|
||||||
|
#############################
|
||||||
|
# shell used by this Makefile
|
||||||
|
#############################
|
||||||
#
|
#
|
||||||
# Set CC to the name of your ANSI compiler.
|
SHELL= bash
|
||||||
|
|
||||||
|
#######################
|
||||||
|
# common tool locations
|
||||||
|
#######################
|
||||||
#
|
#
|
||||||
# Some entries seem to need gcc. If you have gcc, set
|
include ../../var.mk
|
||||||
# both CC and MAY_NEED_GCC to gcc.
|
|
||||||
|
# Set X11_LIBDIR to the directory where the X11 library resides
|
||||||
#
|
#
|
||||||
# If you do not have gcc, set CC to the name of your ANSI compiler, and
|
#X11_LIBDIR= /usr/X11R6/lib
|
||||||
# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just :
|
#X11_LIBDIR= /usr/X11/lib
|
||||||
# to disable such programs.
|
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-trigraphs
|
||||||
|
|
||||||
|
# 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= -DM0=sizeof -DM1=long -DM2=void \
|
||||||
|
-DM3=realloc -DM4=calloc -DM5=free
|
||||||
|
|
||||||
|
# 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= cc
|
||||||
MAY_NEED_GCC= gcc
|
#CC=clang
|
||||||
|
#CC=gcc
|
||||||
|
|
||||||
# winners that compile under ANSI C
|
# Compiler add-ons or replacements for clang only
|
||||||
#
|
#
|
||||||
WINNERS= schweikh1 df dloweneil banks dlowe bas2 fanf bas1 tomtorfs dorssel \
|
ifeq ($(CC),clang)
|
||||||
schweikh2 schnitzi chaos schweikh3
|
|
||||||
ALT_NAMES= schweikh2.orig banks.orig dlowe.orig df.orig schweikh1.orig \
|
|
||||||
chaos_nohalf
|
|
||||||
DATA_FILES= banks_files chaos_files fanf_files schweikh1_files schweikh3_files
|
|
||||||
|
|
||||||
|
|
||||||
all: ${WINNERS}
|
|
||||||
|
|
||||||
schweikh1: schweikh1.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh1.orig: schweikh1.orig.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh1_files: info
|
|
||||||
|
|
||||||
df: df.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
df.orig: prog.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
prog.c : df.c
|
|
||||||
${RM} -f prog.c
|
|
||||||
${CP} $? prog.c
|
|
||||||
|
|
||||||
dloweneil: dloweneil.c
|
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
|
|
||||||
# See note about use of -L/path/to/X11/lib/dir above this rule fails to link
|
|
||||||
#
|
#
|
||||||
banks: banks.c
|
#CSILENCE+=
|
||||||
${CC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
|
||||||
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
|
||||||
-DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@
|
|
||||||
|
|
||||||
# See note about use of -L/path/to/X11/lib/dir above this rule fails to link
|
|
||||||
#
|
#
|
||||||
banks.orig: banks.orig.c
|
CWARN+= -Weverything
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
|
||||||
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
|
||||||
-DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@
|
|
||||||
|
|
||||||
banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc
|
|
||||||
|
|
||||||
dlowe: dlowe.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
dlowe.orig: dlowe.orig.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
bas2: bas2.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
fanf: fanf.c
|
|
||||||
${RM} -f fanftmp1.c fanftmp2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@
|
|
||||||
|
|
||||||
fanf_files: fanf.lambda
|
|
||||||
|
|
||||||
bas1: bas1.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
tomtorfs: tomtorfs.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
dorssel: dorssel.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh2: schweikh2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh2.orig: schweikh2.orig.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh3: schweikh3.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \
|
|
||||||
-DM3=realloc -DM4=calloc -DM5=free -o $@
|
|
||||||
|
|
||||||
schweikh3_files: samefile.1
|
|
||||||
|
|
||||||
schnitzi: schnitzi.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
chaos: chaos.c
|
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
|
|
||||||
# some libcurses do not have halfdelay(). This rule is for those systems
|
|
||||||
#
|
#
|
||||||
chaos_nohalf: chaos_nohalf.c
|
endif
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
${CP} -f $@ chaos
|
|
||||||
|
|
||||||
chaos_nohalf.c: chaos.c
|
# Specific add-ons or replacements for gcc only
|
||||||
${RM} -f $@
|
#
|
||||||
${SED} -e 's/halfdelay([^)]*);//' < $? > $@
|
ifeq ($(CC),gcc)
|
||||||
|
#
|
||||||
|
#CSILENCE+=
|
||||||
|
#
|
||||||
|
#CWARN+=
|
||||||
|
#
|
||||||
|
endif
|
||||||
|
|
||||||
chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data
|
|
||||||
|
|
||||||
everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES}
|
##############################
|
||||||
|
# Special flags for this entry
|
||||||
|
##############################
|
||||||
|
#
|
||||||
|
ENTRY= schweikh3
|
||||||
|
PROG= ${ENTRY}
|
||||||
|
#
|
||||||
|
OBJ= ${PROG}.o
|
||||||
|
DATA= samefile.1
|
||||||
|
TARGET= ${PROG}
|
||||||
|
#
|
||||||
|
ALT_OBJ=
|
||||||
|
ALT_TARGET=
|
||||||
|
|
||||||
clean:
|
|
||||||
${RM} -f *.o a.out core ${WINNERS}
|
|
||||||
${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c
|
|
||||||
|
|
||||||
clobber: clean
|
#################
|
||||||
${RM} -f ${WINNERS}
|
# build the entry
|
||||||
${RM} -f ${ALT_NAMES}
|
#################
|
||||||
|
#
|
||||||
nuke: clobber
|
all: data ${TARGET}
|
||||||
@${TRUE}
|
@${TRUE}
|
||||||
|
|
||||||
install: all
|
.PHONY: all alt data everything clean clobber install \
|
||||||
${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null
|
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 ${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:
|
||||||
|
@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 '<was here>' /\\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"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
Most Space Efficient:
|
# Most Space Efficient:
|
||||||
|
|
||||||
Jens Schweikhardt
|
Jens Schweikhardt
|
||||||
DFN Network Operation Center
|
DFN Network Operation Center
|
||||||
@@ -8,14 +8,11 @@ Most Space Efficient:
|
|||||||
|
|
||||||
http://www.shuttle.de/schweikh/
|
http://www.shuttle.de/schweikh/
|
||||||
|
|
||||||
|
## To build:
|
||||||
|
|
||||||
Judges' comments:
|
make all
|
||||||
|
|
||||||
To build:
|
### To run
|
||||||
|
|
||||||
make schweikh3
|
|
||||||
|
|
||||||
To use:
|
|
||||||
|
|
||||||
If "dir" is the directory (or a directory tree) where you keep
|
If "dir" is the directory (or a directory tree) where you keep
|
||||||
all your favorite pictures off the Internet or from
|
all your favorite pictures off the Internet or from
|
||||||
@@ -23,6 +20,8 @@ Judges' comments:
|
|||||||
|
|
||||||
find dir -type f -print | ./schweikh3
|
find dir -type f -print | ./schweikh3
|
||||||
|
|
||||||
|
## Judges' comments
|
||||||
|
|
||||||
Maybe you will not need to buy another 10 Gb disk to store them. :-)
|
Maybe you will not need to buy another 10 Gb disk to store them. :-)
|
||||||
|
|
||||||
Also Try:
|
Also Try:
|
||||||
@@ -40,8 +39,7 @@ Judges' comments:
|
|||||||
NOTE: Some non-gcc compilers that are not fully ANSI standard do
|
NOTE: Some non-gcc compilers that are not fully ANSI standard do
|
||||||
not compile this entry correctly.
|
not compile this entry correctly.
|
||||||
|
|
||||||
|
## Author's comments
|
||||||
Selected author's comments:
|
|
||||||
|
|
||||||
The source is expected to conform to IEEE Std 1003.1-1990 ("POSIX").
|
The source is expected to conform to IEEE Std 1003.1-1990 ("POSIX").
|
||||||
Thank God the IEEE does not standardize a coding style...
|
Thank God the IEEE does not standardize a coding style...
|
||||||
|
|||||||
+313
-151
@@ -1,174 +1,336 @@
|
|||||||
#!/bin/make
|
#!/usr/bin/env make
|
||||||
# 1998 makefile
|
|
||||||
#
|
#
|
||||||
# Copyright (c) Landon Curt Noll, Jeremy Horn, Peter Seebach
|
# IOCCC 1998 winning entry - tomtorfs
|
||||||
# and Leonid A. Broukhis, 1999.
|
|
||||||
# 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 the contest judges.
|
|
||||||
|
|
||||||
SHELL=/bin/sh
|
################################################################################
|
||||||
CAT=cat
|
#
|
||||||
CHMOD=chmod
|
# An Historical Makefile NOTE:
|
||||||
CP=cp
|
#
|
||||||
MV=mv
|
# The orig.Makefile, if it exits, is the original Makefile before this IOCCC
|
||||||
LN=ln
|
# year directory was reworked so that entries are in separate directories.
|
||||||
RM=rm
|
# This also applies to any orig.ansi.mk and orig.common.mk files.
|
||||||
SED=sed
|
#
|
||||||
TRUE=true
|
# 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
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
# flags for ANSI compiles
|
# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
|
||||||
#
|
#
|
||||||
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode,
|
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||||
# 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
|
# See: http://creativecommons.org/licenses/by-sa/3.0/
|
||||||
# incorrectly. You might want to turn on -O to see if your
|
|
||||||
# compiler can handle them.
|
|
||||||
#
|
|
||||||
# NOTE: On some systems, the library path does not include the location
|
|
||||||
# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir
|
|
||||||
# in order to compile with these libs.
|
|
||||||
#
|
|
||||||
#CFLAGS=-O -Xa
|
|
||||||
#CFLAGS=-Xa
|
|
||||||
CFLAGS= -ansi
|
|
||||||
#CFLAGS= -ansi -O
|
|
||||||
#CFLAGS=
|
|
||||||
#CFLAGS= -ansi -L/usr/X11R6/lib
|
|
||||||
|
|
||||||
# ANSI compiler
|
|
||||||
|
#############################
|
||||||
|
# shell used by this Makefile
|
||||||
|
#############################
|
||||||
#
|
#
|
||||||
# Set CC to the name of your ANSI compiler.
|
SHELL= bash
|
||||||
|
|
||||||
|
#######################
|
||||||
|
# common tool locations
|
||||||
|
#######################
|
||||||
#
|
#
|
||||||
# Some entries seem to need gcc. If you have gcc, set
|
include ../../var.mk
|
||||||
# both CC and MAY_NEED_GCC to gcc.
|
|
||||||
|
# Set X11_LIBDIR to the directory where the X11 library resides
|
||||||
#
|
#
|
||||||
# If you do not have gcc, set CC to the name of your ANSI compiler, and
|
#X11_LIBDIR= /usr/X11R6/lib
|
||||||
# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just :
|
#X11_LIBDIR= /usr/X11/lib
|
||||||
# to disable such programs.
|
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-implicit-int
|
||||||
|
|
||||||
|
# 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= cc
|
||||||
MAY_NEED_GCC= gcc
|
#CC=clang
|
||||||
|
#CC=gcc
|
||||||
|
|
||||||
# winners that compile under ANSI C
|
# Compiler add-ons or replacements for clang only
|
||||||
#
|
#
|
||||||
WINNERS= schweikh1 df dloweneil banks dlowe bas2 fanf bas1 tomtorfs dorssel \
|
ifeq ($(CC),clang)
|
||||||
schweikh2 schnitzi chaos schweikh3
|
|
||||||
ALT_NAMES= schweikh2.orig banks.orig dlowe.orig df.orig schweikh1.orig \
|
|
||||||
chaos_nohalf
|
|
||||||
DATA_FILES= banks_files chaos_files fanf_files schweikh1_files schweikh3_files
|
|
||||||
|
|
||||||
|
|
||||||
all: ${WINNERS}
|
|
||||||
|
|
||||||
schweikh1: schweikh1.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh1.orig: schweikh1.orig.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh1_files: info
|
|
||||||
|
|
||||||
df: df.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
df.orig: prog.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
prog.c : df.c
|
|
||||||
${RM} -f prog.c
|
|
||||||
${CP} $? prog.c
|
|
||||||
|
|
||||||
dloweneil: dloweneil.c
|
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
|
|
||||||
# See note about use of -L/path/to/X11/lib/dir above this rule fails to link
|
|
||||||
#
|
#
|
||||||
banks: banks.c
|
CSILENCE+= -Wno-conditional-uninitialized -Wno-poison-system-directories \
|
||||||
${CC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
-Wno-sign-conversion -Wno-tautological-value-range-compare
|
||||||
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
|
||||||
-DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@
|
|
||||||
|
|
||||||
# See note about use of -L/path/to/X11/lib/dir above this rule fails to link
|
|
||||||
#
|
#
|
||||||
banks.orig: banks.orig.c
|
CWARN+= -Weverything
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \
|
|
||||||
-DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \
|
|
||||||
-DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@
|
|
||||||
|
|
||||||
banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc
|
|
||||||
|
|
||||||
dlowe: dlowe.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
dlowe.orig: dlowe.orig.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
bas2: bas2.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
fanf: fanf.c
|
|
||||||
${RM} -f fanftmp1.c fanftmp2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@
|
|
||||||
|
|
||||||
fanf_files: fanf.lambda
|
|
||||||
|
|
||||||
bas1: bas1.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
tomtorfs: tomtorfs.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
dorssel: dorssel.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh2: schweikh2.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh2.orig: schweikh2.orig.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
schweikh3: schweikh3.c
|
|
||||||
${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \
|
|
||||||
-DM3=realloc -DM4=calloc -DM5=free -o $@
|
|
||||||
|
|
||||||
schweikh3_files: samefile.1
|
|
||||||
|
|
||||||
schnitzi: schnitzi.c
|
|
||||||
${CC} ${CFLAGS} $? -o $@
|
|
||||||
|
|
||||||
chaos: chaos.c
|
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
|
|
||||||
# some libcurses do not have halfdelay(). This rule is for those systems
|
|
||||||
#
|
#
|
||||||
chaos_nohalf: chaos_nohalf.c
|
endif
|
||||||
${CC} ${CFLAGS} $? -lcurses -o $@
|
|
||||||
${CP} -f $@ chaos
|
|
||||||
|
|
||||||
chaos_nohalf.c: chaos.c
|
# Specific add-ons or replacements for gcc only
|
||||||
${RM} -f $@
|
#
|
||||||
${SED} -e 's/halfdelay([^)]*);//' < $? > $@
|
ifeq ($(CC),gcc)
|
||||||
|
#
|
||||||
|
#CSILENCE+=
|
||||||
|
#
|
||||||
|
#CWARN+=
|
||||||
|
#
|
||||||
|
endif
|
||||||
|
|
||||||
chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data
|
|
||||||
|
|
||||||
everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES}
|
##############################
|
||||||
|
# Special flags for this entry
|
||||||
|
##############################
|
||||||
|
#
|
||||||
|
ENTRY= tomtorfs
|
||||||
|
PROG= ${ENTRY}
|
||||||
|
#
|
||||||
|
OBJ= ${PROG}.o
|
||||||
|
DATA=
|
||||||
|
TARGET= ${PROG}
|
||||||
|
#
|
||||||
|
ALT_OBJ=
|
||||||
|
ALT_TARGET=
|
||||||
|
|
||||||
clean:
|
|
||||||
${RM} -f *.o a.out core ${WINNERS}
|
|
||||||
${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c
|
|
||||||
|
|
||||||
clobber: clean
|
#################
|
||||||
${RM} -f ${WINNERS}
|
# build the entry
|
||||||
${RM} -f ${ALT_NAMES}
|
#################
|
||||||
|
#
|
||||||
nuke: clobber
|
all: data ${TARGET}
|
||||||
@${TRUE}
|
@${TRUE}
|
||||||
|
|
||||||
install: all
|
.PHONY: all alt data everything clean clobber install \
|
||||||
${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null
|
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 ${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:
|
||||||
|
@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 '<was here>' /\\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"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
Best Self-Documenting:
|
# Best Self-Documenting:
|
||||||
|
|
||||||
Tom Torfs
|
Tom Torfs
|
||||||
De Nayer Instituut
|
De Nayer Instituut
|
||||||
@@ -8,17 +8,16 @@ Best Self-Documenting:
|
|||||||
|
|
||||||
http://members.xoom.com/tomtorfs
|
http://members.xoom.com/tomtorfs
|
||||||
|
|
||||||
|
## To build:
|
||||||
|
|
||||||
Judges' comments:
|
make all
|
||||||
|
|
||||||
To build:
|
### To run
|
||||||
|
|
||||||
make tomtorfs
|
|
||||||
|
|
||||||
To use:
|
|
||||||
|
|
||||||
./tomtorfs tomtorfs.c 32 04C11DB7 1 FFFFFFFF FFFFFFFF
|
./tomtorfs tomtorfs.c 32 04C11DB7 1 FFFFFFFF FFFFFFFF
|
||||||
|
|
||||||
|
## Judges' comments
|
||||||
|
|
||||||
Also try:
|
Also try:
|
||||||
|
|
||||||
echo "abscond conferrable" > file.A
|
echo "abscond conferrable" > file.A
|
||||||
@@ -32,8 +31,7 @@ Judges' comments:
|
|||||||
of the program with the value of CRC computed by PKZIP or any other
|
of the program with the value of CRC computed by PKZIP or any other
|
||||||
archiver that uses the CRC-32 algorithm.
|
archiver that uses the CRC-32 algorithm.
|
||||||
|
|
||||||
|
## Author's comments
|
||||||
Selected author's comments:
|
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
crc filename bitwidth polynom reflected init xor
|
crc filename bitwidth polynom reflected init xor
|
||||||
|
|||||||
Reference in new issue
Block a user