Files
ioccc/2005/vik
Landon Curt Noll f29b37e49a improve HTML menus, add social.html, prep for IOCCC28 winners
Prepare for the winners of **IOCCC28**.

> However these are not the 2024 droids you are looking for.  :-)

The HTML menu (both JavaScript and non-JavaScript) has been updated.

The `Status -> Rules and guidelines' have been replaced with two
separate menus `Status -> IOCCC rules` and `Status -> IOCCC guidelines`.

Added a new top level `social.html` page: built from a new `social.md`.

Sorted rules for building specific web pages in the top level `Makefile`.
Added `make social` to make the `social.html` page from `social.md`.

The `bin/gen-top-html.sh` now is able to process a argument of **social**
to process the new top level `social.html` page.

Changed `bin/gen-top-html.sh` VERSION from "2.0.0 2025-03-13"
to "2.0.1 2025-07-25".

Below `About -> Home page` a new `About -> IOCCC social media` menu item
as added.

Because the menu change touched every HTML file, we changed the general
copyright date range for HTML files from "1984-2024" to "1984-2025"
due to the extensive changes made for **IOCCC28**.

Those markdown files that were modified in 2025 had their copyright date
range also changed from "1984-2024" to "1984-2025".

Rebuilt tarballs and sitemap due to the extensive HTML rebuilding.

Ran `make update` to perform the above.
2025-07-26 13:06:29 -07:00
..
2020-12-30 16:57:03 -08:00
2020-12-30 16:57:03 -08:00
2020-12-30 16:57:03 -08:00
2020-12-30 16:57:03 -08:00
2024-08-29 13:16:53 -07:00
2020-12-30 16:57:03 -08:00
2023-07-06 21:49:38 -07:00

To build:

    make

NOTE: this entry requires the X11/Xlib.h header file and the X11 library to compile. For more information see the FAQ on "X11".

To use:

    ./vik [file.map]

Try:

    ./vik maze.map

Judges' remarks:

An amazing use of the X libraries with twisty code passages, all different. One risks running in code path circles as main() is called again and again. Be sure to pay attention to commas! :-)

Author's remarks:

This entry is a Wolfenstein style graphics engine where a user can navigate in a 3D world. The maze has walls with bitmap textures. The application contains a default world with textures, but the power of the engine is exposed through user configured maps. User defined worlds support up to 26 different wall textures that can even be animated. One example of a user defined world is submitted with the entry.

Features

This program is a complete 3D engine with

  • Easy configurable maze maps.
  • Up to 26 different bitmap textures in a maze.
  • Support for animated bitmap textures.
  • Uses default bitmaps in case the configured bitmaps can't be found.
  • A default map in case none is specified.
  • Configurable window size.
  • Navigation using cursor keys (rotate left and right, move forward and backward).

Build and Run

Compile the source code and link in X libraries if necessary. The program takes three options which have to be typed in a specific order as described below.

    ./vik [-w <width>] [mapfile]

where width specifies the width of the window and mapfile is the filename containing a map.

Examples

Start the engine using a built in labyrinth and texture bitmaps:

    ./vik

Start the engine and loads the labyrinth defined in the file maze.map:

    ./vik maze.map

Start the engine using maze.map in a window that is 400 pixels wide:

    ./vik -w 400 maze.map

Note that the mapfile has to be the last argument and the -w option if present has to be the first. The map definition files and the bitmap files should be located in the current directory.

Use the cursor keys to navigate through the labyrinth.

Creating mazes

A maze consists of a map file and texture bitmap files. The map file is an ASCII text file where lower case letters represent walls. The letter tells the engine what bitmap texture file to use. The * character lets the engine know where to position the user. The example below shows how a map file can look:

    aaaaaaaaaaaaa
    a           a
    a      *    a
    a    bbbb   cccccccc
    c                  c
    cccccccccccccccccccc

The engine loads the map, and creates walls. When a character in the range a-z is found, the engine will load the corresponding texture bitmap. The bitmap file must be named *.bmp where * is substituted with the letter of the wall in the map (note that only a, b and c exist).

So to load the map above, the files a.bmp, b.bmp, and c.bmp should be located in the same directory as the engine executable (or rather in the current directory).

Obfuscation

The program is obfuscated in several ways:

  • Bad use of variables.
  • Use of the ?: operator.
  • Recursive calls to main().
  • Bad use of for loops and the comma operator.
  • To make the final obfuscated touch I ran indent which really made the program unreadable (I guess that is not really the intent with indent ;) )

Compiler warnings

There are no compiler warnings when compiling with -ansi but there are quite a few warnings from lclint. Mainly because the program is very optimized for code size.

Limitations

The program only compiles and runs on X based systems.

The program does not run that smooth under Cygwin. It seems to be a priority issue with Cygwin and it can easily be solved by increasing the priority of the application a little bit.