diff --git a/2018/ferguson/.gitignore b/2018/ferguson/.gitignore index 657860f36..eaf5aa5a9 100644 --- a/2018/ferguson/.gitignore +++ b/2018/ferguson/.gitignore @@ -1,5 +1,5 @@ prog -prog-simple +prog.alt prog.orig weasel -weasel-simple +weasel.alt diff --git a/2018/ferguson/FILES b/2018/ferguson/FILES index c7895e6c0..f3c62578f 100644 --- a/2018/ferguson/FILES +++ b/2018/ferguson/FILES @@ -5,8 +5,8 @@ prog.c This is the source file to the `weasel' program [1]. -prog-simple.c This is the source code file to the - `weasel-simple' program [1]. +prog.alt.c This is the source code file to the + `weasel.alt' program [1]. test.sh Script provided to test the weasel program [1]. @@ -79,8 +79,8 @@ the spec file. Please note that the paths below are dependent on the prefix used in installation; where I suggest '/usr' it is equally possible it could be under '/usr/local', for example. -[1] Note that 'prog.c' and 'prog-simple.c' would be - linked to 'weasel.c' and 'weasel-simple.c' +[1] Note that 'prog.c' and 'prog.alt.c' would be + linked to 'weasel.c' and 'weasel.alt.c' (respectively) in the '/usr/src/weasel' subdirectory. diff --git a/2018/ferguson/Makefile b/2018/ferguson/Makefile index 8735309dc..4429b4171 100644 --- a/2018/ferguson/Makefile +++ b/2018/ferguson/Makefile @@ -112,8 +112,8 @@ CSRC= ${PROG}.o DATA= FILES hint.css rpm.md test-strings.txt weasel.1 weasel.man weasel.spec TARGET= ${PROG} weasel # -ALT_OBJ= ${PROG}-simple.o -ALT_TARGET= ${PROG}-simple weasel-simple +ALT_OBJ= ${PROG}.alt +ALT_TARGET= ${PROG}.alt weasel.alt ################# @@ -141,10 +141,10 @@ test: ${PROG} test.sh alt: data ${ALT_TARGET} @${TRUE} -${PROG}-simple: ${PROG}-simple.c +${PROG}.alt: ${PROG}.alt.c ${CC} ${CFLAGS} $< -o $@ ${LIBS} -weasel-simple: ${PROG}-simple +weasel.alt: ${PROG}.alt ${CP} -f $< $@ # data files diff --git a/2018/ferguson/README.md b/2018/ferguson/README.md index 22be55eef..39b3b3a29 100644 --- a/2018/ferguson/README.md +++ b/2018/ferguson/README.md @@ -28,6 +28,12 @@ make make test ``` +### Alternate code: + +The author provided an alternate version which has a simpler keyboard for the +monkey Eric. See his comments under the 'keyboards' section, briefly referred to +in the 'what it is' section. + ## Judges' remarks: Looking back over the strata of past IOCCC entries, this program marks a new @@ -158,7 +164,7 @@ operative phrase is *given enough time*; but even if it's extremely unlikely monkey; I thought the monkey had it too easy: unlike his limited keyboard I have (besides space) every character in the ASCII range **`0<=126`** that **`isprint()`** returns non-zero except that only capital letters are included; -the file *`prog-simple.c`* has a slightly smaller keyboard. There are some +the file [prog.alt.c](prog.alt.c) has a slightly smaller keyboard. There are some additional features I have added (including two Easter eggs); amongst others: ability to change the target string and maximum length. See **[How it works](#how)**, **[Hints](#hints)** and **[How to build](#build)** for diff --git a/2018/ferguson/prog-simple.c b/2018/ferguson/prog.alt.c similarity index 100% rename from 2018/ferguson/prog-simple.c rename to 2018/ferguson/prog.alt.c diff --git a/2018/ferguson/weasel.1 b/2018/ferguson/weasel.1 index a33304e3f..1d19b133d 100644 --- a/2018/ferguson/weasel.1 +++ b/2018/ferguson/weasel.1 @@ -4,7 +4,7 @@ weasel \- The IOCCC 2018 Implementation of Richard Dawkins's Weasel program .SH SYNOPSIS \fBweasel\fP [\fI\-r\fP] [\fI\-m\fP] [\fI\-q\fP] [\fI\fP] .PP -\fBweasel\-simple\fP [\fI\-r\fP] [\fI\-m\fP] [\fI\-q\fP] [\fI\fP] +\fBweasel.alt\fP [\fI\-r\fP] [\fI\-m\fP] [\fI\-q\fP] [\fI\fP] .SH DESCRIPTION \fBweasel\fP is an obfuscated implementation of Richard Dawkins' \fIWeasel program\fP. According to Wikipedia in chapter three of his book \fIThe Blind Watchmaker\fP Dawkins wrote: @@ -28,7 +28,7 @@ has several additions: \fBtwo Easter eggs,\fP a \fBquiet output mode,\fP an \fBoption to change the mutation rate\fP as well as the ability to \fBspecify the chromosomal string.\fP Furthermore the keyboard isn't as limited as Dawkins's implementation. -The \fBweasel\-simple\fP keyboard is a more limited keyboard but not +The \fBweasel.alt\fP keyboard is a more limited keyboard but not as limited as Dawkins's Weasel program keyboard. .SH OPTIONS .PP @@ -141,9 +141,9 @@ quiet output from being enabled; on the other hand the options The source code to the \fBweasel\fP program. .RE .PP -\fI/usr/src/weasel/weasel\-simple.c\fP +\fI/usr/src/weasel/weasel.alt.c\fP .RS -The source code to the \fBweasel-simple\fP program. +The source code to the \fBweasel.alt\fP program. .RE .PP \fI/usr/src/weasel/Makefile\fP diff --git a/2018/ferguson/weasel.man b/2018/ferguson/weasel.man index fa3eba94e..30d6fa400 100644 --- a/2018/ferguson/weasel.man +++ b/2018/ferguson/weasel.man @@ -4,7 +4,7 @@ weasel \- The IOCCC 2018 Implementation of Richard Dawkins's Weasel program .SH SYNOPSIS \fBweasel\fP [\fI\-r\fP] [\fI\-m\fP] [\fI\-q\fP] [<\fIchromosomal string\fP>] .PP -\fBweasel\-simple\fP [\fI\-r\fP] [\fI\-m\fP] [\fI\-q\fP] [<\fIchromosomal string\fP>] +\fBweasel.alt\fP [\fI\-r\fP] [\fI\-m\fP] [\fI\-q\fP] [<\fIchromosomal string\fP>] .SH DESCRIPTION \fBweasel\fP is an obfuscated implementation of Richard Dawkins' \fIWeasel program\fP. According to Wikipedia in chapter three of his book \fIThe Blind Watchmaker\fP Dawkins wrote: @@ -28,7 +28,7 @@ has several additions: \fBtwo Easter eggs,\fP a \fBquiet output mode,\fP an \fBoption to change the mutation rate\fP as well as the ability to \fBspecify the chromosomal string.\fP Furthermore the keyboard isn't as limited as Dawkins's implementation. -The \fBweasel\-simple\fP keyboard is a more limited keyboard but not +The \fBweasel.alt\fP keyboard is a more limited keyboard but not as limited as Dawkins's Weasel program keyboard. .SH OPTIONS .PP @@ -141,9 +141,9 @@ quiet output from being enabled; on the other hand the options The source code to the \fBweasel\fP program. .RE .PP -\fIprog\-simple.c\fP +\fIprog.alt.c\fP .RS -The source code to the \fBweasel-simple\fP program. +The source code to the \fBweasel.alt\fP program. .RE .PP \fIMakefile\fP diff --git a/2018/ferguson/weasel.spec b/2018/ferguson/weasel.spec index 051f2e03d..507a4ee53 100644 --- a/2018/ferguson/weasel.spec +++ b/2018/ferguson/weasel.spec @@ -37,21 +37,21 @@ AutoReq: 1 %setup -n weasel %build -make weasel weasel-simple +make weasel weasel.alt mv -f README.md README.md 2>/dev/null || : %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{_bindir} $RPM_BUILD_ROOT%{_usrsrc}/weasel install -p -m 755 weasel $RPM_BUILD_ROOT%{_bindir}/weasel -install -p -m 755 weasel-simple $RPM_BUILD_ROOT%{_bindir}/weasel-simple +install -p -m 755 weasel.alt $RPM_BUILD_ROOT%{_bindir}/weasel.alt install -p -m 755 test.sh $RPM_BUILD_ROOT%{_usrsrc}/weasel/test.sh install -m 644 test-strings.txt $RPM_BUILD_ROOT%{_usrsrc}/weasel/test-strings.txt install -m 644 prog.c -D $RPM_BUILD_ROOT%{_usrsrc}/weasel/weasel.c ln -s weasel.c $RPM_BUILD_ROOT%{_usrsrc}/weasel/prog.c install -m 644 Makefile -D $RPM_BUILD_ROOT%{_usrsrc}/weasel -install -m 644 prog-simple.c -D $RPM_BUILD_ROOT%{_usrsrc}/weasel/weasel-simple.c -ln -s weasel-simple.c $RPM_BUILD_ROOT%{_usrsrc}/weasel/prog-simple.c +install -m 644 prog.alt.c -D $RPM_BUILD_ROOT%{_usrsrc}/weasel/weasel.alt.c +ln -s weasel.alt.c $RPM_BUILD_ROOT%{_usrsrc}/weasel/prog.alt.c install -m 644 weasel.1 -D $RPM_BUILD_ROOT%{_mandir}/man1/weasel.1 install -m 644 hint.html -D $RPM_BUILD_ROOT%{_docdir}/weasel/weasel.html install -m 644 README.md -D $RPM_BUILD_ROOT%{_docdir}/weasel/weasel.markdown