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.
To build:
make
NOTE: we disable the optimiser because this program has problems with it enabled.
Bugs and (Mis)features:
The current status of this entry is:
STATUS: INABIAF - please DO NOT fix
For more detailed information see 2019/karns in bugs.html.
To use:
./prog < textfile_that_fits_on_the_screen
You might want to type:
reset
after running the program to restore the terminal to its previous state.
Try:
./try.sh
If you have more time you might want to try:
./prog < README.md
Judges' remarks:
If you typically get lost in mazes, watching this program run might -- or might not, YMMV -- teach you how to find your way in a maze. The algorithm is well-known but the drawing is amazing!
Before running, make sure that your terminal can accommodate the whole file.
Before running make test, make it about 120x40 to be safe, ensuring that you
see the @ sign as well as the exclamation mark.
...Oh, and the first M in YMMV stands for "mazing".
A puzzle for the reader: Can you change the program to consider a diagonal movement as one step?
Author's remarks:
The Program:
This program is pretty simple! It performs a breadth first
search on the
specified graph. The graph can be any ASCII text file that has an 'at' (@)
character, which is going to be the starting location, and a ! character
which will be the destination.
The nodes on this graph that are spaces are connected with any directly adjacent nodes that are also spaces. Nodes that aren't spaces are not connected with anything.
Compiling and Running:
This program usually compiles under both GCC and clang. Build with:
$(CC) -std=c99 -o tbfs prog.c
where $(CC) is cc, gcc, clang, or some other C compiler.
You can then run it with:
cat <input file> | ./tbfs
Examples:
./tbfs < maze
./tbfs < prog.c
Issues
- The program must be ran in a terminal that supports ANSI escape codes for moving the cursor and changing colors.
- Segfaults happen sometimes.
- I don't know what memory management there is, if any.
- The program will not compile by an ANSI C compiler: it uses for loops, and it uses C++ style comments. It should compile cleanly using a C99 standard.
- Breadth first search is slow (and very slow on certain maps), but my A star version of this program is too big.
- Lots of extra whitespace may be needed if you want to feed in an arbitrary file.
- It fails to compile on GCC sometimes (according to a friend of mine, I've not encountered this myself).
- The program could be obfuscated much further.
- The program contains some unused code and data.