Fix and add alt code to 2006/sloane

Alt code uses usleep() with the macro Z (default 65000 but one can
override it - I explain in the README.md how to do this) to let one see
in modern systems what is going on. This also allows for those (like
myself) who don't like to see text (or other things) zooming by very
rapidly. The former is more important for most people I'd think. It
didn't even occur to me what was going on until I slowed it down and the
award title didn't mean anything to me until after it either though I
read about this entry a long time ago. But still the latter part is
useful as well.

Format fix README.md.

Fix compilation in some systems: compilation issue is that some
systems (looking at fedora and CentOS linux and probably others) don't
link in lm by default.

The other issue is what the author stated - that not using certain
includes might cause problems. To not ruin the format of the code I
added -include ... to the Makefile.
This commit is contained in:
Cody Boone Ferguson committed 2023-04-30 09:59:04 -07:00
1 parent ae310f9372
commit afe7bc1a17
3 files changed
+84 -20

No files matched your search

+8 -5
View File
@@ -58,11 +58,11 @@ ARCH=
# Defines that are needed to compile
#
CDEFINE=
CDEFINE= -DZ=65000
# Include files that are needed to compile
#
CINCLUDE=
CINCLUDE= -include math.h -include stdio.h
# Optimization
#
@@ -74,7 +74,7 @@ CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT}
# Libraries needed to build
#
LIBS=
LIBS= -lm
# C compiler to use
#
@@ -115,8 +115,8 @@ OBJ= ${PROG}.o
DATA=
TARGET= ${PROG}
#
ALT_OBJ=
ALT_TARGET=
ALT_OBJ= ${PROG}.alt.o
ALT_TARGET= ${PROG}.alt
#################
@@ -138,6 +138,9 @@ ${PROG}: ${PROG}.c
alt: data ${ALT_TARGET}
@${TRUE}
${PROG}.alt: ${PROG}.alt.c
${CC} ${CFLAGS} $< -o $@ ${LIBS}
# data files
#
data: ${DATA}