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: this entry requires the X11/Xlib.h header file and the X11 library to
compile. For more information see the
FAQ on "X11".
The author provided two alternate versions, one which adds a status bar and another that makes it text only. The author also described a version that they tested with Windows. See Alternate code below.
To use:
./toledo3 [1 | 2 | 3 [b]]
Try:
./toledo3 1
Alternate code:
The author provided two additional versions, toledo3-sbar.c and toledo3-txt.c. Respectively these create a status bar and make the game text only. Based on the author's remarks, another version, toledo3.alt.c, was added that should work with Windows.
Alternate build:
With the exception of the Windows version, these are built by default. To build the Windows version, toledo3.alt.c, you will have to figure out how to compile Windows code.
Alternate use:
Use toledo3-sbar and toledo3-txt as you would toledo3 above.
As for the Windows version, toledo3.alt, we presume you can open it like any
other application.
Judges' remarks:
It's pretty obvious from looking at it what this program does, since it's clearly spelled out in the code. The interesting question is whether this is easier or harder to understand than the code for Deep Blue.
Author's remarks:
There are so many text-based chess programs, what is that of
A1, H5, C4, D5? The queen is really pointing to the king?
So I managed to do a graphical X11 chess program ('WYSIAIE', or 'What You See
Is An IOCCC Entry'). Pointing and clicking to move pieces is the only required
action, and of course the command-line options:
./toledo3 # Two-players mode (useful if you don't have a board at hand)
./toledo3 1 # Human white - Computer black, level 1 (fast)
./toledo3 2 # Human white - Computer black, level 2 (medium)
./toledo3 3 # Human white - Computer black, level 3 (slow)
./toledo3 1 b # Human black - Computer white, level 1 (fast)
./toledo3 2 b # Human black - Computer white, level 2 (medium)
./toledo3 3 b # Human black - Computer white, level 3 (slow)
The computer will check that your moves are legal. Full legal chess moves are allowed, except minor promotions on human side.
The game will continue up to its logical conclusion, you make a mistake and the computer surpasses you. ;)
WHAT ABOUT THE ENGINE
Uses an alpha-beta search up to a depth of 3+level ply, extended with quiescence search, that helps playing strength, something around 1500 ELO (level 1) to 1700 ELO (level 3).
It searches the board and generates moves for each piece located. A lot of comparisons are used for en passant, castling and promotion. Would be faster with optimizations, but that optimizations use valuable IOCCC characters.
It plays a different game every time, using the C library random number generator.
Because it is resource-hungry, I strongly recommend to compile it using maximum optimization. With GCC you can use:
gcc -O3 -fexpensive-optimizations prog.c -o prog -lX11
KNOWN "FEATURES"
-
Because this is my second X11 program (the first was point n click happy face), I added sentences everywhere until it worked. :)
-
It is portable to Windows (using the supplied layer.c file) Change
#include <X11/Xlib.h> to #include "layer.c"and use a Windows compiler (only tested with Dev C/C++ 4.9.9.2) The play level is fixed, though you can change it easily. Of course, this is an example of an obfuscated Windows program (there exists another way of write them?). -
It will give warnings on compilation, so you can be sure that your compiler works.
-
It will not update the window while it is "thinking"
-
The space character has many useful applications, especially when it comes to the character limit (8).
-
I still don't understand what to do after semicolons. :P
CHALLENGES
It is possible to convert this code into JavaScript with a graphical interface. Can you do it?
Can the evaluation function be enhanced to make the program play stronger?
UPGRADES
Using toledo3-sbar.c (which is too large for this IOCCC's size rules) creates a status display about gameplay on the window title bar.
Using toledo3-txt.c turns this into being purely text based.