The try script now runs the demo mode if perl is installed. It also now
prompts before running each script (the below noted ones) so that one
can control the pace of the output a bit more.
The glock.sh and hecate.sh scripts could only be run once successfully
because the output of run.c overwrites it (with non code). First one has
to do cp -f prog.c run.c which the scripts now do. This was not a
problem in the try script because I added that step explicitly (and is
now not needed or there).
The Makefile was modified in such a way that allows one to easily
redefine the size (in the code the S macro). For instance:
make clobber SIZE=50,50 all
The try.sh was renamed to endoh4.sh as it's more of a wrapper to the
program rather than things to try. Also it now lets one specify more
than one file to feed to the program (in sequence).
The bugs.md was updated - added INABIAF. If the file format is invalid
it will very likely crash.
The script checks for SoX, padsp and otherwise ruby. It allows one to
pass in args: each one is first checked to be a readable file and if
it is it'll be processed as a file; otherwise it'll be processed as a
string. If no arg is specified it runs the program on twinkle.abc and
the strings ABC and CDEFGABc (the latter suggested by the author).
If none of the three tools noted above are installed it tells the user
to install one of them first. I was not able to test the padsp(1) one
but the invocation matches the author's remarks. /dev/dsp seems to not
be installed in modern linux systems so it would be useful to have
padsp(1) if not SoX (which is preferable in general for entries that
play sound). The ruby script wavify.rb provided by the author is the
last resort which turns the output to a WAV file.
The additional commands I added cannot come first because the program
(as the bugs.md states and now more clearly) will likely crash (and does
in all the systems I tested) if the file does not exist. This did not
show itself the first time because the files already existed but running
make clobber before the script would remove the image files and thus a
crash (or actually two) would occur the first time the script was run
(second time it would be fine as the files it uses then exist).
The try.alt.sh uses the alt code. This helps further show how a single
letter can change so much and thus one can really appreciate the
subtlety of the entry even more. The other scripts were improved.
The Makefile rules added:
hint.pdf
hint
hello.pdf
hello
The hint rules generate the hint.pdf (which is the README.md file
obfuscated in a pdf) by feeding the program README.md and then it
compiles hint.pdf as C code. Running it will print the README.md file!
The hello rules generate hello.pdf which is (inside the pdf) an
obfuscated 'Hello World!' program. This is done by a simple echo piped o
the program which redirects it to hello.pdf. Then hello.pdf will be
compiled as C code which when run (as ./hello2) will print 'Hello
World!'.
The script now uses these rules to do what was once done manually. These
rules are .PHONY rules as otherwise they might not always run.
The clobber rule now removes these files.
The try section in the README.md file did not refer to the script.
The URL in the cookie recipe file was updated to refer to the domain
that the old one redirects to just in case the old one ever expires or
no longer redirects to the more recent domain. The thanks file notes
this for reference as an aside for context and historical purposes,
noting both URLs.
The new try.sh and try.bw.sh scripts run the program on one file (passed
to the script) in colour and without colour respectively. One file
because one has to terminate the program.
The new try.alt.bw.sh is like try.alt.sh but uses the black and white
(original submitted entry) version.
The scripts for the alt code allow one to set the different variables
that can be redefined. The use is the same variable names as in the
Makefile. For instance:
TIMER=5 SLEEP=5000 GRAVITY=I VISCOSITY=4 PRESSURE=1 ./try.alt.sh
TIMER=5 SLEEP=5000 GRAVITY=I VISCOSITY=4 PRESSURE=1 ./try.bw.alt.sh
for the gravity 'I' and:
TIMER=5 SLEEP=5000 GRAVITY=N VISCOSITY=4 PRESSURE=1 ./try.alt.sh
TIMER=5 SLEEP=5000 GRAVITY=N VISCOSITY=4 PRESSURE=1 ./try.bw.alt.sh
where 'N' is some number. Obviously the other values can have different
values than given above. Some of these values are protected against in
code (to an extent - if the user wants to set them to strings that's on
them) but not all are and the scripts do not try and check for the user
either.
The endoh1.alt.c file was changed in that one can now define SLEEP (S in
the code) to 0 like the original, should they want to see the original
but with other values specified. That will make it flash much more
quickly which can be a problem of course but that's up to each user.
The script will check that mplayer(1) is installed. If it is it will
pipe vik to mplayer. In that case it will still use the raw2wav program
just in case something goes wrong (or for some reason mplayer is not
what is expected). If mplayer cannot be found or is not a regular
executable file then it will just use raw2wav. The raw2wav function in
the script tells you the name of the converted file. In the case that
mplayer cannot be found the script also suggests that you play the WAV
files with a program that can play WAV files.
The bugs.md refers to the alt try script for testing any fix with the
Apple silicon chip. If someone gets it to work the entry could be
removed from the bugs.md file and the README.md file updated to refer to
the alternate code. As the alternate code does not work (though it has a
different type of crash) the alt build/try is not mentioned in the
README.md file. It is not clear if it's helpful or not to have it in the
README.md at this point as the important part is in bugs.md.
As 1994/westley requires (for good display) 80 columns, 8 character tabs
and wraparound it makes it harder to run the entry to enjoy it with
modern systems. Also because it generates messages through error
messages (of the compiler line) different compilers will show it
differently and it can end up being harder to follow. The alt code uses
the same logic but instead of using #includes (of files that don't
exist) it uses printf(3). Everything else is the same.
The try.alt.sh is just like the try.sh but for the alt code.
Since the alt code is ideal for modern systems the original code is
suggested second. This can be changed of course.
The script runs in a loop until the user answers anything but 'y' or 'Y'
when asked if they wish to make another one. It does NOT check the valid
range of characters or the length. Instead it suggests one try and see
what happens if they do not follow the rules.
Updated .gitignore.
It will run the program on a few files but before it runs it on the
remaining files (as there are quite a lot) it will ask you if you wish
to do so. It only asks once. If convert is found it will run convert on
the xbm images to convert to png. If it's not installed it will only
warn the user once so as to not spam them. If convert fails (say because
the convert is not convert from ImageMagick) it will warn once at the
end of the script. In any event if any files were converted it will list
the png files that exist at the end of the script. Otherwise it'll list
the xbm files. It does not first check if any of those file types exist
as it is presumed that at least a few will exist. If none do it is
likely an error in the program or a corrupted data file.
The alt script will reconfigure the width, height and iterations for the
second invocation.
Note that in some platforms this entry will not work (this is
documented in the remarks). That is one of the reasons there is only one
expression tested as one of the platforms it will not work with is arm64
which is what I primarily use.
Prompt to run test suite after the main feature is done and improve the
prompting. The test suite script gives a warning that it may take a bit
of time to run.
One of the features the author noted is also in the script. It was
documented by Yusuke but I chose to use the letters IOCCC instead (it
seemed more fitting). This is noted in the thanks file.
Many links no longer worked, had changed or are https enabled now. In at
least two cases the Internet Wayback Machine was required but most were
just changed to https. The link to cygwin had changed entirely. The link
to lynx(1) had changed too.
Typo fixes in src/localhost/test0.sh.
Minor updates to README.md.
I had renamed the arachnid.info to arachnid.txt as it's not really an
informative file but I forgot to update the command in the README.md
file. I was tempted to rename it to arachnid.maz as it's a maze file but
I kept it as a text file so that (some?) browsers know what to do with
it (though I'm not sure how strictly necessary that is it doesn't hurt
to have it as .txt either).
This simplifies the running of the program as the command lines
(different options) can be long and more complicated to type, especially
the last one. The script is menu driven. Initially I made it a loop so
one can run the command once to try multiple modes but this seems
unnecessary and created some display problems (depending on how
invocations were done).
The try.alt.sh script is slightly different from try.sh in that the
order is reversed.
The try.sh script now at the end always starts out in a sequence of
northern hemisphere then southern hemisphere so that one can guarantee
to get that form. The try.alt.sh does the same but starts out with the
southern hemisphere first.
This script runs repeatedly until (when prompted) one hits 'q' (or 'Q')
or else sends ctrl-c/intr. I also added a question to the extra credit
questions: are there any misspelt words and if there are what are they?
I also added that there's a way to cheat very easily but I did not say
how to do it. It should be pretty obvious how to do it to anyone who
tries the program once or if not once a few times.
The script runs the program on each data file, explaining how to use the
program, things to try and how to quit the program and how to terminate
the script prematurely.
Rather than make anyone manually update the Makefile (the command in the
README.md file suggested that one would use Makefile variables) or type
a more complicated command the Makefile now tries to compile the entry
as suggested if compilation fails. Thus one can type 'make all' and if
compilation fails it will try the SunOS way.
The 'to use' section was fixed also: it's not just specific gzipped
files but any so it now says 'file.gz' and adds that file.gz is any
gzipped file.
The try.sh script now has the command that used to be in to use and also
what was in the try section. It also copies rcm.c to rcm.cp.c and gzips
that file and then runs the program on that to show the source. All
paged through less(1), of course. Finally it does what the judges have
in their comments (which have been updated to say that the command is in
the try.sh script). The judges' command is naturally a shorter way to do
the one added in the try.sh script but it uses tee(1) to write both to
another file (piped to less(1)) so that it can compare the two.
Obviously the files will be the same but it shows how it works in
multiple ways.