While not strictly necessary, replacing the two ASCII tab characters in the markdown copyright comment makes it easier to detect problematic TAB indentation within markdown files. After this commit, only 90 markdown files have leading ASCII TAB characters. And again, while not strictly necessary, we can consider running expand on those 90 markdown files to see what effect that might have on the HTML files they produce. Replace leading ASCII TAB characters with multiples of 8 ASCII SPACE characters (the default action of the `expand(1)` tool) might have an negative effect on some HTML formatting where **hack-a-round** formatting was attempted to fix broken indentation caused by problematic ASCII TAB characters. Think of this as a baseline for evaluating leading TAB characters within markdown files. TODO: Consider either using `expand(1)` to replace leading ASCII TAB characters with multiples of 8 ASCII SPACE characters AND/OR modifying the appropriate `bin` tool to convert leading ASCII TAB characters into multiples of 8 ASCII SPACE characters.
To build:
make alt
NOTE: if you don't have curses or SDL1 installed both modes will fail to compile. In that case see the FAQ 3.8 - How do I compile an IOCCC entry that requires SDL1 or SDL2? and FAQ 3.9 - How do I compile an IOCCC entry that requires ncurses? for more information.
We recommend that you use the alternate code so you can see what this entry looked like back in 2000 (with a configurable speed). See the original code section for the original entry.
To use:
./thadgavin.alt
You can press 'q' at any time to exit.
Try:
If you have SDL1 installed:
./thadgavin_sdl
Whereas the curses version has an early exit the SDL version does not. You will have to kill it yourself.
You might also wish to reconfigure the speed at which the programs run. The code
calls usleep(3) with two default values, one for SDL and one for curses. The
curses and SDL macros are defined in the Makefile in a way that makes it easy to
redefine the values: SLEEP is how long the program sleeps (in microseconds)
between output with curses and SDL_SLEEP is how long it sleeps (also in
microseconds) for the SDL version.
To change the SDL one to something like 15000 you can do:
make SDL_SLEEP=15000 clobber alt
and to change the curses one to 40:
make SLEEP=40 clobber alt
Then use the program(s) in the same way.
The different macros is because the curses version is already much slower and so it's better to not tie the two values together. You may of course redefine both in the same command.
Original code:
WARNING: if you are sensitive to rapid movement or if you want to see better what is going on then please use the alternate code as described above. If you wish to see the original entry see below.
NOTE: in curses mode you might want to type reset after execution of this
program if your terminal is messed up after exiting the program (send intr,
typically ctrl-c) as the program does not call endwin(). Using reset will
clear the screen. The alternate code, as noted above, allows one to quit early so this
is not a problem there.
Original build:
make all
Original use:
./thadgavin
Original try:
If you have SDL1 installed:
./thadgavin_sdl
Judges' remarks:
This entry is a nice play by the rules. It can use curses, if the SDL graphic library is not present, and is quite good at that, but the colors used in graphic mode (16 bit depth) are unfortunately less than dazzling. We could not test this entry in DOS mode.
Authors' remarks:
To use under DOS:
Compile using DJGPP as follows:
gcc thadgavin.c -o thadgavin.exe -Wall -lm -O6 -mpentium -fomit-frame-pointer -ffast-math
To use under Windows, X-Windows or macOS using the Simple DirectMedia Layer:
gcc -O6 -lpthread -g -o thadgavin thadgavin.c -lSDL -DSDL -lm
To use curses:
gcc -O6 -lpthread -g -o thadgavin thadgavin.c -lncurses -lm
Warnings
In gcc you might get the following warning:
thadgavin.c.c:46: warning: passing arg 2 of `SDL_SetColors' from incompatible pointer type
In Microsoft Visual Studio you may get warnings as follows:
thadgavin.c(46) : warning C4133: 'function' : incompatible types - from 'unsigned
char *' to 'struct SDL_Color *'
thadgavin.c(63) : warning C4026: function declared with formal parameter list
thadgavin.c(77) : warning C4244: '=' : conversion from 'double ' to 'unsigned
char ', possible loss of data
But don't worry, this is completely normal.
Recommended dosage:
At least 3 minutes taken 3 times a day when tired.
Do not exceed 3 times recommended dose. May cause sickness, dizziness, nausea.