Move 2018/ferguson/prog-simple.c to prog.alt.c

This is to match the rest of the repo as this truly is an alt version,
not a supplementary program.

Updated README.md to have an 'Alternate code' section as well.

A number of files had to be changed as numerous files referred to
prog-simple.c.
This commit is contained in:
Cody Boone Ferguson committed 2023-04-12 03:07:15 -07:00
1 parent fc3a43d5f0
commit d664871317
8 files changed
+29 -23

No files matched your search

+2 -2
View File
@@ -1,5 +1,5 @@
prog
prog-simple
prog.alt
prog.orig
weasel
weasel-simple
weasel.alt
+4 -4
View File
@@ -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.
+4 -4
View File
@@ -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
+7 -1
View File
@@ -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
File renamed without changes.
+4 -4
View File
@@ -4,7 +4,7 @@ weasel \- The IOCCC 2018 Implementation of Richard Dawkins's Weasel program
.SH SYNOPSIS
\fBweasel\fP [\fI\-r<rate>\fP] [\fI\-m\fP] [\fI\-q\fP] [\fI<chromosomal string>\fP]
.PP
\fBweasel\-simple\fP [\fI\-r<rate>\fP] [\fI\-m\fP] [\fI\-q\fP] [\fI<chromosomal string>\fP]
\fBweasel.alt\fP [\fI\-r<rate>\fP] [\fI\-m\fP] [\fI\-q\fP] [\fI<chromosomal 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
\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
+4 -4
View File
@@ -4,7 +4,7 @@ weasel \- The IOCCC 2018 Implementation of Richard Dawkins's Weasel program
.SH SYNOPSIS
\fBweasel\fP [\fI\-r<rate>\fP] [\fI\-m\fP] [\fI\-q\fP] [<\fIchromosomal string\fP>]
.PP
\fBweasel\-simple\fP [\fI\-r<rate>\fP] [\fI\-m\fP] [\fI\-q\fP] [<\fIchromosomal string\fP>]
\fBweasel.alt\fP [\fI\-r<rate>\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
+4 -4
View File
@@ -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