Files
ioccc/2000/thadgavin
Landon Curt Noll c5848302e8 add new topbar, improve the look & feel of web pages
Thank you, @chris-sab, for your excellent work and for helping us
commit this alpha version of the topbar.

As part of this work, the following HTML sections were removed:

* begin-row
* begin-leftcolumn
* sidenav
* end-leftcolumn
* begin-rightcolumn
* before-content
* end-rightcolumn
* end-row.default

Also added a new HTML section, just above the "header" section:

* topbar

The web site now as a more modern looking topbar, thanks to the
work of the contractor (GitHub user @chris-sab) who is working on
issue #2273.

Performed `make www` to implement the above and test under macOS.

TODO: Fix the Responsive Web Design to deal with
      the new topbar system.

TODO: Improve the topbar.  What is there now is
      just an alpha version.

TODO: Decide what to do with `png/ioccc.png`.
      Remove it make selective use of the image on certain top level
      pages lower down?

TODO: The changes to `ioccc.css` causes some
      formatting problems with pages such as `location.html` (missing
      blank lines).  Fix formatting problems as needed.

TODO: Fix the "Nu HTML check this web page"
      links on things like the year level _YYYY/index.html_ pages.

TODO: Correct all HTML errors, warnings and perhaps
      informative messages from the Nu HTML check.

TODO: Consider adding color (colour) to the
      web pages in such a way that people with color perception
      challenges can still use the web site.

TODO: For those web browsers that have and allow
      JavaScript, make use of technology such as [Code
      Mirror](https://codemirror.net/) to directly render source
      code (C, shell, Makefile, etc.) with syntax coloring (colouring)
      directly in the browser.  For non-JavaScript browsers, fallback
      to the current use of GitHub source code viewing.
2024-04-16 17:28:39 -07:00
..

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 (n)curses? 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 alt 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.

At least 3 minutes taken 3 times a day when tired.

Do not exceed 3 times recommended dose. May cause sickness, dizziness, nausea.